radv: Get rid of app_shaders_internal.
This will make sure the internal field is set to true for internal shaders which are initialized outside of radv_device_init_meta. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20670>
This commit is contained in:
@@ -428,8 +428,6 @@ radv_device_init_meta(struct radv_device *device)
|
|||||||
|
|
||||||
mtx_init(&device->meta_state.mtx, mtx_plain);
|
mtx_init(&device->meta_state.mtx, mtx_plain);
|
||||||
|
|
||||||
device->app_shaders_internal = true;
|
|
||||||
|
|
||||||
result = radv_device_init_meta_clear_state(device, on_demand);
|
result = radv_device_init_meta_clear_state(device, on_demand);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
goto fail_clear;
|
goto fail_clear;
|
||||||
@@ -501,8 +499,6 @@ radv_device_init_meta(struct radv_device *device)
|
|||||||
goto fail_accel_struct;
|
goto fail_accel_struct;
|
||||||
}
|
}
|
||||||
|
|
||||||
device->app_shaders_internal = false;
|
|
||||||
|
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
|
||||||
fail_accel_struct:
|
fail_accel_struct:
|
||||||
|
@@ -3121,7 +3121,8 @@ radv_pipeline_get_nir(struct radv_pipeline *pipeline, struct radv_pipeline_stage
|
|||||||
if (pipeline->retained_shaders[s].nir) {
|
if (pipeline->retained_shaders[s].nir) {
|
||||||
stages[s].nir = nir_shader_clone(NULL, pipeline->retained_shaders[s].nir);
|
stages[s].nir = nir_shader_clone(NULL, pipeline->retained_shaders[s].nir);
|
||||||
} else {
|
} 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)
|
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);
|
return vk_error(device, VK_ERROR_OUT_OF_HOST_MEMORY);
|
||||||
|
|
||||||
radv_pipeline_init(device, &pipeline->base, RADV_PIPELINE_GRAPHICS);
|
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);
|
result = radv_graphics_pipeline_init(pipeline, device, cache, pCreateInfo, extra);
|
||||||
if (result != VK_SUCCESS) {
|
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);
|
radv_pipeline_init(device, &pipeline->base, RADV_PIPELINE_COMPUTE);
|
||||||
|
pipeline->base.is_internal = is_internal;
|
||||||
|
|
||||||
const VkPipelineCreationFeedbackCreateInfo *creation_feedback =
|
const VkPipelineCreationFeedbackCreateInfo *creation_feedback =
|
||||||
vk_find_struct_const(pCreateInfo->pNext, PIPELINE_CREATION_FEEDBACK_CREATE_INFO);
|
vk_find_struct_const(pCreateInfo->pNext, PIPELINE_CREATION_FEEDBACK_CREATE_INFO);
|
||||||
|
@@ -1005,9 +1005,6 @@ struct radv_device {
|
|||||||
/* Whether per-vertex VRS is forced. */
|
/* Whether per-vertex VRS is forced. */
|
||||||
bool force_vrs_enabled;
|
bool force_vrs_enabled;
|
||||||
|
|
||||||
/* Whether shaders created through application entrypoints are considered internal. */
|
|
||||||
bool app_shaders_internal;
|
|
||||||
|
|
||||||
simple_mtx_t pstate_mtx;
|
simple_mtx_t pstate_mtx;
|
||||||
unsigned pstate_cnt;
|
unsigned pstate_cnt;
|
||||||
|
|
||||||
@@ -2042,6 +2039,7 @@ struct radv_pipeline {
|
|||||||
struct radv_pipeline_slab *slab;
|
struct radv_pipeline_slab *slab;
|
||||||
struct radeon_winsys_bo *slab_bo;
|
struct radeon_winsys_bo *slab_bo;
|
||||||
|
|
||||||
|
bool is_internal;
|
||||||
bool need_indirect_descriptor_sets;
|
bool need_indirect_descriptor_sets;
|
||||||
struct radv_shader *shaders[MESA_VULKAN_SHADER_STAGES];
|
struct radv_shader *shaders[MESA_VULKAN_SHADER_STAGES];
|
||||||
struct radv_shader *gs_copy_shader;
|
struct radv_shader *gs_copy_shader;
|
||||||
|
@@ -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));
|
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 ||
|
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) {
|
shader->info.stage == MESA_SHADER_CALLABLE || shader->info.stage == MESA_SHADER_MISS) {
|
||||||
|
@@ -716,7 +716,7 @@ is_not_xfb_output(nir_variable *var, void *data)
|
|||||||
|
|
||||||
nir_shader *
|
nir_shader *
|
||||||
radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_stage *stage,
|
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;
|
unsigned subgroup_size = 64, ballot_bit_size = 64;
|
||||||
if (key->cs.compute_subgroup_size) {
|
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;
|
bool dump_meta = device->instance->debug_flags & RADV_DEBUG_DUMP_META_SHADERS;
|
||||||
if ((device->instance->debug_flags & RADV_DEBUG_DUMP_SPIRV) &&
|
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);
|
radv_print_spirv(stage->spirv.data, stage->spirv.size, stderr);
|
||||||
|
|
||||||
uint32_t num_spec_entries = 0;
|
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,
|
nir = spirv_to_nir(spirv, stage->spirv.size / 4, spec_entries, num_spec_entries, stage->stage,
|
||||||
stage->entrypoint, &spirv_options,
|
stage->entrypoint, &spirv_options,
|
||||||
&device->physical_device->nir_options[stage->stage]);
|
&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);
|
assert(nir->info.stage == stage->stage);
|
||||||
nir_validate_shader(nir, "after spirv_to_nir");
|
nir_validate_shader(nir, "after spirv_to_nir");
|
||||||
|
|
||||||
|
@@ -542,7 +542,8 @@ struct radv_pipeline_stage;
|
|||||||
|
|
||||||
nir_shader *radv_shader_spirv_to_nir(struct radv_device *device,
|
nir_shader *radv_shader_spirv_to_nir(struct radv_device *device,
|
||||||
const struct radv_pipeline_stage *stage,
|
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,
|
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,
|
const struct radv_shader_info *info, const struct radv_shader_args *args,
|
||||||
|
Reference in New Issue
Block a user