Fix texunit->uniform location mappings disaster inherited from upstream. Kudos to Drake for sharing the nvidia warning logs and bringing this to my attention.

This commit is contained in:
Shyotl
2019-03-10 01:30:26 -06:00
parent 5d75b3b223
commit 6c15ee6556
2 changed files with 82 additions and 47 deletions

View File

@@ -73,6 +73,13 @@ public:
SG_SKY,
SG_WATER
};
struct gl_uniform_data_t {
std::string name;
GLenum type = -1;
GLint size = -1;
U32 texunit_priority = UINT_MAX; // Lower gets earlier texunits indices.
};
static std::set<LLGLSLShader*> sInstances;
static bool sProfileEnabled;
@@ -107,7 +114,7 @@ public:
void attachObjects(GLhandleARB* objects = NULL, S32 count = 0);
BOOL mapAttributes(const std::vector<LLStaticHashedString> * attributes);
BOOL mapUniforms(const std::vector<LLStaticHashedString> *);
void mapUniform(GLint index, const std::vector<LLStaticHashedString> *);
void mapUniform(const gl_uniform_data_t& gl_uniform, const std::vector<LLStaticHashedString> *);
S32 getUniformFromIndex(const U32 index)
{
if (mUniform.size() <= index)