opengles emulator: fix uniform name translation to apps
add special handling of locations smaller or equal to 0
do not translate location -1 (this location means the
uniform is not found)
location 0 does not need translation, it has no effect
Change-Id: Idbde51f08433ed70a5a1a2cf1ede51043f3cca76
diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp b/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp
index ac36084..f46889b 100644
--- a/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp
+++ b/tools/emulator/opengl/shared/OpenglCodecCommon/GLSharedGroup.cpp
@@ -82,13 +82,13 @@
GLint ProgramData::locationWARHostToApp(GLint hostLoc)
{
- if (m_locShiftWAR) return hostLoc>>16;
+ if (m_locShiftWAR && hostLoc>0) return hostLoc>>16;
else return hostLoc;
}
GLint ProgramData::locationWARAppToHost(GLint appLoc)
{
- if (m_locShiftWAR) return appLoc<<16;
+ if (m_locShiftWAR && appLoc>0) return appLoc<<16;
else return appLoc;
}