OSDN Git Service

Implement GL_CURRENT_COLOR/NORMAL/TEXTURE_COORDS for glGetFloatv().
authorNicolas Capens <capn@google.com>
Thu, 13 Apr 2017 17:35:09 +0000 (13:35 -0400)
committerNicolas Capens <capn@google.com>
Thu, 13 Apr 2017 20:09:01 +0000 (20:09 +0000)
Bug b/31913614
Bug b/32087196

Change-Id: I45c06c7cb907ae1f1efc57c6302044334159c828
Reviewed-on: https://swiftshader-review.googlesource.com/7734
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libGLES_CM/Context.cpp

index 5fca63e..1a4ed35 100644 (file)
@@ -1175,6 +1175,24 @@ bool Context::getFloatv(GLenum pname, GLfloat *params)
                        params[i] = projectionStack.current()[i % 4][i / 4];
                }
                break;
+       case GL_CURRENT_COLOR:
+               for(int i = 0; i < 4; i++)
+               {
+                       params[i] = mState.vertexAttribute[sw::Color0].mCurrentValue[i];
+               }
+               break;
+       case GL_CURRENT_NORMAL:
+               for(int i = 0; i < 3; i++)
+               {
+                       params[i] = mState.vertexAttribute[sw::Normal].mCurrentValue[i];
+               }
+               break;
+       case GL_CURRENT_TEXTURE_COORDS:
+               for(int i = 0; i < 4; i++)
+               {
+                       params[i] = mState.vertexAttribute[sw::TexCoord0].mCurrentValue[i];
+               }
+               break;
        default:
                return false;
        }