zink: simplify index type access to normal array
the sizes are 1/2/4, so just use that array index Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37318>
This commit is contained in:
committed by
Marge Bot
parent
c852c25cdc
commit
74b7b5b661
@@ -507,13 +507,15 @@ zink_draw(struct pipe_context *pctx,
|
||||
}
|
||||
|
||||
if (index_buffer) {
|
||||
const VkIndexType index_type[3] = {
|
||||
const VkIndexType index_type[] = {
|
||||
VK_INDEX_TYPE_UINT32,
|
||||
VK_INDEX_TYPE_UINT8_EXT,
|
||||
VK_INDEX_TYPE_UINT16,
|
||||
VK_INDEX_TYPE_UINT32,
|
||||
VK_INDEX_TYPE_UINT32,
|
||||
};
|
||||
struct zink_resource *res = zink_resource(index_buffer);
|
||||
VKCTX(CmdBindIndexBuffer)(bs->cmdbuf, res->obj->buffer, index_offset, index_type[index_size >> 1]);
|
||||
VKCTX(CmdBindIndexBuffer)(bs->cmdbuf, res->obj->buffer, index_offset, index_type[index_size]);
|
||||
}
|
||||
if (DYNAMIC_STATE < ZINK_DYNAMIC_STATE2) {
|
||||
if (ctx->gfx_pipeline_state.dyn_state2.primitive_restart != dinfo->primitive_restart)
|
||||
|
||||
Reference in New Issue
Block a user