mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 05:50:11 +01:00
Don't process empty shaders
Some valid shaders, such as 'precision highp float;', evaluate to empty sets of instructions. This causes some of the optimization stages to enter infinite loops. Instead, don't bother processing the empty ones.
This commit is contained in:
parent
6cd2a5cc4b
commit
15d162d7b1
1 changed files with 3 additions and 2 deletions
|
|
@ -737,7 +737,8 @@ main(int argc, char **argv)
|
|||
ast->print();
|
||||
}
|
||||
|
||||
_mesa_ast_to_hir(&instructions, &state);
|
||||
if (!state.translation_unit.is_empty())
|
||||
_mesa_ast_to_hir(&instructions, &state);
|
||||
} else {
|
||||
/* FINISHME: We should initialize this to the max GLSL version supported
|
||||
* FINISHME: by the driver. At the moment, we don't know what that is.
|
||||
|
|
@ -748,7 +749,7 @@ main(int argc, char **argv)
|
|||
}
|
||||
|
||||
/* Optimization passes */
|
||||
if (!state.error) {
|
||||
if (!state.error && !instructions.is_empty()) {
|
||||
bool progress;
|
||||
do {
|
||||
progress = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue