radeonsi/nir: add missing piece for bindless image support
authorTimothy Arceri <tarceri@itsqueeze.com>
Tue, 22 Jan 2019 00:48:51 +0000 (11:48 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 22 Jan 2019 23:41:37 +0000 (10:41 +1100)
This fixes some piglit tests and is was TGSI does.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader_nir.c

index 037376a22efc9aaf85b716f68dc1c14ab08a070a..7554f5b9f8b6d656d6b20dc441b1d1a567830f3d 100644 (file)
@@ -939,6 +939,12 @@ si_nir_load_sampler_desc(struct ac_shader_abi *abi,
 
                /* dynamic_index is the bindless handle */
                if (image) {
+                       /* For simplicity, bindless image descriptors use fixed
+                        * 16-dword slots for now.
+                        */
+                       dynamic_index = LLVMBuildMul(ctx->ac.builder, dynamic_index,
+                                            LLVMConstInt(ctx->i32, 2, 0), "");
+
                        return si_load_image_desc(ctx, list, dynamic_index, desc_type,
                                                  dcc_off, true);
                }