Skip to content

Commit

Permalink
COMPLETION_STATUS_KHR should be true on context loss
Browse files Browse the repository at this point in the history
KHR_parallel_shader_compile COMPLETION_STATUS_KHR queries should return
true unconditionally when the context is lost. This is intended to
prevent applications from entering an infinite polling loop.

Spec clarification and test are landing upstream:
KhronosGroup/WebGL#3188

Bug: angleproject:3379
Change-Id: I3c63235ccc3e07e0557e80021888886f893d268a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559534
Auto-Submit: James Darpinian <[email protected]>
Commit-Queue: Kenneth Russell <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Cr-Commit-Position: refs/heads/master@{#831184}
GitOrigin-RevId: c67854d8f41a3b02257e2acb2fb7480f609abd11
  • Loading branch information
jdarpinian authored and copybara-github committed Nov 26, 2020
1 parent 0cdd65e commit 3a7dcb7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions blink/renderer/modules/webgl/webgl_rendering_context_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3717,6 +3717,10 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter(
ScriptState* script_state,
WebGLProgram* program,
GLenum pname) {
// Completion status queries always return true on a lost context. This is
// intended to prevent applications from entering an infinite polling loop.
if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR)
return WebGLAny(script_state, true);
if (!ValidateWebGLProgramOrShader("getProgramParamter", program)) {
return ScriptValue::CreateNull(script_state->GetIsolate());
}
Expand Down Expand Up @@ -3829,6 +3833,10 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter(
ScriptState* script_state,
WebGLShader* shader,
GLenum pname) {
// Completion status queries always return true on a lost context. This is
// intended to prevent applications from entering an infinite polling loop.
if (isContextLost() && pname == GL_COMPLETION_STATUS_KHR)
return WebGLAny(script_state, true);
if (!ValidateWebGLProgramOrShader("getShaderParameter", shader)) {
return ScriptValue::CreateNull(script_state->GetIsolate());
}
Expand Down

0 comments on commit 3a7dcb7

Please sign in to comment.