mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 21:50:12 +01:00
spirv: Fix SpvOpFwidth, SpvOpFwidthFine and SpvOpFwidthCoarse
"Result is the same as computing the sum of the absolute values of
OpDPdx and OpDPdy on P."
We were doing sum of absolute values of OpDPdx of P and OpDPdx of NULL.
This commit is contained in:
parent
ae3e249d57
commit
b8da261dc7
1 changed files with 3 additions and 3 deletions
|
|
@ -404,17 +404,17 @@ vtn_handle_alu(struct vtn_builder *b, SpvOp opcode,
|
|||
case SpvOpFwidth:
|
||||
val->ssa->def = nir_fadd(&b->nb,
|
||||
nir_fabs(&b->nb, nir_fddx(&b->nb, src[0])),
|
||||
nir_fabs(&b->nb, nir_fddx(&b->nb, src[1])));
|
||||
nir_fabs(&b->nb, nir_fddy(&b->nb, src[0])));
|
||||
return;
|
||||
case SpvOpFwidthFine:
|
||||
val->ssa->def = nir_fadd(&b->nb,
|
||||
nir_fabs(&b->nb, nir_fddx_fine(&b->nb, src[0])),
|
||||
nir_fabs(&b->nb, nir_fddx_fine(&b->nb, src[1])));
|
||||
nir_fabs(&b->nb, nir_fddy_fine(&b->nb, src[0])));
|
||||
return;
|
||||
case SpvOpFwidthCoarse:
|
||||
val->ssa->def = nir_fadd(&b->nb,
|
||||
nir_fabs(&b->nb, nir_fddx_coarse(&b->nb, src[0])),
|
||||
nir_fabs(&b->nb, nir_fddx_coarse(&b->nb, src[1])));
|
||||
nir_fabs(&b->nb, nir_fddy_coarse(&b->nb, src[0])));
|
||||
return;
|
||||
|
||||
case SpvOpVectorTimesScalar:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue