diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index a6ab807e8dc..3b546851700 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -503,8 +503,7 @@ non_uniform_access_callback(const nir_src *src, void *_) void radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_layout *pipeline_layout, - const struct radv_pipeline_key *pipeline_key, unsigned last_vgt_api_stage, - struct radv_pipeline_stage *stage) + const struct radv_pipeline_key *pipeline_key, struct radv_pipeline_stage *stage) { enum amd_gfx_level gfx_level = device->physical_device->rad_info.gfx_level; bool progress; @@ -628,10 +627,10 @@ radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_layo /* Lower I/O intrinsics to memory instructions. */ bool io_to_mem = radv_nir_lower_io_to_mem(device, stage); - bool lowered_ngg = stage->info.is_ngg && stage->stage == last_vgt_api_stage; + bool lowered_ngg = stage->info.is_ngg && stage->info.next_stage == MESA_SHADER_FRAGMENT; if (lowered_ngg) { radv_lower_ngg(device, stage, pipeline_key); - } else if (stage->stage == last_vgt_api_stage) { + } else if (stage->info.next_stage == MESA_SHADER_FRAGMENT) { if (stage->stage != MESA_SHADER_GEOMETRY) { NIR_PASS_V(stage->nir, ac_nir_lower_legacy_vs, gfx_level, stage->info.outinfo.clip_dist_mask | stage->info.outinfo.cull_dist_mask, diff --git a/src/amd/vulkan/radv_pipeline_compute.c b/src/amd/vulkan/radv_pipeline_compute.c index 51b72f72fcc..19a3f058b44 100644 --- a/src/amd/vulkan/radv_pipeline_compute.c +++ b/src/amd/vulkan/radv_pipeline_compute.c @@ -161,7 +161,7 @@ radv_compile_cs(struct radv_device *device, struct vk_pipeline_cache *cache, str cs_stage->info.inline_push_constant_mask = cs_stage->args.ac.inline_push_const_mask; /* Postprocess NIR. */ - radv_postprocess_nir(device, pipeline_layout, pipeline_key, MESA_SHADER_NONE, cs_stage); + radv_postprocess_nir(device, pipeline_layout, pipeline_key, cs_stage); if (radv_can_dump_shader(device, cs_stage->nir, false)) nir_print_shader(cs_stage->nir, stderr); diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index 4686b369f52..069014614f2 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -2655,7 +2655,7 @@ radv_graphics_pipeline_compile(struct radv_graphics_pipeline *pipeline, const Vk { int64_t stage_start = os_time_get_nano(); - radv_postprocess_nir(device, pipeline_layout, pipeline_key, pipeline->last_vgt_api_stage, &stages[i]); + radv_postprocess_nir(device, pipeline_layout, pipeline_key, &stages[i]); stages[i].feedback.duration += os_time_get_nano() - stage_start; diff --git a/src/amd/vulkan/radv_pipeline_rt.c b/src/amd/vulkan/radv_pipeline_rt.c index 07164b7aa40..0d5f6ad360d 100644 --- a/src/amd/vulkan/radv_pipeline_rt.c +++ b/src/amd/vulkan/radv_pipeline_rt.c @@ -391,7 +391,7 @@ radv_rt_nir_to_asm(struct radv_device *device, struct vk_pipeline_cache *cache, temp_stage.nir = shaders[i]; radv_nir_lower_rt_abi(temp_stage.nir, pCreateInfo, &temp_stage.args, &stage->info, stack_size, i > 0); radv_optimize_nir(temp_stage.nir, pipeline_key->optimisations_disabled); - radv_postprocess_nir(device, pipeline_layout, pipeline_key, MESA_SHADER_NONE, &temp_stage); + radv_postprocess_nir(device, pipeline_layout, pipeline_key, &temp_stage); if (radv_can_dump_shader(device, temp_stage.nir, false)) nir_print_shader(temp_stage.nir, stderr); diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index f3333ec7315..e42356042cd 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -603,8 +603,7 @@ void radv_optimize_nir(struct nir_shader *shader, bool optimize_conservatively); void radv_optimize_nir_algebraic(nir_shader *shader, bool opt_offsets); void radv_postprocess_nir(struct radv_device *device, const struct radv_pipeline_layout *pipeline_layout, - const struct radv_pipeline_key *pipeline_key, unsigned last_vgt_api_stage, - struct radv_pipeline_stage *stage); + const struct radv_pipeline_key *pipeline_key, struct radv_pipeline_stage *stage); nir_shader *radv_parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo *sinfo, const struct radv_pipeline_key *key);