diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index 009fb3fe6bf..9c482e5da08 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -428,8 +428,6 @@ radv_device_init_meta(struct radv_device *device) mtx_init(&device->meta_state.mtx, mtx_plain); - device->app_shaders_internal = true; - result = radv_device_init_meta_clear_state(device, on_demand); if (result != VK_SUCCESS) goto fail_clear; @@ -501,8 +499,6 @@ radv_device_init_meta(struct radv_device *device) goto fail_accel_struct; } - device->app_shaders_internal = false; - return VK_SUCCESS; fail_accel_struct: diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 1ea50c2dc1f..c12da38c550 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -3121,7 +3121,8 @@ radv_pipeline_get_nir(struct radv_pipeline *pipeline, struct radv_pipeline_stage if (pipeline->retained_shaders[s].nir) { stages[s].nir = nir_shader_clone(NULL, pipeline->retained_shaders[s].nir); } else { - stages[s].nir = radv_shader_spirv_to_nir(device, &stages[s], pipeline_key); + stages[s].nir = radv_shader_spirv_to_nir(device, &stages[s], pipeline_key, + pipeline->is_internal); } if (retain_shaders) @@ -5083,6 +5084,7 @@ radv_graphics_pipeline_create(VkDevice _device, VkPipelineCache _cache, return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY); radv_pipeline_init(device, &pipeline->base, RADV_PIPELINE_GRAPHICS); + pipeline->base.is_internal = is_internal; result = radv_graphics_pipeline_init(pipeline, device, cache, pCreateInfo, extra); if (result != VK_SUCCESS) { @@ -5373,6 +5375,7 @@ radv_compute_pipeline_create(VkDevice _device, VkPipelineCache _cache, } radv_pipeline_init(device, &pipeline->base, RADV_PIPELINE_COMPUTE); + pipeline->base.is_internal = is_internal; const VkPipelineCreationFeedbackCreateInfo *creation_feedback = vk_find_struct_const(pCreateInfo->pNext, PIPELINE_CREATION_FEEDBACK_CREATE_INFO); diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index e3bc9cbc1d1..a719c4caaff 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -1005,9 +1005,6 @@ struct radv_device { /* Whether per-vertex VRS is forced. */ bool force_vrs_enabled; - /* Whether shaders created through application entrypoints are considered internal. */ - bool app_shaders_internal; - simple_mtx_t pstate_mtx; unsigned pstate_cnt; @@ -2042,6 +2039,7 @@ struct radv_pipeline { struct radv_pipeline_slab *slab; struct radeon_winsys_bo *slab_bo; + bool is_internal; bool need_indirect_descriptor_sets; struct radv_shader *shaders[MESA_VULKAN_SHADER_STAGES]; struct radv_shader *gs_copy_shader; diff --git a/src/amd/vulkan/radv_rt_shader.c b/src/amd/vulkan/radv_rt_shader.c index 90efab76a22..b51b93e7310 100644 --- a/src/amd/vulkan/radv_rt_shader.c +++ b/src/amd/vulkan/radv_rt_shader.c @@ -802,7 +802,7 @@ parse_rt_stage(struct radv_device *device, const VkPipelineShaderStageCreateInfo radv_pipeline_stage_init(sinfo, &rt_stage, vk_to_mesa_shader_stage(sinfo->stage)); - nir_shader *shader = radv_shader_spirv_to_nir(device, &rt_stage, key); + nir_shader *shader = radv_shader_spirv_to_nir(device, &rt_stage, key, false); if (shader->info.stage == MESA_SHADER_RAYGEN || shader->info.stage == MESA_SHADER_CLOSEST_HIT || shader->info.stage == MESA_SHADER_CALLABLE || shader->info.stage == MESA_SHADER_MISS) { diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c index 661b4288f87..b2bcc853f0d 100644 --- a/src/amd/vulkan/radv_shader.c +++ b/src/amd/vulkan/radv_shader.c @@ -716,7 +716,7 @@ is_not_xfb_output(nir_variable *var, void *data) nir_shader * radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_stage *stage, - const struct radv_pipeline_key *key) + const struct radv_pipeline_key *key, bool is_internal) { unsigned subgroup_size = 64, ballot_bit_size = 64; if (key->cs.compute_subgroup_size) { @@ -745,7 +745,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ bool dump_meta = device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS; if ((device->instance->debug_flags & RADV_DEBUG_DUMP_SPIRV) && - (!device->app_shaders_internal || dump_meta)) + (!is_internal || dump_meta)) radv_print_spirv(stage->spirv.data, stage->spirv.size, stderr); uint32_t num_spec_entries = 0; @@ -839,7 +839,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_ nir = spirv_to_nir(spirv, stage->spirv.size / 4, spec_entries, num_spec_entries, stage->stage, stage->entrypoint, &spirv_options, &device->physical_device->nir_options[stage->stage]); - nir->info.internal |= device->app_shaders_internal; + nir->info.internal |= is_internal; assert(nir->info.stage == stage->stage); nir_validate_shader(nir, "after spirv_to_nir"); diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 871384a59a6..7d70544eeb0 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -542,7 +542,8 @@ struct radv_pipeline_stage; nir_shader *radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_stage *stage, - const struct radv_pipeline_key *key); + const struct radv_pipeline_key *key, + bool is_internal); void radv_nir_lower_abi(nir_shader *shader, enum amd_gfx_level gfx_level, const struct radv_shader_info *info, const struct radv_shader_args *args,