aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbohu <bohu@google.com>2014-11-17 16:19:06 -0800
committerBo Hu <bohu@google.com>2014-11-18 20:56:43 +0000
commit14d8dc711dfd81ee6d8da7f7a16690db75a960fe (patch)
tree7cfcefc76525a0df89f91fd0b072860534e6cec6
parent7e91a740cb092a020c1bb6e99982e162741ffd61 (diff)
downloadsdk-14d8dc711dfd81ee6d8da7f7a16690db75a960fe.zip
sdk-14d8dc711dfd81ee6d8da7f7a16690db75a960fe.tar.gz
sdk-14d8dc711dfd81ee6d8da7f7a16690db75a960fe.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 (cherry picked from commit 92ebbc674404fd90aba4df68216e1f103456c7fc)
-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 fe64f6f..81f867f 100644
--- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
+++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
@@ -934,6 +934,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);
}