Fix compile errors in the essl to hlsl standalone translator.

ANGLEBUG=469
R=shannonwoods@chromium.org

Review URL: https://codereview.appspot.com/13281043
This commit is contained in:
Jamie Madill 2013-09-23 14:57:06 -04:00
Родитель d2d340b0da
Коммит b41ebf5798
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -83,7 +83,7 @@ int main(int argc, char* argv[])
case 'i': compileOptions |= SH_INTERMEDIATE_TREE; break;
case 'm': compileOptions |= SH_MAP_LONG_VARIABLE_NAMES; break;
case 'o': compileOptions |= SH_OBJECT_CODE; break;
case 'u': compileOptions |= SH_ATTRIBUTES_UNIFORMS; break;
case 'u': compileOptions |= SH_VARIABLES; break;
case 'l': compileOptions |= SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX; break;
case 'e': compileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS; break;
case 'd': compileOptions |= SH_DEPENDENCY_GRAPH; break;
@ -172,7 +172,7 @@ int main(int argc, char* argv[])
LogMsg("END", "COMPILER", numCompiles, "OBJ CODE");
printf("\n\n");
}
if (compiled && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) {
if (compiled && (compileOptions & SH_VARIABLES)) {
LogMsg("BEGIN", "COMPILER", numCompiles, "ACTIVE ATTRIBS");
PrintActiveVariables(compiler, SH_ACTIVE_ATTRIBUTES, (compileOptions & SH_MAP_LONG_VARIABLE_NAMES) != 0);
LogMsg("END", "COMPILER", numCompiles, "ACTIVE ATTRIBS");
@ -305,15 +305,17 @@ void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongV
size_t activeVars = 0;
int size = 0;
ShDataType type = SH_NONE;
ShPrecisionType precision = SH_PRECISION_UNDEFINED;
int staticUse = 0;
const char* typeName = NULL;
ShGetInfo(compiler, varType, &activeVars);
for (size_t i = 0; i < activeVars; ++i) {
switch (varType) {
case SH_ACTIVE_ATTRIBUTES:
ShGetActiveAttrib(compiler, static_cast<int>(i), NULL, &size, &type, name, mappedName);
ShGetVariableInfo(compiler, SH_ACTIVE_ATTRIBUTES, static_cast<int>(i), NULL, &size, &type, &precision, &staticUse, name, mappedName);
break;
case SH_ACTIVE_UNIFORMS:
ShGetActiveUniform(compiler, static_cast<int>(i), NULL, &size, &type, name, mappedName);
ShGetVariableInfo(compiler, SH_ACTIVE_UNIFORMS, static_cast<int>(i), NULL, &size, &type, &precision, &staticUse, name, mappedName);
break;
default: assert(0);
}