From 3abfde13be198449230e48c5f277e0b62a0e96c4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 21 Jan 2020 16:56:34 -0800 Subject: [PATCH] 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: --- src/freedreno/vulkan/tu_shader.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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: -- 2.30.2