diff options
author | Samuel Pitoiset <samuel.pitoiset@gmail.com> | 2024-03-19 12:47:31 +0100 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2024-03-20 16:27:58 +0000 |
commit | be4a6b946a1b6ce9805f839d71bc2ff28b0b4918 (patch) | |
tree | 52b4ad58bf7780e08e677082afcbd3b678980a67 | |
parent | d87ccf06320aae922b5d47addbfe6e779c2a1361 (diff) |
radv: add a workaround for null IBO on GFX6
Based on PAL.
Fixes dEQP-VK.draw.*nulldescriptor_maintenance_5_maintenance6 on GFX6.
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28263>
-rw-r--r-- | src/amd/common/ac_gpu_info.c | 5 | ||||
-rw-r--r-- | src/amd/common/ac_gpu_info.h | 1 | ||||
-rw-r--r-- | src/amd/vulkan/radv_cmd_buffer.c | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index bc86a3ccb41..786ba57df06 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -1224,6 +1224,11 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, */ info->has_pops_missed_overlap_bug = info->family == CHIP_VEGA10 || info->family == CHIP_RAVEN; + /* GFX6 hw bug when the IBO addr is 0 which causes invalid clamping (underflow). + * Setting the IB addr to 2 or higher solves this issue. + */ + info->has_null_index_buffer_clamping_bug = info->gfx_level == GFX6; + /* Drawing from 0-sized index buffers causes hangs on gfx10. */ info->has_zero_index_buffer_bug = info->gfx_level == GFX10; diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index 3cad7db5e4d..49533f8e17a 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -96,6 +96,7 @@ struct radeon_info { bool has_small_prim_filter_sample_loc_bug; bool has_ls_vgpr_init_bug; bool has_pops_missed_overlap_bug; + bool has_null_index_buffer_clamping_bug; bool has_zero_index_buffer_bug; bool has_image_load_dcc_bug; bool has_two_planes_iterate256_bug; diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index 6ac49dbb9ab..5c5aa39b98a 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -6017,6 +6017,9 @@ radv_CmdBindIndexBuffer2KHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDe } else { cmd_buffer->state.index_va = 0; cmd_buffer->state.max_index_count = 0; + + if (cmd_buffer->device->physical_device->rad_info.has_null_index_buffer_clamping_bug) + cmd_buffer->state.index_va = 0x2; } cmd_buffer->state.dirty |= RADV_CMD_DIRTY_INDEX_BUFFER; |