Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1625643003: Don't enable shader extenstions in WebGL 2 when they are already core. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 5f451d311800009a31cf19e1346f979248f06679..f7073dbddb41c6b853c87753ca411b949433ca5d 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3202,47 +3202,49 @@ bool GLES2DecoderImpl::InitializeShaderTranslator() {
resources.FragmentPrecisionHigh =
PrecisionMeetsSpecForHighpFloat(range[0], range[1], precision);
- if (feature_info_->IsWebGLContext()) {
- resources.OES_standard_derivatives = derivatives_explicitly_enabled_;
- resources.EXT_frag_depth = frag_depth_explicitly_enabled_;
- resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_;
- if (!draw_buffers_explicitly_enabled_)
- resources.MaxDrawBuffers = 1;
- resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_;
- resources.NV_draw_buffers =
- draw_buffers_explicitly_enabled_ && features().nv_draw_buffers;
- } else {
- resources.OES_standard_derivatives =
- features().oes_standard_derivatives ? 1 : 0;
- resources.ARB_texture_rectangle =
- features().arb_texture_rectangle ? 1 : 0;
- resources.OES_EGL_image_external =
- features().oes_egl_image_external ? 1 : 0;
- resources.EXT_draw_buffers =
- features().ext_draw_buffers ? 1 : 0;
- resources.EXT_frag_depth =
- features().ext_frag_depth ? 1 : 0;
- resources.EXT_shader_texture_lod =
- features().ext_shader_texture_lod ? 1 : 0;
- resources.NV_draw_buffers =
- features().nv_draw_buffers ? 1 : 0;
- resources.EXT_blend_func_extended =
- features().ext_blend_func_extended ? 1 : 0;
- }
-
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.EXT_frag_depth = frag_depth_explicitly_enabled_;
+ resources.EXT_draw_buffers = draw_buffers_explicitly_enabled_;
+ if (!draw_buffers_explicitly_enabled_)
+ resources.MaxDrawBuffers = 1;
+ resources.EXT_shader_texture_lod = shader_texture_lod_explicitly_enabled_;
+ resources.NV_draw_buffers =
+ draw_buffers_explicitly_enabled_ && features().nv_draw_buffers;
break;
case CONTEXT_TYPE_WEBGL2:
shader_spec = SH_WEBGL2_SPEC;
break;
case CONTEXT_TYPE_OPENGLES2:
shader_spec = SH_GLES2_SPEC;
+ resources.OES_standard_derivatives =
+ features().oes_standard_derivatives ? 1 : 0;
+ resources.ARB_texture_rectangle =
+ features().arb_texture_rectangle ? 1 : 0;
+ resources.OES_EGL_image_external =
+ features().oes_egl_image_external ? 1 : 0;
+ resources.EXT_draw_buffers =
+ features().ext_draw_buffers ? 1 : 0;
+ resources.EXT_frag_depth =
+ features().ext_frag_depth ? 1 : 0;
+ resources.EXT_shader_texture_lod =
+ features().ext_shader_texture_lod ? 1 : 0;
+ resources.NV_draw_buffers =
+ features().nv_draw_buffers ? 1 : 0;
+ resources.EXT_blend_func_extended =
+ features().ext_blend_func_extended ? 1 : 0;
break;
case CONTEXT_TYPE_OPENGLES3:
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;
default:
NOTREACHED();
@@ -9985,8 +9987,8 @@ error::Error GLES2DecoderImpl::HandleGetString(uint32_t immediate_data_size,
break;
case GL_EXTENSIONS:
{
- // For WebGL contexts, strip out the OES derivatives and
- // EXT frag depth extensions if they have not been enabled.
+ // For WebGL contexts, strip out shader extensions if they have not
+ // been enabled on WebGL1 or no longer exist (become core) in WebGL2.
if (feature_info_->IsWebGLContext()) {
extensions = feature_info_->extensions();
if (!derivatives_explicitly_enabled_) {
@@ -12330,7 +12332,7 @@ error::Error GLES2DecoderImpl::HandleRequestExtensionCHROMIUM(
bool desire_frag_depth = false;
bool desire_draw_buffers = false;
bool desire_shader_texture_lod = false;
- if (feature_info_->IsWebGLContext()) {
+ if (feature_info_->context_type() == CONTEXT_TYPE_WEBGL1) {
desire_standard_derivatives =
feature_str.find("GL_OES_standard_derivatives") != std::string::npos;
desire_frag_depth =
« no previous file with comments | « content/test/gpu/gpu_tests/webgl2_conformance_expectations.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698