mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
glsl: do const parameter optimization for array element actual parameters
When a function parameter is const-qualified we can avoid making a copy of the actual parameter (we basically do a search/replace when inlining). This is now done for array element params too, resulting in better code (fewer MOV instructions). We should allow some other types of function arguments here but let's be conservative for the moment.
This commit is contained in:
parent
abdb0fdcc0
commit
c86b076668
1 changed files with 3 additions and 2 deletions
|
|
@ -1417,8 +1417,9 @@ slang_inline_function_call(slang_assemble_ctx * A, slang_function *fun,
|
|||
}
|
||||
else if (p->type.qualifier == SLANG_QUAL_CONST) {
|
||||
/* a constant input param */
|
||||
if (args[i].type == SLANG_OPER_IDENTIFIER ||
|
||||
args[i].type == SLANG_OPER_LITERAL_FLOAT) {
|
||||
if (args[i].type == SLANG_OPER_IDENTIFIER ||
|
||||
args[i].type == SLANG_OPER_LITERAL_FLOAT ||
|
||||
args[i].type == SLANG_OPER_SUBSCRIPT) {
|
||||
/* replace all occurances of this parameter variable with the
|
||||
* actual argument variable or a literal.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue