Commit 6986b28f by Nicolas Capens Committed by Nicolas Capens

Reduce lifetime of address temporary.

After traversing the lvalue node tree we're fully done computing the relative address and emitting any pointer arithmetic that might have been needed. So the temporary that would have been used for that is no longer needed. Change-Id: I0a10bff979128f03544d0f8aa860c29f8867973a Reviewed-on: https://swiftshader-review.googlesource.com/13948Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent 0530b456
......@@ -2327,8 +2327,7 @@ namespace glsl
{
Instruction *insert = new Instruction(sw::Shader::OPCODE_INSERT);
Temporary address(this);
lvalue(insert->dst, address, dst);
lvalue(insert->dst, dst);
insert->src[0].type = insert->dst.type;
insert->src[0].index = insert->dst.index;
......@@ -2342,8 +2341,7 @@ namespace glsl
{
Instruction *mov1 = new Instruction(sw::Shader::OPCODE_MOV);
Temporary address(this);
int swizzle = lvalue(mov1->dst, address, dst);
int swizzle = lvalue(mov1->dst, dst);
source(mov1->src[0], src);
mov1->src[0].swizzle = swizzleSwizzle(mov1->src[0].swizzle, swizzle);
......@@ -2365,8 +2363,9 @@ namespace glsl
}
}
int OutputASM::lvalue(sw::Shader::DestinationParameter &dst, Temporary &address, TIntermTyped *node)
int OutputASM::lvalue(sw::Shader::DestinationParameter &dst, TIntermTyped *node)
{
Temporary address(this);
TIntermTyped *root = nullptr;
unsigned int offset = 0;
unsigned char mask = 0xF;
......
......@@ -274,7 +274,7 @@ namespace glsl
void destination(sw::Shader::DestinationParameter &parameter, TIntermTyped *argument, int index = 0);
void copy(TIntermTyped *dst, TIntermNode *src, int offset = 0);
void assignLvalue(TIntermTyped *dst, TIntermTyped *src);
int lvalue(sw::Shader::DestinationParameter &dst, Temporary &address, TIntermTyped *node);
int lvalue(sw::Shader::DestinationParameter &dst, TIntermTyped *node);
int lvalue(TIntermTyped *&root, unsigned int &offset, sw::Shader::Relative &rel, unsigned char &mask, Temporary &address, TIntermTyped *node);
sw::Shader::ParameterType registerType(TIntermTyped *operand);
bool hasFlatQualifier(TIntermTyped *operand);
......
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