amd/common: remove has_ds_bpermute argument from ac_build_ddxy
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 13 Sep 2017 12:38:17 +0000 (14:38 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 18 Sep 2017 09:25:18 +0000 (11:25 +0200)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_llvm_build.c
src/amd/common/ac_llvm_build.h
src/amd/common/ac_nir_to_llvm.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_shader.c

index 4077bd81bbc042acedbc7098c36b0f1e5f9e45d4..6c010e8c3a68a758d69829a22eae072f3c35daf7 100644 (file)
@@ -972,7 +972,6 @@ ac_get_thread_id(struct ac_llvm_context *ctx)
  */
 LLVMValueRef
 ac_build_ddxy(struct ac_llvm_context *ctx,
-             bool has_ds_bpermute,
              uint32_t mask,
              int idx,
              LLVMValueRef val)
@@ -980,7 +979,7 @@ ac_build_ddxy(struct ac_llvm_context *ctx,
        LLVMValueRef tl, trbl, args[2];
        LLVMValueRef result;
 
-       if (has_ds_bpermute) {
+       if (ctx->chip_class >= VI) {
                LLVMValueRef thread_id, tl_tid, trbl_tid;
                thread_id = ac_get_thread_id(ctx);
 
index b6434893cfa0e7b7c902f835c982188a809affc0..3f93551330c464b2b9fad77c1c9a29039ff73097 100644 (file)
@@ -194,7 +194,6 @@ ac_get_thread_id(struct ac_llvm_context *ctx);
 
 LLVMValueRef
 ac_build_ddxy(struct ac_llvm_context *ctx,
-             bool has_ds_bpermute,
              uint32_t mask,
              int idx,
              LLVMValueRef val);
index 870620e78706acb8a08e32cf824ba8e489e09183..217d1e67ae29237904dab1dcfc03731d515b9676 100644 (file)
@@ -1414,7 +1414,6 @@ static LLVMValueRef emit_ddxy(struct ac_nir_context *ctx,
        unsigned mask;
        int idx;
        LLVMValueRef result;
-       bool has_ds_bpermute = ctx->abi->chip_class >= VI;
 
        if (op == nir_op_fddx_fine || op == nir_op_fddx)
                mask = AC_TID_MASK_LEFT;
@@ -1431,9 +1430,7 @@ static LLVMValueRef emit_ddxy(struct ac_nir_context *ctx,
        else
                idx = 2;
 
-       result = ac_build_ddxy(&ctx->ac, has_ds_bpermute,
-                             mask, idx,
-                             src0);
+       result = ac_build_ddxy(&ctx->ac, mask, idx, src0);
        return result;
 }
 
index c47e655804911ca043a9ec830f5e98a0ee8cb717..1989574511ea2c501efa81f537c9d061339316cf 100644 (file)
@@ -1045,7 +1045,6 @@ struct pipe_screen *radeonsi_screen_create(struct radeon_winsys *ws,
                 sscreen->b.info.pfp_fw_version >= 79 &&
                 sscreen->b.info.me_fw_version >= 142);
 
-       sscreen->has_ds_bpermute = sscreen->b.chip_class >= VI;
        sscreen->has_msaa_sample_loc_bug = (sscreen->b.family >= CHIP_POLARIS10 &&
                                            sscreen->b.family <= CHIP_POLARIS12) ||
                                           sscreen->b.family == CHIP_VEGA10 ||
index 8db7028c9a109bb89acfb02243ce2338ccc9a01a..10215a35886f37f98de5834d7f363467050f3bd5 100644 (file)
@@ -94,7 +94,6 @@ struct si_screen {
        bool                            has_clear_state;
        bool                            has_distributed_tess;
        bool                            has_draw_indirect_multi;
-       bool                            has_ds_bpermute;
        bool                            has_msaa_sample_loc_bug;
        bool                            dpbb_allowed;
        bool                            dfsm_allowed;
index c4e7f225a8f98efba1b1b1f5edf51b2be317edc0..aea199d3efde1ad17ffac585454aa17dd86ecb61 100644 (file)
@@ -3653,8 +3653,7 @@ static void si_llvm_emit_ddxy(
        idx = (opcode == TGSI_OPCODE_DDX || opcode == TGSI_OPCODE_DDX_FINE) ? 1 : 2;
 
        val = LLVMBuildBitCast(gallivm->builder, emit_data->args[0], ctx->i32, "");
-       val = ac_build_ddxy(&ctx->ac, ctx->screen->has_ds_bpermute,
-                           mask, idx, val);
+       val = ac_build_ddxy(&ctx->ac, mask, idx, val);
        emit_data->output[emit_data->chan] = val;
 }