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>
This commit is contained in:
Samuel Pitoiset 2024-03-19 12:47:31 +01:00 committed by Marge Bot
parent d87ccf0632
commit be4a6b946a
3 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;