am bf13fc81: Merge "opengles emulator: fix bugs in CUBE_MAP implementation in GLES_CM"
* commit 'bf13fc811bc23b22d9d3ceef3cb12d7ec70bc6fe': opengles emulator: fix bugs in CUBE_MAP implementation in GLES_CM
This commit is contained in:
@@ -323,7 +323,7 @@ GL_API void GL_APIENTRY glBindTexture( GLenum target, GLuint texture) {
|
|||||||
if (texData->target==0)
|
if (texData->target==0)
|
||||||
texData->target = target;
|
texData->target = target;
|
||||||
//if texture was already bound to another target
|
//if texture was already bound to another target
|
||||||
SET_ERROR_IF(texData->target!=target,GL_INVALID_OPERATION);
|
SET_ERROR_IF(ctx->GLTextureTargetToLocal(texData->target) != ctx->GLTextureTargetToLocal(target), GL_INVALID_OPERATION);
|
||||||
texData->wasBound = true;
|
texData->wasBound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -532,7 +532,7 @@ GL_API void GL_APIENTRY glDisable( GLenum cap) {
|
|||||||
ctx->dispatcher().glDisable(GL_TEXTURE_GEN_T);
|
ctx->dispatcher().glDisable(GL_TEXTURE_GEN_T);
|
||||||
ctx->dispatcher().glDisable(GL_TEXTURE_GEN_R);
|
ctx->dispatcher().glDisable(GL_TEXTURE_GEN_R);
|
||||||
}
|
}
|
||||||
ctx->dispatcher().glDisable(cap);
|
else ctx->dispatcher().glDisable(cap);
|
||||||
if (cap==GL_TEXTURE_2D || cap==GL_TEXTURE_CUBE_MAP_OES)
|
if (cap==GL_TEXTURE_2D || cap==GL_TEXTURE_CUBE_MAP_OES)
|
||||||
ctx->setTextureEnabled(cap,false);
|
ctx->setTextureEnabled(cap,false);
|
||||||
}
|
}
|
||||||
@@ -1849,9 +1849,9 @@ GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param)
|
|||||||
GET_CTX()
|
GET_CTX()
|
||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_S,pname,param);
|
ctx->dispatcher().glTexGenf(GL_S,pname,param);
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_T,pname,param);
|
ctx->dispatcher().glTexGenf(GL_T,pname,param);
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_R,pname,param);
|
ctx->dispatcher().glTexGenf(GL_R,pname,param);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGenf(coord,pname,param);
|
ctx->dispatcher().glTexGenf(coord,pname,param);
|
||||||
@@ -1861,9 +1861,9 @@ GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat
|
|||||||
GET_CTX()
|
GET_CTX()
|
||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_S,pname,params);
|
ctx->dispatcher().glTexGenfv(GL_S,pname,params);
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_T,pname,params);
|
ctx->dispatcher().glTexGenfv(GL_T,pname,params);
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_R,pname,params);
|
ctx->dispatcher().glTexGenfv(GL_R,pname,params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGenfv(coord,pname,params);
|
ctx->dispatcher().glTexGenfv(coord,pname,params);
|
||||||
@@ -1872,9 +1872,9 @@ GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param) {
|
|||||||
GET_CTX()
|
GET_CTX()
|
||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGeni(GL_TEXTURE_GEN_S,pname,param);
|
ctx->dispatcher().glTexGeni(GL_S,pname,param);
|
||||||
ctx->dispatcher().glTexGeni(GL_TEXTURE_GEN_T,pname,param);
|
ctx->dispatcher().glTexGeni(GL_T,pname,param);
|
||||||
ctx->dispatcher().glTexGeni(GL_TEXTURE_GEN_R,pname,param);
|
ctx->dispatcher().glTexGeni(GL_R,pname,param);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGeni(coord,pname,param);
|
ctx->dispatcher().glTexGeni(coord,pname,param);
|
||||||
@@ -1883,9 +1883,9 @@ GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *
|
|||||||
GET_CTX()
|
GET_CTX()
|
||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGeniv(GL_TEXTURE_GEN_S,pname,params);
|
ctx->dispatcher().glTexGeniv(GL_S,pname,params);
|
||||||
ctx->dispatcher().glTexGeniv(GL_TEXTURE_GEN_T,pname,params);
|
ctx->dispatcher().glTexGeniv(GL_T,pname,params);
|
||||||
ctx->dispatcher().glTexGeniv(GL_TEXTURE_GEN_R,pname,params);
|
ctx->dispatcher().glTexGeniv(GL_R,pname,params);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGeniv(coord,pname,params);
|
ctx->dispatcher().glTexGeniv(coord,pname,params);
|
||||||
@@ -1894,9 +1894,9 @@ GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param)
|
|||||||
GET_CTX()
|
GET_CTX()
|
||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_S,pname,X2F(param));
|
ctx->dispatcher().glTexGenf(GL_S,pname,X2F(param));
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_T,pname,X2F(param));
|
ctx->dispatcher().glTexGenf(GL_T,pname,X2F(param));
|
||||||
ctx->dispatcher().glTexGenf(GL_TEXTURE_GEN_R,pname,X2F(param));
|
ctx->dispatcher().glTexGenf(GL_R,pname,X2F(param));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGenf(coord,pname,X2F(param));
|
ctx->dispatcher().glTexGenf(coord,pname,X2F(param));
|
||||||
@@ -1907,9 +1907,9 @@ GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed
|
|||||||
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
SET_ERROR_IF(!GLEScmValidate::texGen(coord,pname),GL_INVALID_ENUM);
|
||||||
tmpParams[0] = X2F(params[0]);
|
tmpParams[0] = X2F(params[0]);
|
||||||
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
if (coord == GL_TEXTURE_GEN_STR_OES) {
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_S,pname,tmpParams);
|
ctx->dispatcher().glTexGenfv(GL_S,pname,tmpParams);
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_T,pname,tmpParams);
|
ctx->dispatcher().glTexGenfv(GL_T,pname,tmpParams);
|
||||||
ctx->dispatcher().glTexGenfv(GL_TEXTURE_GEN_R,pname,tmpParams);
|
ctx->dispatcher().glTexGenfv(GL_R,pname,tmpParams);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
ctx->dispatcher().glTexGenfv(coord,pname,tmpParams);
|
ctx->dispatcher().glTexGenfv(coord,pname,tmpParams);
|
||||||
@@ -1922,9 +1922,9 @@ GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *p
|
|||||||
GLfloat state_s = GL_FALSE;
|
GLfloat state_s = GL_FALSE;
|
||||||
GLfloat state_t = GL_FALSE;
|
GLfloat state_t = GL_FALSE;
|
||||||
GLfloat state_r = GL_FALSE;
|
GLfloat state_r = GL_FALSE;
|
||||||
ctx->dispatcher().glGetTexGenfv(GL_TEXTURE_GEN_S,pname,&state_s);
|
ctx->dispatcher().glGetTexGenfv(GL_S,pname,&state_s);
|
||||||
ctx->dispatcher().glGetTexGenfv(GL_TEXTURE_GEN_T,pname,&state_t);
|
ctx->dispatcher().glGetTexGenfv(GL_T,pname,&state_t);
|
||||||
ctx->dispatcher().glGetTexGenfv(GL_TEXTURE_GEN_R,pname,&state_r);
|
ctx->dispatcher().glGetTexGenfv(GL_R,pname,&state_r);
|
||||||
*params = state_s && state_t && state_r ? GL_TRUE: GL_FALSE;
|
*params = state_s && state_t && state_r ? GL_TRUE: GL_FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1938,9 +1938,9 @@ GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *par
|
|||||||
GLint state_s = GL_FALSE;
|
GLint state_s = GL_FALSE;
|
||||||
GLint state_t = GL_FALSE;
|
GLint state_t = GL_FALSE;
|
||||||
GLint state_r = GL_FALSE;
|
GLint state_r = GL_FALSE;
|
||||||
ctx->dispatcher().glGetTexGeniv(GL_TEXTURE_GEN_S,pname,&state_s);
|
ctx->dispatcher().glGetTexGeniv(GL_S,pname,&state_s);
|
||||||
ctx->dispatcher().glGetTexGeniv(GL_TEXTURE_GEN_T,pname,&state_t);
|
ctx->dispatcher().glGetTexGeniv(GL_T,pname,&state_t);
|
||||||
ctx->dispatcher().glGetTexGeniv(GL_TEXTURE_GEN_R,pname,&state_r);
|
ctx->dispatcher().glGetTexGeniv(GL_R,pname,&state_r);
|
||||||
*params = state_s && state_t && state_r ? GL_TRUE: GL_FALSE;
|
*params = state_s && state_t && state_r ? GL_TRUE: GL_FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ bool GLEScmValidate::texParams(GLenum target,GLenum pname) {
|
|||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return target == GL_TEXTURE_2D;
|
return (target == GL_TEXTURE_2D)||(target == GL_TEXTURE_CUBE_MAP_OES);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLEScmValidate::texEnv(GLenum target,GLenum pname) {
|
bool GLEScmValidate::texEnv(GLenum target,GLenum pname) {
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ GL_APICALL void GL_APIENTRY glBindTexture(GLenum target, GLuint texture){
|
|||||||
if (texData->target==0)
|
if (texData->target==0)
|
||||||
texData->target = target;
|
texData->target = target;
|
||||||
//if texture was already bound to another target
|
//if texture was already bound to another target
|
||||||
SET_ERROR_IF(texData->target !=target,GL_INVALID_OPERATION);
|
SET_ERROR_IF(ctx->GLTextureTargetToLocal(texData->target) != ctx->GLTextureTargetToLocal(target), GL_INVALID_OPERATION);
|
||||||
texData->wasBound = true;
|
texData->wasBound = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public:
|
|||||||
static int getMaxTexSize(){return s_glSupport.maxTexSize;}
|
static int getMaxTexSize(){return s_glSupport.maxTexSize;}
|
||||||
static Version glslVersion(){return s_glSupport.glslVersion;}
|
static Version glslVersion(){return s_glSupport.glslVersion;}
|
||||||
static bool isAutoMipmapSupported(){return s_glSupport.GL_SGIS_GENERATE_MIPMAP;}
|
static bool isAutoMipmapSupported(){return s_glSupport.GL_SGIS_GENERATE_MIPMAP;}
|
||||||
|
static TextureTarget GLTextureTargetToLocal(GLenum target);
|
||||||
|
|
||||||
virtual bool glGetIntegerv(GLenum pname, GLint *params);
|
virtual bool glGetIntegerv(GLenum pname, GLint *params);
|
||||||
virtual bool glGetBooleanv(GLenum pname, GLboolean *params);
|
virtual bool glGetBooleanv(GLenum pname, GLboolean *params);
|
||||||
@@ -170,7 +171,6 @@ private:
|
|||||||
|
|
||||||
virtual void setupArr(const GLvoid* arr,GLenum arrayType,GLenum dataType,GLint size,GLsizei stride, GLboolean normalized, int pointsIndex = -1) = 0 ;
|
virtual void setupArr(const GLvoid* arr,GLenum arrayType,GLenum dataType,GLint size,GLsizei stride, GLboolean normalized, int pointsIndex = -1) = 0 ;
|
||||||
GLuint getBuffer(GLenum target);
|
GLuint getBuffer(GLenum target);
|
||||||
TextureTarget GLTextureTargetToLocal(GLenum target);
|
|
||||||
|
|
||||||
ShareGroupPtr m_shareGroup;
|
ShareGroupPtr m_shareGroup;
|
||||||
GLenum m_glError;
|
GLenum m_glError;
|
||||||
|
|||||||
@@ -17,6 +17,10 @@
|
|||||||
typedef double GLclampd; /* double precision float in [0,1] */
|
typedef double GLclampd; /* double precision float in [0,1] */
|
||||||
typedef double GLdouble; /* double precision float */
|
typedef double GLdouble; /* double precision float */
|
||||||
|
|
||||||
|
#define GL_S 0x2000
|
||||||
|
#define GL_T 0x2001
|
||||||
|
#define GL_R 0x2002
|
||||||
|
#define GL_Q 0x2003
|
||||||
#define GL_TEXTURE_GEN_S 0x0C60
|
#define GL_TEXTURE_GEN_S 0x0C60
|
||||||
#define GL_TEXTURE_GEN_T 0x0C61
|
#define GL_TEXTURE_GEN_T 0x0C61
|
||||||
#define GL_TEXTURE_GEN_R 0x0C62
|
#define GL_TEXTURE_GEN_R 0x0C62
|
||||||
|
|||||||
Reference in New Issue
Block a user