From: Eric Anholt Date: Wed, 22 Jan 2020 00:56:34 +0000 (-0800) Subject: turnip: Add support for non-zero (still constant) UBO buffer indices. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3abfde13be198449230e48c5f277e0b62a0e96c4;p=mesa.git turnip: Add support for non-zero (still constant) UBO buffer indices. This was actually all ready to go at this point, and just needed to increment by the value. Fixes dEQP-VK.binding_model.shader_access.primary_cmd_buf.uniform_buffer.* Reviewed-by: Jonathan Marek Tested-by: Marge Bot Part-of: --- diff --git a/src/freedreno/vulkan/tu_shader.c b/src/freedreno/vulkan/tu_shader.c index 67374ac22cc..323a244e81a 100644 --- a/src/freedreno/vulkan/tu_shader.c +++ b/src/freedreno/vulkan/tu_shader.c @@ -243,11 +243,12 @@ lower_vulkan_resource_index(nir_builder *b, nir_intrinsic_instr *instr, switch (nir_intrinsic_desc_type(instr)) { case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: - if (!const_val || const_val->u32 != 0) - tu_finishme("non-zero vulkan_resource_index array index"); + if (!const_val) + tu_finishme("non-constant vulkan_resource_index array index"); /* skip index 0 which is used for push constants */ index = map_add(&shader->ubo_map, set, binding, 0, binding_layout->array_size) + 1; + index += const_val->u32; break; case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: