Reduce temporaries used during rvalue evaluation.
This optimizes evaluation of chained indexing operations by first
looking for an lvalue 'root' node and copying from it directly into the
topmost rvalue, instead of creating potentially many temporaries.
Change-Id: I47cf9b0230bd305695e7b2a44ddc44bc1320b764
Reviewed-on: https://swiftshader-review.googlesource.com/13908
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/OpenGL/compiler/OutputASM.h b/src/OpenGL/compiler/OutputASM.h
index 118b8b4..8a0b6e5 100644
--- a/src/OpenGL/compiler/OutputASM.h
+++ b/src/OpenGL/compiler/OutputASM.h
@@ -274,6 +274,7 @@
void destination(sw::Shader::DestinationParameter ¶meter, TIntermTyped *argument, int index = 0);
void copy(TIntermTyped *dst, TIntermNode *src, int offset = 0);
void assignLvalue(TIntermTyped *dst, TIntermTyped *src);
+ void evaluateRvalue(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);