ac: fix image load store for GLSL_SAMPLER_DIM_3D
authorTimothy Arceri <tarceri@itsqueeze.com>
Sat, 20 Jan 2018 03:04:55 +0000 (14:04 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 23 Jan 2018 07:05:13 +0000 (18:05 +1100)
Fixes the following piglit tests:

arb_shader_image_load_store/layer/image3d/layered binding test
arb_shader_image_load_store/max-size/image3d max size test/2048x8x8x1
arb_shader_image_load_store/max-size/image3d max size test/8x2048x8x1
arb_shader_image_load_store/max-size/image3d max size test/8x8x2048x1
arb_shader_image_load_store/semantics/imageload/vertex shader/rgba32f/image3d test

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/amd/common/ac_nir_to_llvm.c

index 8ec361cf8db5c83a55cae44a16a3807d2aaff1e8..9ba324a5132cc1e2bde39b0d06743be73635a4ee 100644 (file)
@@ -3635,6 +3635,7 @@ static LLVMValueRef visit_image_load(struct ac_nir_context *ctx,
        } else {
                bool is_da = glsl_sampler_type_is_array(type) ||
                             glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE ||
+                            glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_3D ||
                             glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_SUBPASS ||
                             glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_SUBPASS_MS;
                LLVMValueRef da = is_da ? ctx->ac.i1true : ctx->ac.i1false;
@@ -3693,7 +3694,8 @@ static void visit_image_store(struct ac_nir_context *ctx,
                                   params, 6, 0);
        } else {
                bool is_da = glsl_sampler_type_is_array(type) ||
-                            glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE;
+                            glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE ||
+                            glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_3D;
                LLVMValueRef da = is_da ? ctx->ac.i1true : ctx->ac.i1false;
                LLVMValueRef slc = ctx->ac.i1false;