aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <digit@google.com>2015-07-13 21:36:44 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-07-13 21:36:44 +0000
commit46d08b0aa29fe43573216976c0772c0361fd7647 (patch)
treeaa6e95cd6b44a67ab289665945b1535f41805ece
parent3638902cdc98c7bda44035cd8f540372fbad2e87 (diff)
parent0551db912c957e2d680bfedf8024508efb284130 (diff)
downloadqemu-46d08b0aa29fe43573216976c0772c0361fd7647.tar.gz
Merge "Fix cube map textures issue" into studio-1.4-dev automerge: 14861f3
automerge: 0551db9 * commit '0551db912c957e2d680bfedf8024508efb284130': Fix cube map textures issue
-rw-r--r--distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp2
-rw-r--r--distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.cpp13
-rw-r--r--distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.h1
3 files changed, 16 insertions, 0 deletions
diff --git a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
index aceb9863f4..b274e896aa 100644
--- a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
+++ b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp
@@ -419,6 +419,7 @@ GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D(GLenum target, GLint leve
GL_APICALL void GL_APIENTRY glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border){
GET_CTX();
SET_ERROR_IF(!(GLESv2Validate::pixelFrmt(ctx,internalformat) && GLESv2Validate::textureTargetEx(target)),GL_INVALID_ENUM);
+ SET_ERROR_IF((GLESv2Validate::textureIsCubeMap(target) && width != height), GL_INVALID_VALUE);
SET_ERROR_IF(border != 0,GL_INVALID_VALUE);
ctx->dispatcher().glCopyTexImage2D(target,level,internalformat,x,y,width,height,border);
}
@@ -1880,6 +1881,7 @@ GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint inte
GLESv2Validate::pixelType(ctx,type)),GL_INVALID_ENUM);
SET_ERROR_IF(!GLESv2Validate::pixelFrmt(ctx,internalformat), GL_INVALID_VALUE);
+ SET_ERROR_IF((GLESv2Validate::textureIsCubeMap(target) && width != height), GL_INVALID_VALUE);
SET_ERROR_IF((format == GL_DEPTH_COMPONENT || internalformat == GL_DEPTH_COMPONENT) &&
(type != GL_UNSIGNED_SHORT && type != GL_UNSIGNED_INT), GL_INVALID_OPERATION);
diff --git a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.cpp b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.cpp
index b711317501..f971864586 100644
--- a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.cpp
+++ b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.cpp
@@ -182,3 +182,16 @@ bool GLESv2Validate::programParam(GLenum pname){
}
return false;
}
+
+bool GLESv2Validate::textureIsCubeMap(GLenum target){
+ switch(target){
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+ case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+ return true;
+ }
+ return false;
+}
diff --git a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.h b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.h
index b7cd07de6c..66787783b8 100644
--- a/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.h
+++ b/distrib/android-emugl/host/libs/Translator/GLES_V2/GLESv2Validate.h
@@ -38,6 +38,7 @@ static bool pixelFrmt(GLEScontext* ctx,GLenum format);
static bool attribName(const GLchar* name);
static bool attribIndex(int index);
static bool programParam(GLenum pname);
+static bool textureIsCubeMap(GLenum target);
};
#endif