summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 01:07:06 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 01:07:06 +0000
commitc7698b3b98b4a493e163bb307627b54822ca022f (patch)
tree0ec1fe7e6b42211950c1df294e3ad0177c003008 /gpu
parenta2dce39e9e18d6fd5b095c5266db3bbe6be985d1 (diff)
downloadchromium_src-c7698b3b98b4a493e163bb307627b54822ca022f.zip
chromium_src-c7698b3b98b4a493e163bb307627b54822ca022f.tar.gz
chromium_src-c7698b3b98b4a493e163bb307627b54822ca022f.tar.bz2
Fix GL_OES_standard_derivatives support.
Forgot to add an enum TEST=another opengl es 2.0 conformance test passes BUG=none Review URL: http://codereview.chromium.org/4867001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66030 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/common/gles2_cmd_utils.cc4
-rw-r--r--gpu/command_buffer/service/feature_info.cc2
-rw-r--r--gpu/command_buffer/service/feature_info_unittest.cc4
-rw-r--r--gpu/command_buffer/service/gl_utils.h1
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