Disable GL_OES_standard_derivatives when ps_2_x or later is not available.

BUG=392
Review URL: https://codereview.appspot.com/7027051


Author:    bsalomon@google.com

(manual merge from master by daniel@transgaming.com)

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1704 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer.h b/src/libGLESv2/renderer/Renderer.h
index dab8d3b..e31594e 100644
--- a/src/libGLESv2/renderer/Renderer.h
+++ b/src/libGLESv2/renderer/Renderer.h
@@ -150,6 +150,7 @@
     virtual bool getTextureFilterAnisotropySupport() const = 0;
     virtual float getTextureMaxAnisotropy() const = 0;
     virtual bool getShareHandleSupport() const = 0;
+    virtual bool getDerivativeInstructionSupport() const = 0;
 
     virtual int getMajorShaderModel() const = 0;
     virtual float getMaxPointSize() const = 0;
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 860a35e..9e71cb7 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -1414,6 +1414,13 @@
     return false && !gl::perfActive();
 }
 
+bool Renderer11::getDerivativeInstructionSupport() const
+{
+    // TODO
+    // UNIMPLEMENTED();
+    return false;
+}
+
 int Renderer11::getMajorShaderModel() const
 {
     switch (mFeatureLevel)
diff --git a/src/libGLESv2/renderer/Renderer11.h b/src/libGLESv2/renderer/Renderer11.h
index c4d45f7..0a06fd1 100644
--- a/src/libGLESv2/renderer/Renderer11.h
+++ b/src/libGLESv2/renderer/Renderer11.h
@@ -105,6 +105,7 @@
     virtual bool getTextureFilterAnisotropySupport() const;
     virtual float getTextureMaxAnisotropy() const;
     virtual bool getShareHandleSupport() const;
+    virtual bool getDerivativeInstructionSupport() const;
 
     virtual int getMajorShaderModel() const;
     virtual float getMaxPointSize() const;
diff --git a/src/libGLESv2/renderer/Renderer9.cpp b/src/libGLESv2/renderer/Renderer9.cpp
index 7b23c94..e0b1b8c 100644
--- a/src/libGLESv2/renderer/Renderer9.cpp
+++ b/src/libGLESv2/renderer/Renderer9.cpp
@@ -2211,6 +2211,11 @@
     return (mD3d9Ex != NULL) && !gl::perfActive();
 }
 
+bool Renderer9::getDerivativeInstructionSupport() const
+{
+    return (mDeviceCaps.PS20Caps.Caps & D3DPS20CAPS_GRADIENTINSTRUCTIONS) != 0;
+}
+
 int Renderer9::getMajorShaderModel() const
 {
     return D3DSHADER_VERSION_MAJOR(mDeviceCaps.PixelShaderVersion);
diff --git a/src/libGLESv2/renderer/Renderer9.h b/src/libGLESv2/renderer/Renderer9.h
index b4648a3..03c3d28 100644
--- a/src/libGLESv2/renderer/Renderer9.h
+++ b/src/libGLESv2/renderer/Renderer9.h
@@ -130,6 +130,7 @@
     virtual bool getTextureFilterAnisotropySupport() const;
     virtual float getTextureMaxAnisotropy() const;
     virtual bool getShareHandleSupport() const;
+    virtual bool getDerivativeInstructionSupport() const;
 
     virtual int getMajorShaderModel() const;
     virtual float getMaxPointSize() const;