radv: move lowering PS inputs/outputs at the right place

At shaders creation, just after NIR linking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Samuel Pitoiset
2019-08-29 11:16:44 +02:00
parent 151d6990ec
commit 8d44f83844
3 changed files with 8 additions and 5 deletions

View File

@@ -2578,6 +2578,9 @@ void radv_create_shaders(struct radv_pipeline *pipeline,
nir_print_shader(nir[i], stderr); nir_print_shader(nir[i], stderr);
} }
if (nir[MESA_SHADER_FRAGMENT])
radv_lower_fs_io(nir[MESA_SHADER_FRAGMENT]);
radv_fill_shader_keys(device, keys, key, nir); radv_fill_shader_keys(device, keys, key, nir);
if (nir[MESA_SHADER_FRAGMENT]) { if (nir[MESA_SHADER_FRAGMENT]) {

View File

@@ -520,8 +520,8 @@ lower_view_index(nir_shader *nir)
return progress; return progress;
} }
static void void
lower_fs_io(nir_shader *nir) radv_lower_fs_io(nir_shader *nir)
{ {
NIR_PASS_V(nir, lower_view_index); NIR_PASS_V(nir, lower_view_index);
nir_assign_io_var_locations(&nir->inputs, &nir->num_inputs, nir_assign_io_var_locations(&nir->inputs, &nir->num_inputs,
@@ -1072,9 +1072,6 @@ shader_variant_compile(struct radv_device *device,
struct radv_shader_variant_info variant_info = {0}; struct radv_shader_variant_info variant_info = {0};
bool thread_compiler; bool thread_compiler;
if (shaders[0]->info.stage == MESA_SHADER_FRAGMENT)
lower_fs_io(shaders[0]);
options->family = chip_family; options->family = chip_family;
options->chip_class = device->physical_device->rad_info.chip_class; options->chip_class = device->physical_device->rad_info.chip_class;
options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader); options->dump_shader = radv_can_dump_shader(device, module, gs_copy_shader);

View File

@@ -449,4 +449,7 @@ radv_can_dump_shader_stats(struct radv_device *device,
unsigned unsigned
shader_io_get_unique_index(gl_varying_slot slot); shader_io_get_unique_index(gl_varying_slot slot);
void
radv_lower_fs_io(nir_shader *nir);
#endif #endif