Commit 585f2a84 by Kimmo Kinnunen Committed by Jamie Madill

Print outputs when printing variables in shader translator

Print outputs when printing variables in shader translator. BUG=angleproject:1085 Change-Id: I67e301c4392fef70e6a186d404aff720b601a08d Reviewed-on: https://chromium-review.googlesource.com/287214Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 36da9269
......@@ -263,7 +263,7 @@ void usage()
"Where: filename : filename ending in .frag or .vert\n"
" -i : print intermediate tree\n"
" -o : print translated code\n"
" -u : print active attribs, uniforms, and varyings\n"
" -u : print active attribs, uniforms, varyings and program outputs\n"
" -l : unroll for-loops with integer indices\n"
" -e : emulate certain built-in functions (workaround for driver bugs)\n"
" -t : enforce experimental timing restrictions\n"
......@@ -390,7 +390,8 @@ static void PrintActiveVariables(ShHandle compiler)
const std::vector<sh::Uniform> *uniforms = ShGetUniforms(compiler);
const std::vector<sh::Varying> *varyings = ShGetVaryings(compiler);
const std::vector<sh::Attribute> *attributes = ShGetAttributes(compiler);
for (size_t varCategory = 0; varCategory < 3; ++varCategory)
const std::vector<sh::Attribute> *outputs = ShGetOutputVariables(compiler);
for (size_t varCategory = 0; varCategory < 4; ++varCategory)
{
size_t numVars = 0;
std::string varCategoryName;
......@@ -404,11 +405,17 @@ static void PrintActiveVariables(ShHandle compiler)
numVars = varyings->size();
varCategoryName = "varying";
}
else
else if (varCategory == 2)
{
numVars = attributes->size();
varCategoryName = "attribute";
}
else
{
numVars = outputs->size();
varCategoryName = "output";
}
for (size_t i = 0; i < numVars; ++i)
{
const sh::ShaderVariable *var;
......@@ -416,8 +423,11 @@ static void PrintActiveVariables(ShHandle compiler)
var = &((*uniforms)[i]);
else if (varCategory == 1)
var = &((*varyings)[i]);
else
else if (varCategory == 2)
var = &((*attributes)[i]);
else
var = &((*outputs)[i]);
PrintVariable(varCategoryName, i, *var);
}
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