diff options
author | bohu <bohu@google.com> | 2014-11-06 18:46:35 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-06 18:46:36 +0000 |
commit | 9631afbe3363fc458c16c80eae70a5776fa5fdac (patch) | |
tree | e5ee2bee744a8223a04740f1e1b1e96d173e2c9b /emulator | |
parent | 34704a5913e1e322eb5ece73543e9ce467a99bca (diff) | |
parent | c4966e0ad3faa046c293f855e48e8125d6fcd8d0 (diff) | |
download | sdk-9631afbe3363fc458c16c80eae70a5776fa5fdac.zip sdk-9631afbe3363fc458c16c80eae70a5776fa5fdac.tar.gz sdk-9631afbe3363fc458c16c80eae70a5776fa5fdac.tar.bz2 |
Merge "Validate glClear mask"
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp | 3 |
1 files changed, 3 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 76542c1..cebd5a9 100644 --- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -324,6 +324,9 @@ GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target){ GL_APICALL void GL_APIENTRY glClear(GLbitfield mask){ GET_CTX(); + GLbitfield allowed_bits = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; + GLbitfield has_disallowed_bits = (mask & ~allowed_bits); + SET_ERROR_IF(has_disallowed_bits, GL_INVALID_VALUE); ctx->drawValidate(); ctx->dispatcher().glClear(mask); |