summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-03-01 11:54:19 +0100
committerSamuel Pitoiset <[email protected]>2018-03-06 10:37:47 +0100
commit5cd34f03c0a38fffe776a57521dad8ca24453bf1 (patch)
tree43be80f860e59426749ffdac688f65398a1773df /src
parentd1fa30e0f8cdf17c592e9a3b121dd794a85e136a (diff)
ac/shader: scan output usage mask for VS and TES
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_shader_info.c18
-rw-r--r--src/amd/common/ac_shader_info.h4
2 files changed, 22 insertions, 0 deletions
diff --git a/src/amd/common/ac_shader_info.c b/src/amd/common/ac_shader_info.c
index 57d7edec764..98de963147b 100644
--- a/src/amd/common/ac_shader_info.c
+++ b/src/amd/common/ac_shader_info.c
@@ -146,6 +146,24 @@ gather_intrinsic_info(const nir_shader *nir, const nir_intrinsic_instr *instr,
}
}
break;
+ case nir_intrinsic_store_var: {
+ nir_deref_var *dvar = instr->variables[0];
+ nir_variable *var = dvar->var;
+
+ if (var->data.mode == nir_var_shader_out) {
+ unsigned idx = var->data.location;
+ unsigned comp = var->data.location_frac;
+
+ if (nir->info.stage == MESA_SHADER_VERTEX) {
+ info->vs.output_usage_mask[idx] |=
+ instr->const_index[0] << comp;
+ } else if (nir->info.stage == MESA_SHADER_TESS_EVAL) {
+ info->tes.output_usage_mask[idx] |=
+ instr->const_index[0] << comp;
+ }
+ }
+ break;
+ }
default:
break;
}
diff --git a/src/amd/common/ac_shader_info.h b/src/amd/common/ac_shader_info.h
index 60ddfd2d71b..12a1dcf9156 100644
--- a/src/amd/common/ac_shader_info.h
+++ b/src/amd/common/ac_shader_info.h
@@ -37,11 +37,15 @@ struct ac_shader_info {
bool uses_prim_id;
struct {
uint8_t input_usage_mask[VERT_ATTRIB_MAX];
+ uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
bool has_vertex_buffers; /* needs vertex buffers and base/start */
bool needs_draw_id;
bool needs_instance_id;
} vs;
struct {
+ uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
+ } tes;
+ struct {
bool force_persample;
bool needs_sample_positions;
bool uses_input_attachments;