radeonsi: fix a crash in imageSize for cubemap arrays
authorMarek Olšák <marek.olsak@amd.com>
Sat, 20 Aug 2016 23:32:22 +0000 (01:32 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 5 Sep 2016 16:01:15 +0000 (18:01 +0200)
Sometimes it was f32, other times it was i32. Now it's always i32.

This fixes:
GL45-CTS.texture_cube_map_array.image_texture_size.texture_size_compute_sh

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 42fed7dc0293e6e1e8dc895ec426af945042cb81..1ef3b7062e6777d0da107df42189f45e13e38304 100644 (file)
@@ -4105,7 +4105,7 @@ static void resq_fetch_args(
        const struct tgsi_full_instruction *inst = emit_data->inst;
        const struct tgsi_full_src_register *reg = &inst->Src[0];
 
-       emit_data->dst_type = LLVMVectorType(bld_base->base.elem_type, 4);
+       emit_data->dst_type = ctx->v4i32;
 
        if (reg->Register.File == TGSI_FILE_BUFFER) {
                emit_data->args[0] = shader_buffer_fetch_rsrc(ctx, reg);
@@ -4156,9 +4156,7 @@ static void resq_emit(
                        LLVMValueRef imm6 = lp_build_const_int32(gallivm, 6);
 
                        LLVMValueRef z = LLVMBuildExtractElement(builder, out, imm2, "");
-                       z = LLVMBuildBitCast(builder, z, bld_base->uint_bld.elem_type, "");
                        z = LLVMBuildSDiv(builder, z, imm6, "");
-                       z = LLVMBuildBitCast(builder, z, bld_base->base.elem_type, "");
                        out = LLVMBuildInsertElement(builder, out, z, imm2, "");
                }
        }