Module: Mesa
Branch: master
Commit: b09b3f88341b7cd31eb8b1921d8d2b29fd0bfaa3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b09b3f88341b7cd31eb8b1921d8d2b29fd0bfaa3

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Fri Jan  5 18:00:31 2018 +0100

radv: add has_scissor_bug for Vega10 and Raven

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_cmd_buffer.c | 3 +--
 src/amd/vulkan/radv_device.c     | 4 ++++
 src/amd/vulkan/radv_private.h    | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index b0bddd16b3..665ee876a9 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -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);
        }
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 528d3539c9..4270e6a870 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -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);
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index f691c832bc..2d7d959187 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -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.

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to