From ceae3709d2044017e177d53b83b254eb2a965af5 Mon Sep 17 00:00:00 2001 From: Jim Sagevid Date: Thu, 1 Mar 2012 12:14:27 +0100 Subject: [PATCH] Fixed a bug where mutable uniforms wasn't reported by the Hlsl2Glsl_GetUniformInfo api. --- hlslang/GLSLCodeGen/hlslLinker.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hlslang/GLSLCodeGen/hlslLinker.cpp b/hlslang/GLSLCodeGen/hlslLinker.cpp index eadc1da..434beae 100644 --- a/hlslang/GLSLCodeGen/hlslLinker.cpp +++ b/hlslang/GLSLCodeGen/hlslLinker.cpp @@ -655,18 +655,22 @@ bool HlslLinker::link(HlslCrossCompiler* compiler, const char* entryFunc, bool u // for (std::map::iterator it = globalSymMap.begin(); it != globalSymMap.end(); it++) { - if (it->second->getQualifier() != EqtUniform) + if (it->second->getQualifier() != EqtUniform && it->second->getQualifier() != EqtMutableUniform) continue; - + ShUniformInfo infoStruct; - infoStruct.name = new char[it->first.size()+1]; - strcpy( infoStruct.name, it->first.c_str()); + + const std::string& name = it->second->getName(false); + infoStruct.name = new char[name.size()+1]; + strcpy(infoStruct.name, name.c_str()); + if (it->second->getSemantic() != "") { infoStruct.semantic = new char[it->second->getSemantic().size()+1]; strcpy( infoStruct.semantic, it->second->getSemantic().c_str()); } else + infoStruct.semantic = 0; //gigantic hack, the enumerations are kept in alignment