radv: set the predication boolean as 32-bit if necessary
CTS is missing tests. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7897>
This commit is contained in:

committed by
Marge Bot

parent
fadcf13c8b
commit
3494551d08
@@ -81,6 +81,7 @@
|
||||
#define PREDICATION_OP_ZPASS 0x1
|
||||
#define PREDICATION_OP_PRIMCOUNT 0x2
|
||||
#define PREDICATION_OP_BOOL64 0x3
|
||||
#define PREDICATION_OP_BOOL32 0x4
|
||||
|
||||
#define PRED_OP(x) ((x) << 16)
|
||||
|
||||
|
@@ -6527,6 +6527,7 @@ void radv_CmdBeginConditionalRenderingEXT(
|
||||
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
RADV_FROM_HANDLE(radv_buffer, buffer, pConditionalRenderingBegin->buffer);
|
||||
struct radeon_cmdbuf *cs = cmd_buffer->cs;
|
||||
unsigned pred_op = PREDICATION_OP_BOOL32;
|
||||
bool draw_visible = true;
|
||||
uint64_t va;
|
||||
|
||||
@@ -6592,14 +6593,16 @@ void radv_CmdBeginConditionalRenderingEXT(
|
||||
radeon_emit(cs, 0);
|
||||
|
||||
va = pred_va;
|
||||
pred_op = PREDICATION_OP_BOOL64;
|
||||
}
|
||||
|
||||
/* Enable predication for this command buffer. */
|
||||
si_emit_set_predication_state(cmd_buffer, draw_visible, va);
|
||||
si_emit_set_predication_state(cmd_buffer, draw_visible, pred_op, va);
|
||||
cmd_buffer->state.predicating = true;
|
||||
|
||||
/* Store conditional rendering user info. */
|
||||
cmd_buffer->state.predication_type = draw_visible;
|
||||
cmd_buffer->state.predication_op = pred_op;
|
||||
cmd_buffer->state.predication_va = va;
|
||||
}
|
||||
|
||||
@@ -6609,11 +6612,12 @@ void radv_CmdEndConditionalRenderingEXT(
|
||||
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
|
||||
/* Disable predication for this command buffer. */
|
||||
si_emit_set_predication_state(cmd_buffer, false, 0);
|
||||
si_emit_set_predication_state(cmd_buffer, false, 0, 0);
|
||||
cmd_buffer->state.predicating = false;
|
||||
|
||||
/* Reset conditional rendering user info. */
|
||||
cmd_buffer->state.predication_type = -1;
|
||||
cmd_buffer->state.predication_op = 0;
|
||||
cmd_buffer->state.predication_va = 0;
|
||||
}
|
||||
|
||||
|
@@ -572,7 +572,7 @@ radv_emit_set_predication_state_from_image(struct radv_cmd_buffer *cmd_buffer,
|
||||
va += pred_offset;
|
||||
}
|
||||
|
||||
si_emit_set_predication_state(cmd_buffer, true, va);
|
||||
si_emit_set_predication_state(cmd_buffer, true, PREDICATION_OP_BOOL64, va);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -771,6 +771,7 @@ radv_emit_color_decompress(struct radv_cmd_buffer *cmd_buffer,
|
||||
/* Restore previous conditional rendering user state. */
|
||||
si_emit_set_predication_state(cmd_buffer,
|
||||
cmd_buffer->state.predication_type,
|
||||
cmd_buffer->state.predication_op,
|
||||
cmd_buffer->state.predication_va);
|
||||
}
|
||||
}
|
||||
|
@@ -1376,6 +1376,7 @@ struct radv_cmd_state {
|
||||
bool dma_is_busy;
|
||||
|
||||
/* Conditional rendering info. */
|
||||
uint8_t predication_op; /* 32-bit or 64-bit predicate value */
|
||||
int predication_type; /* -1: disabled, 0: normal, 1: inverted */
|
||||
uint64_t predication_va;
|
||||
|
||||
@@ -1513,7 +1514,8 @@ void si_cs_emit_cache_flush(struct radeon_cmdbuf *cs,
|
||||
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,
|
||||
bool inverted, uint64_t va);
|
||||
bool draw_visible, unsigned pred_op,
|
||||
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);
|
||||
|
@@ -1532,12 +1532,15 @@ 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,
|
||||
bool draw_visible, uint64_t va)
|
||||
bool draw_visible, unsigned pred_op, uint64_t va)
|
||||
{
|
||||
uint32_t op = 0;
|
||||
|
||||
if (va) {
|
||||
op = PRED_OP(PREDICATION_OP_BOOL64);
|
||||
assert(pred_op == PREDICATION_OP_BOOL32 ||
|
||||
pred_op == PREDICATION_OP_BOOL64);
|
||||
|
||||
op = PRED_OP(pred_op);
|
||||
|
||||
/* PREDICATION_DRAW_VISIBLE means that if the 32-bit value is
|
||||
* zero, all rendering commands are discarded. Otherwise, they
|
||||
|
Reference in New Issue
Block a user