diff options
author | Samuel Pitoiset <[email protected]> | 2018-02-26 12:14:35 +0100 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-02-28 10:14:26 +0100 |
commit | 639c4f2b54a6edbedfc3f75fd05d1588752b0693 (patch) | |
tree | 65657c3cfa361f5aadb8ba883fdd8b35069d11e7 /src/amd/common | |
parent | e207b2e2c8dea99972e744c8fdfa0b9a9481ea5e (diff) |
ac/shader: move scanning some info about input PS declarations
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.c | 6 | ||||
-rw-r--r-- | src/amd/common/ac_nir_to_llvm.h | 3 | ||||
-rw-r--r-- | src/amd/common/ac_shader_info.c | 15 | ||||
-rw-r--r-- | src/amd/common/ac_shader_info.h | 3 |
4 files changed, 18 insertions, 9 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 8b662f884f8..88e0cf9b4b8 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -5638,12 +5638,6 @@ handle_fs_inputs(struct radv_shader_context *ctx, } } ctx->shader_info->fs.num_interp = index; - if (ctx->input_mask & (1 << VARYING_SLOT_PNTC)) - ctx->shader_info->fs.has_pcoord = true; - if (ctx->input_mask & (1 << VARYING_SLOT_PRIMITIVE_ID)) - ctx->shader_info->fs.prim_id_input = true; - if (ctx->input_mask & (1 << VARYING_SLOT_LAYER)) - ctx->shader_info->fs.layer_input = true; ctx->shader_info->fs.input_mask = ctx->input_mask >> VARYING_SLOT_VAR0; if (ctx->shader_info->info.needs_multiview_view_index) diff --git a/src/amd/common/ac_nir_to_llvm.h b/src/amd/common/ac_nir_to_llvm.h index 07cf9656f59..766acec6ed3 100644 --- a/src/amd/common/ac_nir_to_llvm.h +++ b/src/amd/common/ac_nir_to_llvm.h @@ -177,11 +177,8 @@ struct ac_shader_variant_info { unsigned num_interp; uint32_t input_mask; uint32_t flat_shaded_mask; - bool has_pcoord; bool can_discard; bool early_fragment_test; - bool prim_id_input; - bool layer_input; } fs; struct { unsigned block_size[3]; diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c index d76fecd2445..57d7edec764 100644 --- a/src/amd/common/ac_shader_info.c +++ b/src/amd/common/ac_shader_info.c @@ -194,6 +194,21 @@ gather_info_input_decl_ps(const nir_shader *nir, const nir_variable *var, struct ac_shader_info *info) { const struct glsl_type *type = glsl_without_array(var->type); + int idx = var->data.location; + + switch (idx) { + case VARYING_SLOT_PNTC: + info->ps.has_pcoord = true; + break; + case VARYING_SLOT_PRIMITIVE_ID: + info->ps.prim_id_input = true; + break; + case VARYING_SLOT_LAYER: + info->ps.layer_input = true; + break; + default: + break; + } if (glsl_get_base_type(type) == GLSL_TYPE_FLOAT) { if (var->data.sample) diff --git a/src/amd/common/ac_shader_info.h b/src/amd/common/ac_shader_info.h index 7f87582930c..60ddfd2d71b 100644 --- a/src/amd/common/ac_shader_info.h +++ b/src/amd/common/ac_shader_info.h @@ -49,6 +49,9 @@ struct ac_shader_info { bool writes_z; bool writes_stencil; bool writes_sample_mask; + bool has_pcoord; + bool prim_id_input; + bool layer_input; } ps; struct { bool uses_grid_size; |