zink: add shader image support to zink_binding()

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8504>
This commit is contained in:
Mike Blumenkrantz 2020-11-17 18:30:45 -05:00 committed by Marge Bot
parent 934625d53d
commit a9f2637267
1 changed files with 7 additions and 1 deletions

View File

@ -586,7 +586,8 @@ zink_binding(gl_shader_stage stage, VkDescriptorType type, int index)
} else {
uint32_t stage_offset = (uint32_t)stage * (PIPE_MAX_CONSTANT_BUFFERS +
PIPE_MAX_SAMPLERS +
PIPE_MAX_SHADER_BUFFERS);
PIPE_MAX_SHADER_BUFFERS +
PIPE_MAX_SHADER_IMAGES);
switch (type) {
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
@ -602,6 +603,11 @@ zink_binding(gl_shader_stage stage, VkDescriptorType type, int index)
assert(index < PIPE_MAX_SHADER_BUFFERS);
return stage_offset + PIPE_MAX_CONSTANT_BUFFERS + PIPE_MAX_SHADER_SAMPLER_VIEWS + index;
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
assert(index < PIPE_MAX_SHADER_IMAGES);
return stage_offset + PIPE_MAX_CONSTANT_BUFFERS + PIPE_MAX_SHADER_SAMPLER_VIEWS + PIPE_MAX_SHADER_IMAGES + index;
default:
unreachable("unexpected type");
}