Commit c67854d8 authored by James Darpinian's avatar James Darpinian Committed by Commit Bot

COMPLETION_STATUS_KHR should be true on context loss

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:
https://github.com/KhronosGroup/WebGL/pull/3188

Bug: angleproject:3379
Change-Id: I3c63235ccc3e07e0557e80021888886f893d268a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2559534
Auto-Submit: James Darpinian <jdarpinian@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831184}
parent c68ce9fe
...@@ -3717,6 +3717,10 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter( ...@@ -3717,6 +3717,10 @@ ScriptValue WebGLRenderingContextBase::getProgramParameter(
ScriptState* script_state, ScriptState* script_state,
WebGLProgram* program, WebGLProgram* program,
GLenum pname) { 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)) { if (!ValidateWebGLProgramOrShader("getProgramParamter", program)) {
return ScriptValue::CreateNull(script_state->GetIsolate()); return ScriptValue::CreateNull(script_state->GetIsolate());
} }
...@@ -3829,6 +3833,10 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter( ...@@ -3829,6 +3833,10 @@ ScriptValue WebGLRenderingContextBase::getShaderParameter(
ScriptState* script_state, ScriptState* script_state,
WebGLShader* shader, WebGLShader* shader,
GLenum pname) { 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)) { if (!ValidateWebGLProgramOrShader("getShaderParameter", shader)) {
return ScriptValue::CreateNull(script_state->GetIsolate()); return ScriptValue::CreateNull(script_state->GetIsolate());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment