Moved or removed unused variables
Some variables were either unused or only used in certain contexts,
like debug or tracing, so these were either removed (when unused)
or moved to the right scope (when used conditionally).
Also fixed a string format warning and a missing case warning.
Change-Id: I2d130faa992b5dc06fb332d7404a8aebc7c121ef
Reviewed-on: https://swiftshader-review.googlesource.com/5462
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/compiler/OutputASM.cpp b/src/OpenGL/compiler/OutputASM.cpp
index 511b91e..9c467ab 100644
--- a/src/OpenGL/compiler/OutputASM.cpp
+++ b/src/OpenGL/compiler/OutputASM.cpp
@@ -496,7 +496,6 @@
TIntermTyped *right = node->getRight();
const TType &leftType = left->getType();
const TType &rightType = right->getType();
- const TType &resultType = node->getType();
if(isSamplerRegister(result))
{
@@ -1270,8 +1269,8 @@
if(argumentCount == 2 || (textureFunction.offset && argumentCount == 3))
{
- Instruction *tex = emit(textureFunction.offset ? sw::Shader::OPCODE_TEXOFFSET : sw::Shader::OPCODE_TEX,
- result, &coord, arg[0], offset);
+ emit(textureFunction.offset ? sw::Shader::OPCODE_TEXOFFSET : sw::Shader::OPCODE_TEX,
+ result, &coord, arg[0], offset);
}
else if(argumentCount == 3 || (textureFunction.offset && argumentCount == 4)) // bias
{
@@ -1398,7 +1397,7 @@
{
for(int i = 0; i < outCols; i++)
{
- Instruction *init = emit(sw::Shader::OPCODE_MOV, result, i, &zero);
+ emit(sw::Shader::OPCODE_MOV, result, i, &zero);
Instruction *mov = emitCast(result, i, arg0, 0);
mov->dst.mask = 1 << i;
ASSERT(mov->src[0].swizzle == 0x00);
@@ -1415,7 +1414,7 @@
{
// Initialize to identity matrix
Constant col((i == 0 ? 1.0f : 0.0f), (i == 1 ? 1.0f : 0.0f), (i == 2 ? 1.0f : 0.0f), (i == 3 ? 1.0f : 0.0f));
- Instruction *mov = emitCast(result, i, &col, 0);
+ emitCast(result, i, &col, 0);
}
if(i < inCols)