mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
glsl: fix potential slow compile times for GLSLOptimizeConservatively
See code comment for full description of the change. Fixes:0a5018c1a4("mesa: add gl_constants::GLSLOptimizeConservatively") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3034 Tested-by: Witold Baryluk <witold.baryluk@gmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5346> (cherry picked from commite43ab7bb05)
This commit is contained in:
parent
3f0a6cad4d
commit
0f8fad7f3c
2 changed files with 15 additions and 2 deletions
|
|
@ -454,7 +454,7 @@
|
|||
"description": "glsl: fix potential slow compile times for GLSLOptimizeConservatively",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "0a5018c1a483abe6c4dddc6c65a7f4e939efc726"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2345,7 +2345,20 @@ do_common_optimization(exec_list *ir, bool linked,
|
|||
OPT(lower_vector_insert, ir, false);
|
||||
OPT(optimize_swizzles, ir);
|
||||
|
||||
OPT(optimize_split_arrays, ir, linked);
|
||||
/* Some drivers only call do_common_optimization() once rather than in a
|
||||
* loop, and split arrays causes each element of a constant array to
|
||||
* dereference is own copy of the entire array initilizer. This IR is not
|
||||
* something that can be generated manually in a shader and is not
|
||||
* accounted for by NIR optimisations, the result is an exponential slow
|
||||
* down in compilation speed as a constant arrays element count grows. To
|
||||
* avoid that here we make sure to always clean up the mess split arrays
|
||||
* causes to constant arrays.
|
||||
*/
|
||||
bool array_split = optimize_split_arrays(ir, linked);
|
||||
if (array_split)
|
||||
do_constant_propagation(ir);
|
||||
progress |= array_split;
|
||||
|
||||
OPT(optimize_redundant_jumps, ir);
|
||||
|
||||
if (options->MaxUnrollIterations) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue