summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-08-15 15:17:38 +1000
committerEmil Velikov <[email protected]>2017-08-19 01:36:25 +0100
commit827bf790521b584b54b27be4a67a189c39ed76b0 (patch)
treedcc907804a6f54f41d1db0e7c095097e2c53fe46
parent2b10b3a4173fe9ff2a5945002dff6a5e118f2c5f (diff)
radv/gfx9: fix set predication packet.
The predication packet changed format on GFX9, update the driver. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: "17.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]> (cherry picked from commit 5247b311e9b348fedd74980a34c4b6542d85b07b)
-rw-r--r--src/amd/vulkan/si_cmd_buffer.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/amd/vulkan/si_cmd_buffer.c b/src/amd/vulkan/si_cmd_buffer.c
index 88616edfa27..913ec0e7d2a 100644
--- a/src/amd/vulkan/si_cmd_buffer.c
+++ b/src/amd/vulkan/si_cmd_buffer.c
@@ -1133,15 +1133,18 @@ 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)
{
- uint32_t val = 0;
-
- if (va)
- val = (((va >> 32) & 0xff) |
- PRED_OP(PREDICATION_OP_BOOL64)|
- PREDICATION_DRAW_VISIBLE);
- radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 1, 0));
- radeon_emit(cmd_buffer->cs, va);
- radeon_emit(cmd_buffer->cs, val);
+ uint32_t op = PRED_OP(PREDICATION_OP_BOOL64) | PREDICATION_DRAW_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);
+ radeon_emit(cmd_buffer->cs, va);
+ radeon_emit(cmd_buffer->cs, va >> 32);
+ } else {
+ radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 1, 0));
+ radeon_emit(cmd_buffer->cs, va);
+ radeon_emit(cmd_buffer->cs, op | ((va >> 32) & 0xFF));
+ }
}
/* Set this if you want the 3D engine to wait until CP DMA is done.