ac/radeonsi: add load_local_group_size() to the abi
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 2 Feb 2018 02:14:41 +0000 (13:14 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 6 Feb 2018 21:43:08 +0000 (08:43 +1100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_nir_to_llvm.c
src/amd/common/ac_shader_abi.h
src/gallium/drivers/radeonsi/si_shader.c

index ae569d4c7fcba289026671dcabc3a139a817b8ed..9dcbe253803917d92dc6d2fd3b6a85847e32a15f 100644 (file)
@@ -4308,6 +4308,9 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
                result = ctx->abi->base_vertex;
                break;
        }
+       case nir_intrinsic_load_local_group_size:
+               result = ctx->abi->load_local_group_size(ctx->abi);
+               break;
        case nir_intrinsic_load_vertex_id_zero_base: {
                result = ctx->abi->vertex_id;
                break;
index 9a35ff925b4630ceae9a83b6d7817cb14348ad07..55842ea342d38379b7f01245b0dafe478fe3e3ab 100644 (file)
@@ -157,6 +157,8 @@ struct ac_shader_abi {
        LLVMValueRef (*load_sample_position)(struct ac_shader_abi *abi,
                                             LLVMValueRef sample_id);
 
+       LLVMValueRef (*load_local_group_size)(struct ac_shader_abi *abi);
+
        /* Whether to clamp the shadow reference value to [0,1]on VI. Radeonsi currently
         * uses it due to promoting D16 to D32, but radv needs it off. */
        bool clamp_shadow_reference;
index 808d55b8ce37885ea2dabca80604afa061d809bb..bb8cf8f7795241003375caab1a2a1e4384c4a00f 100644 (file)
@@ -5985,6 +5985,7 @@ static bool si_compile_tgsi_main(struct si_shader_context *ctx,
                ctx->abi.load_sample_position = load_sample_position;
                break;
        case PIPE_SHADER_COMPUTE:
+               ctx->abi.load_local_group_size = get_block_size;
                break;
        default:
                assert(!"Unsupported shader type");