opengles emulator: fix the uniform location WAR for intel platforms

Fixed the location shift WAR to work for arrays that starts at
location 0. Fixed conformance regressions made by this workaround.
The conversion should be smarter than just shifting 16-bits back
and forth, it should take into account if array element is being
accessed.

Change-Id: Icb746c67e16edfacb8264a1e687fd24ac6e868e7
This commit is contained in:
Guy Zadickario
2011-08-10 08:39:53 +03:00
parent ea7f72a6c7
commit 7944edcdb2
3 changed files with 84 additions and 20 deletions

View File

@@ -49,7 +49,9 @@ private:
GLint base;
GLint size;
GLenum type;
}IndexInfo;
GLint appBase;
GLint hostLocsPerElement;
} IndexInfo;
GLuint m_numIndexes;
IndexInfo* m_Indexes;
@@ -64,8 +66,9 @@ public:
GLuint getIndexForLocation(GLint location);
GLenum getTypeForLocation(GLint location);
bool needUniformLocationWAR() const { return m_locShiftWAR; }
void setupLocationShiftWAR();
GLint locationWARHostToApp(GLint hostLoc);
GLint locationWARHostToApp(GLint hostLoc, GLint arrIndex);
GLint locationWARAppToHost(GLint appLoc);
};
@@ -93,8 +96,9 @@ public:
void setProgramIndexInfo(GLuint program, GLuint index, GLint base, GLint size, GLenum type);
GLenum getProgramUniformType(GLuint program, GLint location);
void setupLocationShiftWAR(GLuint program);
GLint locationWARHostToApp(GLuint program, GLint hostLoc);
GLint locationWARHostToApp(GLuint program, GLint hostLoc, GLint arrIndex);
GLint locationWARAppToHost(GLuint program, GLint appLoc);
bool needUniformLocationWAR(GLuint program);
void addShaderData(GLuint shader);
bool isShader(GLuint shader);