mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
radv: add support for non-inverted conditional rendering
By default, our internal rendering commands are discarded only if the predicate is non-zero (ie. DRAW_VISIBLE). But VK_EXT_conditional_rendering also allows to discard commands when the predicate is zero, which means we have to use a different flag. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
parent
4d99caf590
commit
946cf3f39f
3 changed files with 17 additions and 5 deletions
|
|
@ -571,7 +571,7 @@ radv_emit_set_predication_state_from_image(struct radv_cmd_buffer *cmd_buffer,
|
|||
va += image->dcc_pred_offset;
|
||||
}
|
||||
|
||||
si_emit_set_predication_state(cmd_buffer, va);
|
||||
si_emit_set_predication_state(cmd_buffer, true, va);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1088,7 +1088,8 @@ void si_cs_emit_cache_flush(struct radeon_cmdbuf *cs,
|
|||
enum radv_cmd_flush_bits flush_bits,
|
||||
uint64_t gfx9_eop_bug_va);
|
||||
void si_emit_cache_flush(struct radv_cmd_buffer *cmd_buffer);
|
||||
void si_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer, uint64_t va);
|
||||
void si_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer,
|
||||
bool inverted, uint64_t va);
|
||||
void si_cp_dma_buffer_copy(struct radv_cmd_buffer *cmd_buffer,
|
||||
uint64_t src_va, uint64_t dest_va,
|
||||
uint64_t size);
|
||||
|
|
|
|||
|
|
@ -1002,12 +1002,23 @@ si_emit_cache_flush(struct radv_cmd_buffer *cmd_buffer)
|
|||
|
||||
/* sets the CP predication state using a boolean stored at va */
|
||||
void
|
||||
si_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer, uint64_t va)
|
||||
si_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer,
|
||||
bool inverted, uint64_t va)
|
||||
{
|
||||
uint32_t op = 0;
|
||||
|
||||
if (va)
|
||||
op = PRED_OP(PREDICATION_OP_BOOL64) | PREDICATION_DRAW_VISIBLE;
|
||||
if (va) {
|
||||
op = PRED_OP(PREDICATION_OP_BOOL64);
|
||||
|
||||
/* By default, our internal rendering commands are discarded
|
||||
* only if the predicate is non-zero (ie. DRAW_VISIBLE). But
|
||||
* VK_EXT_conditional_rendering also allows to discard commands
|
||||
* when the predicate is zero, which means we have to use a
|
||||
* different flag.
|
||||
*/
|
||||
op |= inverted ? PREDICATION_DRAW_VISIBLE :
|
||||
PREDICATION_DRAW_NOT_VISIBLE;
|
||||
}
|
||||
if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) {
|
||||
radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 2, 0));
|
||||
radeon_emit(cmd_buffer->cs, op);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue