agx: optimize out wait_pix in some cases
noticed in prop driver asm Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28483>
This commit is contained in:
committed by
Marge Bot
parent
c955845891
commit
781dcc8ef8
@@ -1239,7 +1239,16 @@ agx_emit_intrinsic(agx_builder *b, nir_intrinsic_instr *instr)
|
||||
assert(stage == MESA_SHADER_FRAGMENT);
|
||||
b->shader->out->writes_sample_mask = true;
|
||||
|
||||
agx_wait_pix(b, 0x0001);
|
||||
/* We need to wait_pix before running Z/S tests, but we don't need to
|
||||
* wait_pix before merely discarding. Omit the wait_pix when the affected
|
||||
* samples are unconditionally killed.
|
||||
*/
|
||||
bool no_tests =
|
||||
nir_src_is_const(instr->src[1]) && nir_src_as_uint(instr->src[1]) == 0;
|
||||
|
||||
if (!no_tests)
|
||||
agx_wait_pix(b, 0x0001);
|
||||
|
||||
return agx_sample_mask(b, agx_src_index(&instr->src[0]),
|
||||
agx_src_index(&instr->src[1]));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user