aboutsummaryrefslogtreecommitdiffstats
path: root/emulator/opengl/host/libs/Translator
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2014-11-17 16:19:06 -0800
committerbohu <bohu@google.com>2014-11-17 16:20:30 -0800
commit92ebbc674404fd90aba4df68216e1f103456c7fc (patch)
treec3365aff655fcdd7aa416995a3674a92d61912d0 /emulator/opengl/host/libs/Translator
parentbfe4a23956e144704f90b69bdab53cd4eb7dd8ba (diff)
downloadsdk-92ebbc674404fd90aba4df68216e1f103456c7fc.zip
sdk-92ebbc674404fd90aba4df68216e1f103456c7fc.tar.gz
sdk-92ebbc674404fd90aba4df68216e1f103456c7fc.tar.bz2
handles glGetFloatv with GL_STENCIL_VALUE_MASK etc
For GL_STENCIL_VALUE_MASK and the like, glGetFloatv returns -1 and this is incorrect, according to GLES 2 spec. This commit does proper casts to get sensible value. Change-Id: I9c07ddf812458bd2d374189c0c4263c44de0d6da
Diffstat (limited to 'emulator/opengl/host/libs/Translator')
-rw-r--r--emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
index fc201bb..4b84c44 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
@@ -1000,6 +1000,20 @@ GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params){
}
break;
+ case GL_STENCIL_BACK_VALUE_MASK:
+ case GL_STENCIL_BACK_WRITEMASK:
+ case GL_STENCIL_VALUE_MASK:
+ case GL_STENCIL_WRITEMASK:
+ {
+ GLint myint = 0;
+ glGetIntegerv(pname, &myint);
+ // Two casts are used: since mask is unsigned integer,
+ // the first cast converts to unsigned integer;
+ // the second cast converts to float.
+ *params = (GLfloat)((GLuint)(myint));
+ }
+ break;
+
default:
ctx->dispatcher().glGetFloatv(pname,params);
}