Fix a number of bugs with texture bindings

This commit is contained in:
Luke Benstead 2017-06-01 09:32:28 +01:00
parent 3a1f7d24d8
commit 824b7a64ab
4 changed files with 16 additions and 6 deletions

View File

@ -209,7 +209,8 @@ GLuint _glKosVertexColor();
GLubyte _glKosMaxTextureUnits();
GLubyte _glKosEnabledTextureMatrix();
GL_TEXTURE_OBJECT *_glKosBoundMultiTexID();
GL_TEXTURE_OBJECT *_glKosBoundMultiTexObject();
GLuint _glKosActiveTextureBoundTexID();
inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex,
pvr_vertex_t *src,

View File

@ -834,7 +834,7 @@ static GLuint _glKosArraysApplyClipping(GLfloat *uvsrc, GLuint uvstride, GLenum
static inline void _glKosArraysApplyMultiTexture(GLenum mode, GLuint count) {
if(GL_KOS_VERTEX_PTR_MODE & GL_KOS_USE_TEXTURE1) {
GL_TEXTURE_OBJECT* tex = _glKosBoundMultiTexID();
GL_TEXTURE_OBJECT* tex = _glKosBoundMultiTexObject();
if(tex) {
_glKosPushMultiTexObject(tex,
(pvr_vertex_t *)_glKosVertexBufPointer(),

View File

@ -200,7 +200,7 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
break;
case GL_TEXTURE_BINDING_2D:
*params = _glKosBoundTexID();
*params = _glKosActiveTextureBoundTexID();
break;
default:

View File

@ -98,13 +98,22 @@ void _glKosCompileHdrTx() {
_glKosCompileHdrT(GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF]) : _glKosCompileHdr();
}
GL_TEXTURE_OBJECT *_glKosBoundMultiTexID() {
GL_TEXTURE_OBJECT *_glKosBoundMultiTexObject() {
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF];
}
GLuint _glKosBoundMultiTexID() {
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF] ?
GL_KOS_TEXTURE_UNIT[GL_TEXTURE1_ARB & 0xF]->index : 0;
}
GLuint _glKosBoundTexID() {
return GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE] ?
GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->index : 0;
return GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF] ?
GL_KOS_TEXTURE_UNIT[GL_TEXTURE0_ARB & 0xF]->index : 0;
}
GLuint _glKosActiveTextureBoundTexID() {
return (GL_KOS_ACTIVE_TEXTURE) ? _glKosBoundMultiTexID() : _glKosBoundTexID();
}
GLubyte _glKosMaxTextureUnits() {