diff options
| author | Guy Zadickario <guy@graphtech.co.il> | 2011-08-05 16:04:33 +0300 |
|---|---|---|
| committer | David 'Digit' Turner <digit@android.com> | 2011-08-10 10:53:06 +0200 |
| commit | 52829d82ab415afd15053f2953fad81b0fdbe4d0 (patch) | |
| tree | 0837287e8c1e5524bff771d974c5401ab1b96fac /tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h | |
| parent | f7e07ec9ea77ea6a589a4708df13f805998a6ba9 (diff) | |
opengles emulator: Workaround Cordy (Unity) bug with intel driver.
Uniform locations are 32-bit values which the application queries
from the driver after a shader program is linked. It seems that Cordy
game (possibly all Unity based apps) store the returned location as
16-bit value. Intel driver returns location values in the upper 16-bit
range :(
This is a workaround for this issue, when a program is linked we check
the locations of all uniforms, if all locations are within the upper
16-bit range (as with Intel driver) we shift the location value before
returning to the application. Also override all functions which take
a location parameter and do the reverse shift before sending a location
value to the host.
Change-Id: I234aaafe3313774b5da79eb1dac713b89b10ad60
Diffstat (limited to 'tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h')
| -rw-r--r-- | tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h b/tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h index bc895d750..6b12f6871 100644 --- a/tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h +++ b/tools/emulator/opengl/shared/OpenglCodecCommon/GLClientState.h @@ -120,6 +120,9 @@ public: } size_t pixelDataSize(GLsizei width, GLsizei height, GLenum format, GLenum type, int pack) const; + void setCurrentProgram(GLint program) { m_currentProgram = program; } + GLint currentProgram() const { return m_currentProgram; } + private: PixelStoreState m_pixelStore; VertexAttribState *m_states; @@ -127,7 +130,7 @@ private: GLuint m_currentArrayVbo; GLuint m_currentIndexVbo; int m_activeTexture; - + GLint m_currentProgram; bool validLocation(int location) { return (location >= 0 && location < m_nLocations); } public: |
