mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-23 17:00:22 +01:00
radv: track whether inputs/outputs are linked per shader stage
With shader object, it's possible to compile shaders without any linking. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24328>
This commit is contained in:
parent
3629b43822
commit
2e7ea0fc24
2 changed files with 14 additions and 0 deletions
|
|
@ -1459,12 +1459,18 @@ radv_link_vs(const struct radv_device *device, struct radv_shader_stage *vs_stag
|
|||
nir_linked_io_var_info vs2tcs = nir_assign_linked_io_var_locations(vs_stage->nir, next_stage->nir);
|
||||
|
||||
vs_stage->info.vs.num_linked_outputs = vs2tcs.num_linked_io_vars;
|
||||
vs_stage->info.outputs_linked = true;
|
||||
|
||||
next_stage->info.tcs.num_linked_inputs = vs2tcs.num_linked_io_vars;
|
||||
next_stage->info.inputs_linked = true;
|
||||
} else if (next_stage && next_stage->nir->info.stage == MESA_SHADER_GEOMETRY) {
|
||||
nir_linked_io_var_info vs2gs = nir_assign_linked_io_var_locations(vs_stage->nir, next_stage->nir);
|
||||
|
||||
vs_stage->info.vs.num_linked_outputs = vs2gs.num_linked_io_vars;
|
||||
vs_stage->info.outputs_linked = true;
|
||||
|
||||
next_stage->info.gs.num_linked_inputs = vs2gs.num_linked_io_vars;
|
||||
next_stage->info.inputs_linked = true;
|
||||
} else {
|
||||
nir_foreach_shader_out_variable (var, vs_stage->nir) {
|
||||
var->data.driver_location = var->data.location;
|
||||
|
|
@ -1490,8 +1496,11 @@ radv_link_tcs(const struct radv_device *device, struct radv_shader_stage *tcs_st
|
|||
|
||||
tcs_stage->info.tcs.num_linked_outputs = tcs2tes.num_linked_io_vars;
|
||||
tcs_stage->info.tcs.num_linked_patch_outputs = tcs2tes.num_linked_patch_io_vars;
|
||||
tcs_stage->info.outputs_linked = true;
|
||||
|
||||
tes_stage->info.tes.num_linked_inputs = tcs2tes.num_linked_io_vars;
|
||||
tes_stage->info.tes.num_linked_patch_inputs = tcs2tes.num_linked_patch_io_vars;
|
||||
tes_stage->info.inputs_linked = true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1515,7 +1524,10 @@ radv_link_tes(const struct radv_device *device, struct radv_shader_stage *tes_st
|
|||
nir_linked_io_var_info tes2gs = nir_assign_linked_io_var_locations(tes_stage->nir, next_stage->nir);
|
||||
|
||||
tes_stage->info.tes.num_linked_outputs = tes2gs.num_linked_io_vars;
|
||||
tes_stage->info.outputs_linked = true;
|
||||
|
||||
next_stage->info.gs.num_linked_inputs = tes2gs.num_linked_io_vars;
|
||||
next_stage->info.inputs_linked = true;
|
||||
} else {
|
||||
nir_foreach_shader_out_variable (var, tes_stage->nir) {
|
||||
var->data.driver_location = var->data.location;
|
||||
|
|
|
|||
|
|
@ -299,6 +299,8 @@ struct radv_shader_info {
|
|||
gl_shader_stage next_stage;
|
||||
enum radv_shader_type type;
|
||||
uint32_t user_data_0;
|
||||
bool inputs_linked;
|
||||
bool outputs_linked;
|
||||
|
||||
struct {
|
||||
uint8_t input_usage_mask[RADV_VERT_ATTRIB_MAX];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue