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;