diff options
author | Eric Anholt <[email protected]> | 2009-11-06 13:04:54 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2009-11-06 13:16:49 -0800 |
commit | f3cacfe216fb58b913bbc23de49d696a33da69e1 (patch) | |
tree | 443479587758bef89bece7a2df848f39201770a5 /src/mesa/shader | |
parent | e4e312d493847e07ced026b93d2b588b8036ae02 (diff) |
mesa: Fix remove_instructions to successfully remove when removeFlags[0].
This fixes the dead code elimination to work on the particular code
mentioned in the previous commit.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/prog_optimize.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 5aff16be46d..b4658cb37f9 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -73,6 +73,12 @@ remove_instructions(struct gl_program *prog, const GLboolean *removeFlags) } } } + /* Finish removing if the first instruction was to be removed. */ + if (removeCount > 0) { + GLint removeStart = removeEnd - removeCount + 1; + _mesa_delete_instructions(prog, removeStart, removeCount); + removeStart = removeCount = 0; /* reset removal info */ + } return totalRemoved; } |