radv/ac: fix some fp16 handling
authorTimothy Arceri <tarceri@itsqueeze.com>
Thu, 24 Jan 2019 05:02:17 +0000 (16:02 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sun, 27 Jan 2019 23:41:48 +0000 (10:41 +1100)
Fixes: b722b29f10d4 ("radv: add support for 16bit input/output")
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/common/ac_nir_to_llvm.c
src/amd/vulkan/radv_nir_to_llvm.c

index b60ef86986486cbe0373cedeef66e8a5ad883fa2..efd3e260af1a48154fc14b963cb498bd0307cdc2 100644 (file)
@@ -3980,7 +3980,7 @@ ac_handle_shader_output_decl(struct ac_llvm_context *ctx,
                }
        }
 
-       bool is_16bit = glsl_type_is_16bit(variable->type);
+       bool is_16bit = glsl_type_is_16bit(glsl_without_array(variable->type));
        LLVMTypeRef type = is_16bit ? ctx->f16 : ctx->f32;
        for (unsigned i = 0; i < attrib_count; ++i) {
                for (unsigned chan = 0; chan < 4; chan++) {
index 7f1aa17b0d5cc3dba9ead5089f28f87849757750..91cbce42d6aa756d403c34ce99d487af58d4f313 100644 (file)
@@ -2166,7 +2166,7 @@ handle_fs_input_decl(struct radv_shader_context *ctx,
 
                interp = lookup_interp_param(&ctx->abi, variable->data.interpolation, interp_type);
        }
-       bool is_16bit = glsl_type_is_16bit(variable->type);
+       bool is_16bit = glsl_type_is_16bit(glsl_without_array(variable->type));
        LLVMTypeRef type = is_16bit ? ctx->ac.i16 : ctx->ac.i32;
        if (interp == NULL)
                interp = LLVMGetUndef(type);