diff options
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/common/gles2_cmd_utils.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info.cc | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/feature_info_unittest.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/gl_utils.h | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index 4ed42a2..b9806ab 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -291,6 +291,10 @@ int GLES2Util::GLGetNumValuesReturned(int id) const { case GL_CURRENT_VERTEX_ATTRIB: return 4; + // -- glHint with GL_OES_standard_derivatives + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: + return 1; + // bad enum default: return 0; diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc index 8fdac29..71ccb5b 100644 --- a/gpu/command_buffer/service/feature_info.cc +++ b/gpu/command_buffer/service/feature_info.cc @@ -274,6 +274,8 @@ void FeatureInfo::AddFeatures(const char* desired_features) { ext.Desire("GL_OES_standard_derivatives"))) { AddExtensionString("GL_OES_standard_derivatives"); feature_flags_.oes_standard_derivatives = true; + validators_.hint_target.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); + validators_.g_l_state.AddValue(GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES); } // TODO(gman): Add support for these extensions. diff --git a/gpu/command_buffer/service/feature_info_unittest.cc b/gpu/command_buffer/service/feature_info_unittest.cc index 819b6cc..8a46c3e 100644 --- a/gpu/command_buffer/service/feature_info_unittest.cc +++ b/gpu/command_buffer/service/feature_info_unittest.cc @@ -382,6 +382,10 @@ TEST_F(FeatureInfoTest, InitializeOES_standard_derivatives) { info_.Initialize(NULL); EXPECT_THAT(info_.extensions(), HasSubstr("GL_OES_standard_derivatives")); EXPECT_TRUE(info_.feature_flags().oes_standard_derivatives); + EXPECT_TRUE(info_.validators()->hint_target.IsValid( + GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES)); + EXPECT_TRUE(info_.validators()->g_l_state.IsValid( + GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES)); } TEST_F(FeatureInfoTest, InitializeCHROMIUM_webglsl) { diff --git a/gpu/command_buffer/service/gl_utils.h b/gpu/command_buffer/service/gl_utils.h index daa1603..0a14c9f 100644 --- a/gpu/command_buffer/service/gl_utils.h +++ b/gpu/command_buffer/service/gl_utils.h @@ -28,6 +28,7 @@ #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_SHADER_COMPILER 0x8DFA #define GL_RGB565 0x8D62 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B #define GL_GLEXT_PROTOTYPES 1 |