mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 02:00:12 +01:00
nir/opt_uniform_atomics: optimize image atomics
fossil-db (Navi): Totals from 65 (0.05% of 135946) affected shaders: SGPRs: 3792 -> 3784 (-0.21%) VGPRs: 2784 -> 2716 (-2.44%) CodeSize: 707492 -> 713080 (+0.79%) MaxWaves: 873 -> 887 (+1.60%) Instrs: 133376 -> 134524 (+0.86%) Cycles: 3004772 -> 3011440 (+0.22%) Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6558>
This commit is contained in:
parent
bcf7a70008
commit
bc43650522
1 changed files with 12 additions and 3 deletions
|
|
@ -43,7 +43,7 @@ static nir_op
|
|||
parse_atomic_op(nir_intrinsic_op op, unsigned *offset_src, unsigned *data_src)
|
||||
{
|
||||
switch (op) {
|
||||
#define OP(intrin, alu) \
|
||||
#define OP_NOIMG(intrin, alu) \
|
||||
case nir_intrinsic_ssbo_atomic_##intrin: \
|
||||
*offset_src = 1; \
|
||||
*data_src = 2; \
|
||||
|
|
@ -56,6 +56,14 @@ parse_atomic_op(nir_intrinsic_op op, unsigned *offset_src, unsigned *data_src)
|
|||
return nir_op_##alu; \
|
||||
return nir_op_##alu; \
|
||||
return nir_op_##alu;
|
||||
#define OP(intrin, alu) \
|
||||
OP_NOIMG(intrin, alu) \
|
||||
case nir_intrinsic_image_deref_atomic_##intrin: \
|
||||
case nir_intrinsic_image_atomic_##intrin: \
|
||||
case nir_intrinsic_bindless_image_atomic_##intrin: \
|
||||
*offset_src = 1; \
|
||||
*data_src = 3; \
|
||||
return nir_op_##alu;
|
||||
OP(add, iadd)
|
||||
OP(imin, imin)
|
||||
OP(umin, umin)
|
||||
|
|
@ -65,8 +73,9 @@ parse_atomic_op(nir_intrinsic_op op, unsigned *offset_src, unsigned *data_src)
|
|||
OP(or, ior)
|
||||
OP(xor, ixor)
|
||||
OP(fadd, fadd)
|
||||
OP(fmin, fmin)
|
||||
OP(fmax, fmax)
|
||||
OP_NOIMG(fmin, fmin)
|
||||
OP_NOIMG(fmax, fmax)
|
||||
#undef OP_NOIMG
|
||||
#undef OP
|
||||
default:
|
||||
return nir_num_opcodes;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue