radv: fix getting the index type size for uint8_t
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Aug 2019 07:23:21 +0000 (09:23 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 26 Aug 2019 07:23:23 +0000 (09:23 +0200)
16-bit and 32-bit values match hardware values but 8-bit doesn't.

This fixes dEQP-VK.pipeline.input_assembly.* with 8-bit index.

Fixes: 372c3dcfdb8 ("radv: implement VK_EXT_index_type_uint8")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl
src/amd/vulkan/radv_cmd_buffer.c

index 187e8c5c2520c9e3603fcab976d2ff56000f3f26..952f5e7d54c19354c7b79d97254f3e6a220b2e99 100644 (file)
@@ -3321,7 +3321,7 @@ void radv_CmdBindIndexBuffer(
        cmd_buffer->state.index_va = radv_buffer_get_va(index_buffer->bo);
        cmd_buffer->state.index_va += index_buffer->offset + offset;
 
-       int index_size = radv_get_vgt_index_size(indexType);
+       int index_size = radv_get_vgt_index_size(vk_to_index_type(indexType));
        cmd_buffer->state.max_index_count = (index_buffer->size - offset) / index_size;
        cmd_buffer->state.dirty |= RADV_CMD_DIRTY_INDEX_BUFFER;
        radv_cs_add_buffer(cmd_buffer->device->ws, cmd_buffer->cs, index_buffer->bo);