Fixed plain integer pointers being passed to ShGetInfo which expects size_t pointers.

TRAC #22678 Signed-off-by: Nicolas Capens Author: Geoff Lang git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1976 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0efef90c
...@@ -65,7 +65,7 @@ int main(int argc, char* argv[]) ...@@ -65,7 +65,7 @@ int main(int argc, char* argv[])
ShHandle vertexCompiler = 0; ShHandle vertexCompiler = 0;
ShHandle fragmentCompiler = 0; ShHandle fragmentCompiler = 0;
char* buffer = 0; char* buffer = 0;
int bufferLen = 0; size_t bufferLen = 0;
int numAttribs = 0, numUniforms = 0; int numAttribs = 0, numUniforms = 0;
ShShaderSpec spec = SH_GLES2_SPEC; ShShaderSpec spec = SH_GLES2_SPEC;
ShShaderOutput output = SH_ESSL_OUTPUT; ShShaderOutput output = SH_ESSL_OUTPUT;
...@@ -282,7 +282,7 @@ void LogMsg(const char* msg, const char* name, const int num, const char* logNam ...@@ -282,7 +282,7 @@ void LogMsg(const char* msg, const char* name, const int num, const char* logNam
void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongVariableNames) void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongVariableNames)
{ {
int nameSize = 0; size_t nameSize = 0;
switch (varType) { switch (varType) {
case SH_ACTIVE_ATTRIBUTES: case SH_ACTIVE_ATTRIBUTES:
ShGetInfo(compiler, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &nameSize); ShGetInfo(compiler, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &nameSize);
...@@ -297,22 +297,23 @@ void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongV ...@@ -297,22 +297,23 @@ void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongV
char* mappedName = NULL; char* mappedName = NULL;
if (mapLongVariableNames) { if (mapLongVariableNames) {
int mappedNameSize = 0; size_t mappedNameSize = 0;
ShGetInfo(compiler, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameSize); ShGetInfo(compiler, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameSize);
mappedName = new char[mappedNameSize]; mappedName = new char[mappedNameSize];
} }
int activeVars = 0, size = 0; size_t activeVars = 0;
int size = 0;
ShDataType type = SH_NONE; ShDataType type = SH_NONE;
const char* typeName = NULL; const char* typeName = NULL;
ShGetInfo(compiler, varType, &activeVars); ShGetInfo(compiler, varType, &activeVars);
for (int i = 0; i < activeVars; ++i) { for (size_t i = 0; i < activeVars; ++i) {
switch (varType) { switch (varType) {
case SH_ACTIVE_ATTRIBUTES: case SH_ACTIVE_ATTRIBUTES:
ShGetActiveAttrib(compiler, i, NULL, &size, &type, name, mappedName); ShGetActiveAttrib(compiler, static_cast<int>(i), NULL, &size, &type, name, mappedName);
break; break;
case SH_ACTIVE_UNIFORMS: case SH_ACTIVE_UNIFORMS:
ShGetActiveUniform(compiler, i, NULL, &size, &type, name, mappedName); ShGetActiveUniform(compiler, static_cast<int>(i), NULL, &size, &type, name, mappedName);
break; break;
default: assert(0); default: assert(0);
} }
...@@ -337,7 +338,7 @@ void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongV ...@@ -337,7 +338,7 @@ void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongV
case SH_SAMPLER_EXTERNAL_OES: typeName = "GL_SAMPLER_EXTERNAL_OES"; break; case SH_SAMPLER_EXTERNAL_OES: typeName = "GL_SAMPLER_EXTERNAL_OES"; break;
default: assert(0); default: assert(0);
} }
printf("%d: name:%s type:%s size:%d", i, name, typeName, size); printf("%u: name:%s type:%s size:%d", i, name, typeName, size);
if (mapLongVariableNames) if (mapLongVariableNames)
printf(" mapped name:%s", mappedName); printf(" mapped name:%s", mappedName);
printf("\n"); printf("\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment