radv: add has_scissor_bug for Vega10 and Raven
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 5 Jan 2018 17:00:31 +0000 (18:00 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 8 Jan 2018 20:24:56 +0000 (21:24 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_private.h

index b0bddd16b39208de03d2a30a8b3fbda9d1e39404..665ee876a9d91c9e2e08458d7c9b1c6bb558fecf 100644 (file)
@@ -1122,8 +1122,7 @@ radv_emit_scissor(struct radv_cmd_buffer *cmd_buffer)
         * scissor registers are changed. There is also a more efficient but
         * more involved alternative workaround.
         */
-       if (cmd_buffer->device->physical_device->rad_info.family == CHIP_VEGA10 ||
-           cmd_buffer->device->physical_device->rad_info.family == CHIP_RAVEN) {
+       if (cmd_buffer->device->physical_device->has_scissor_bug) {
                cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_PS_PARTIAL_FLUSH;
                si_emit_cache_flush(cmd_buffer);
        }
index 528d3539c91136532f2fd6e1dd60973b69f40295..4270e6a870b8780a5d3cce2d7e908e59df3c3d46 100644 (file)
@@ -265,6 +265,10 @@ radv_physical_device_init(struct radv_physical_device *device,
 
        device->cpdma_prefetch_writes_memory = device->rad_info.chip_class <= VI;
 
+       /* Vega10/Raven need a special workaround for a hardware bug. */
+       device->has_scissor_bug = device->rad_info.family == CHIP_VEGA10 ||
+                                 device->rad_info.family == CHIP_RAVEN;
+
        radv_physical_device_init_mem_types(device);
 
        result = radv_init_wsi(device);
index f691c832bc25b357785c67b4f1d0b7ee8c97e8e4..2d7d9591872309d12bc3b84d065cf27970011b63 100644 (file)
@@ -273,6 +273,7 @@ struct radv_physical_device {
        bool rbplus_allowed; /* if RB+ is allowed */
        bool has_clear_state;
        bool cpdma_prefetch_writes_memory;
+       bool has_scissor_bug;
 
        /* This is the drivers on-disk cache used as a fallback as opposed to
         * the pipeline cache defined by apps.