mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-15 09:58:05 +02:00
i965: vs optimization fix: Check val.{negate,abs} in accumulator_contains()
When emitting a MAC instruction in a vertex shader, brw_vs_emit()
calls accumulator_contains() to determine whether the accumulator
already contains the appropriate addend; if it does, then we can avoid
emitting an unnecessary MOV instruction.
However, accumulator_contains() wasn't checking the val.negate or
val.abs flags. As a result, if the desired value was the negation, or
the absolute value, of what was already in the accumulator, we would
generate an incorrect shader.
Fixes piglit test vs-refract-vec4-vec4-float.
Tested on Gen5 and Gen6.
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit d92463d5dc)
This commit is contained in:
parent
66b41af391
commit
2d64d34cb9
1 changed files with 3 additions and 0 deletions
|
|
@ -1821,6 +1821,9 @@ accumulator_contains(struct brw_vs_compile *c, struct brw_reg val)
|
|||
if (val.address_mode != BRW_ADDRESS_DIRECT)
|
||||
return GL_FALSE;
|
||||
|
||||
if (val.negate || val.abs)
|
||||
return GL_FALSE;
|
||||
|
||||
switch (prev_insn->header.opcode) {
|
||||
case BRW_OPCODE_MOV:
|
||||
case BRW_OPCODE_MAC:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue