Commit 8bc9fcfe authored by zmo's avatar zmo Committed by Commit bot

Don't enable shader extenstions in WebGL 2 when they are already core.

BUG=295792
TEST=webgl2_conformance
R=bajones@chromium.org

Review URL: https://codereview.chromium.org/1625643003

Cr-Commit-Position: refs/heads/master@{#371627}
parent f3f0ae0f
...@@ -79,14 +79,12 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations): ...@@ -79,14 +79,12 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
self.Fail('conformance2/glsl3/array-complex-indexing.html', bug=483282) self.Fail('conformance2/glsl3/array-complex-indexing.html', bug=483282)
self.Fail('conformance2/glsl3/forbidden-operators.html', bug=483282) self.Fail('conformance2/glsl3/forbidden-operators.html', bug=483282)
self.Fail('conformance2/extensions/promoted-extensions-in-shaders.html',
bug=295792)
self.Fail('conformance2/samplers/sampler-drawing-test.html', bug=483282) self.Fail('conformance2/samplers/sampler-drawing-test.html', bug=483282)
self.Fail('conformance2/state/gl-object-get-calls.html', bug=483282) self.Fail('conformance2/state/gl-object-get-calls.html', bug=483282)
# Note that this test fails on ['win', 'intel'] with bug=483282 # Note that this test fails on ['win', 'intel'] with bug=483282
self.Fail('conformance2/buffers/uniform-buffers.html', bug=577368) self.Fail('conformance2/buffers/uniform-buffers.html', bug=577368)
# Windows and Mac. # Windows only.
self.Fail('conformance2/textures/canvas/tex-image-and-sub-image-2d' + self.Fail('conformance2/textures/canvas/tex-image-and-sub-image-2d' +
'-with-canvas-r8-red-unsigned_byte.html', '-with-canvas-r8-red-unsigned_byte.html',
['win'], bug=483282) ['win'], bug=483282)
...@@ -197,7 +195,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations): ...@@ -197,7 +195,6 @@ class WebGL2ConformanceExpectations(WebGLConformanceExpectations):
'-with-webgl-canvas-rgba4-rgba-unsigned_short_4_4_4_4.html', '-with-webgl-canvas-rgba4-rgba-unsigned_short_4_4_4_4.html',
['win'], bug=483282) ['win'], bug=483282)
# Windows only.
self.Skip('deqp/functional/gles3/readpixel.html', ['win'], bug=483282) self.Skip('deqp/functional/gles3/readpixel.html', ['win'], bug=483282)
self.Skip('deqp/functional/gles3/texturestatequery.html', self.Skip('deqp/functional/gles3/texturestatequery.html',
['win'], bug=483282) ['win'], bug=483282)
......
...@@ -3202,7 +3202,10 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() { ...@@ -3202,7 +3202,10 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.FragmentPrecisionHigh = resources.FragmentPrecisionHigh =
PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision); PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision);
if (feature_info_->IsWebGLContext()) { ShShaderSpec shader_spec;
switch (feature_info_->context_type()) {
case CONTEXT_TYPE_WEBGL1:
shader_spec = SH_WEBGL_SPEC;
resources.OES_standard_derivatives = derivatives_explicitly_enabled_; resources.OES_standard_derivatives = derivatives_explicitly_enabled_;
resources.EXT_frag_depth = frag_depth_explicitly_enabled_; resources.EXT_frag_depth = frag_depth_explicitly_enabled_;
resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_; resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_;
...@@ -3211,7 +3214,12 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() { ...@@ -3211,7 +3214,12 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_; resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_;
resources.NV_draw_buffers = resources.NV_draw_buffers =
draw_buffers_explicitly_enabled_ && features().nv_draw_buffers; draw_buffers_explicitly_enabled_ && features().nv_draw_buffers;
} else { break;
case CONTEXT_TYPE_WEBGL2:
shader_spec = SH_WEBGL2_SPEC;
break;
case CONTEXT_TYPE_OPENGLES2:
shader_spec = SH_GLES2_SPEC;
resources.OES_standard_derivatives = resources.OES_standard_derivatives =
features().oes_standard_derivatives ? 1 : 0; features().oes_standard_derivatives ? 1 : 0;
resources.ARB_texture_rectangle = resources.ARB_texture_rectangle =
...@@ -3228,21 +3236,15 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() { ...@@ -3228,21 +3236,15 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
features().nv_draw_buffers ? 1 : 0; features().nv_draw_buffers ? 1 : 0;
resources.EXT_blend_func_extended = resources.EXT_blend_func_extended =
features().ext_blend_func_extended ? 1 : 0; features().ext_blend_func_extended ? 1 : 0;
}
ShShaderSpec shader_spec;
switch (feature_info_->context_type()) {
case CONTEXT_TYPE_WEBGL1:
shader_spec = SH_WEBGL_SPEC;
break;
case CONTEXT_TYPE_WEBGL2:
shader_spec = SH_WEBGL2_SPEC;
break;
case CONTEXT_TYPE_OPENGLES2:
shader_spec = SH_GLES2_SPEC;
break; break;
case CONTEXT_TYPE_OPENGLES3: case CONTEXT_TYPE_OPENGLES3:
shader_spec = SH_GLES3_SPEC; shader_spec = SH_GLES3_SPEC;
resources.ARB_texture_rectangle =
features().arb_texture_rectangle ? 1 : 0;
resources.OES_EGL_image_external =
features().oes_egl_image_external ? 1 : 0;
resources.EXT_blend_func_extended =
features().ext_blend_func_extended ? 1 : 0;
break; break;
default: default:
NOTREACHED(); NOTREACHED();
...@@ -9985,8 +9987,8 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32_t immediate_data_size, ...@@ -9985,8 +9987,8 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32_t immediate_data_size,
break; break;
case GL_EXTENSIONS: case GL_EXTENSIONS:
{ {
// For WebGL contexts, strip out the OES derivatives and // For WebGL contexts, strip out shader extensions if they have not
// EXT frag depth extensions if they have not been enabled. // been enabled on WebGL1 or no longer exist (become core) in WebGL2.
if (feature_info_->IsWebGLContext()) { if (feature_info_->IsWebGLContext()) {
extensions = feature_info_->extensions(); extensions = feature_info_->extensions();
if (!derivatives_explicitly_enabled_) { if (!derivatives_explicitly_enabled_) {
...@@ -12330,7 +12332,7 @@ error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM( ...@@ -12330,7 +12332,7 @@ error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM(
bool desire_frag_depth = false; bool desire_frag_depth = false;
bool desire_draw_buffers = false; bool desire_draw_buffers = false;
bool desire_shader_texture_lod = false; bool desire_shader_texture_lod = false;
if (feature_info_->IsWebGLContext()) { if (feature_info_->context_type() == CONTEXT_TYPE_WEBGL1) {
desire_standard_derivatives = desire_standard_derivatives =
feature_str.find("GL_OES_standard_derivatives") != std::string::npos; feature_str.find("GL_OES_standard_derivatives") != std::string::npos;
desire_frag_depth = desire_frag_depth =
......
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