diff options
author | Nicolai Hähnle <[email protected]> | 2017-06-25 19:36:06 +0200 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2017-07-31 14:55:43 +0200 |
commit | 7de445377c261e20412cb4f34b8d309b62f78fac (patch) | |
tree | 9b5d43d8996b2a1c9cd37a64f92d52893502a93e /src/amd/common | |
parent | 25ff22e390d645a7df8e641d0b17cf6fbf551976 (diff) |
ac/nir,radv: move force_persample to ac_shader_info::force_persample
Avoid accessing radv-specific structures during the meat of NIR-to-LLVM
translation.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 4 | ||||
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.h | 1 | ||||
-rw-r--r-- | src/amd/common/ac_shader_info.c | 6 | ||||
-rw-r--r-- | src/amd/common/ac_shader_info.h | 1 |
4 files changed, 8 insertions, 4 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 8b76cd9cbe6..a60a900073c 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -4003,11 +4003,9 @@ static void visit_intrinsic(struct ac_nir_context *ctx, fprintf(stderr, "Unknown primitive id intrinsic: %d", ctx->stage); break; case nir_intrinsic_load_sample_id: - ctx->nctx->shader_info->fs.force_persample = true; result = unpack_param(ctx->nctx, ctx->nctx->ancillary, 8, 4); break; case nir_intrinsic_load_sample_pos: - ctx->nctx->shader_info->fs.force_persample = true; result = load_sample_pos(ctx->nctx); break; case nir_intrinsic_load_sample_mask_in: @@ -4960,7 +4958,7 @@ handle_fs_input_decl(struct nir_to_llvm_context *ctx, unsigned interp_type; if (variable->data.sample) { interp_type = INTERP_SAMPLE; - ctx->shader_info->fs.force_persample = true; + ctx->shader_info->info.ps.force_persample = true; } else if (variable->data.centroid) interp_type = INTERP_CENTROID; else diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h index 0cb48a86469..7def4b72f9f 100644 --- a/src/amd/common/ac_nir_to_llvm.h +++ b/src/amd/common/ac_nir_to_llvm.h @@ -169,7 +169,6 @@ struct ac_shader_variant_info { bool writes_sample_mask; bool early_fragment_test; bool writes_memory; - bool force_persample; bool prim_id_input; bool layer_input; } fs; diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c index 7d34535c107..8668c4c3446 100644 --- a/src/amd/common/ac_shader_info.c +++ b/src/amd/common/ac_shader_info.c @@ -45,6 +45,12 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, struct ac_shader_info *info) case nir_intrinsic_load_num_work_groups: info->cs.grid_components_used = instr->num_components; break; + case nir_intrinsic_load_sample_id: + info->ps.force_persample = true; + break; + case nir_intrinsic_load_sample_pos: + info->ps.force_persample = true; + break; case nir_intrinsic_vulkan_resource_index: info->desc_set_used_mask |= (1 << nir_intrinsic_desc_set(instr)); break; diff --git a/src/amd/common/ac_shader_info.h b/src/amd/common/ac_shader_info.h index 5bc16cc9d02..965ad542a2a 100644 --- a/src/amd/common/ac_shader_info.h +++ b/src/amd/common/ac_shader_info.h @@ -36,6 +36,7 @@ struct ac_shader_info { bool needs_instance_id; } vs; struct { + bool force_persample; bool needs_sample_positions; } ps; struct { |