OSDN Git Service

glsl: Make opt_constant_variable() bail in useless cases.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 29 Apr 2016 19:53:03 +0000 (12:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 16 May 2016 06:59:05 +0000 (23:59 -0700)
commit8e59670bcf925714896fb275a364e97a5137f0f7
treef4537d852a847037d7210da5a1e7c6d5929fb36f
parentc907ca6c8d256f4b8c271bcf0901661ef943ae08
glsl: Make opt_constant_variable() bail in useless cases.

The pass ultimately skips over any entries with assignment_count != 1,
so there's no need to do further work once we've determined that there
are multiple assignments.

The constant value could be a large array (i.e. uvec4[327]), at which
point skipping the constant_expression_value() call (and the clone()
call within) can save us piles of memory.

No change in shader-db.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/glsl/opt_constant_variable.cpp