ac: image size builtin for GLSL_SAMPLER_DIM_3D
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 18 Jan 2018 07:15:28 +0000 (18:15 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 23 Jan 2018 07:05:13 +0000 (18:05 +1100)
This is what radeonsi does. Fixes remaing piglit subtest in:

./bin/arb_shader_image_size-builtin --quick -auto -fbo

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

index 214fb148a11db1ad5139cc8c78c5c06c32a3eb7c..8ec361cf8db5c83a55cae44a16a3807d2aaff1e8 100644 (file)
@@ -3814,7 +3814,8 @@ static LLVMValueRef visit_image_size(struct ac_nir_context *ctx,
        const nir_variable *var = instr->variables[0]->var;
        const struct glsl_type *type = instr->variables[0]->var->type;
        bool da = glsl_sampler_type_is_array(var->type) ||
-                 glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_CUBE;
+                 glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_CUBE ||
+                 glsl_get_sampler_dim(var->type) == GLSL_SAMPLER_DIM_3D;
        if(instr->variables[0]->deref.child)
                type = instr->variables[0]->deref.child->type;