mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
radv: pass radv_compiler_info to radv_pipeline_get_shader_key()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41137>
This commit is contained in:
parent
9225ba47d5
commit
48db5c0378
7 changed files with 11 additions and 9 deletions
|
|
@ -1190,6 +1190,7 @@ radv_device_init_compiler_info(struct radv_device *device)
|
|||
.buffer_descriptor_size = pdev->vk.properties.bufferDescriptorSize,
|
||||
.buffer_descriptor_alignment = pdev->vk.properties.bufferDescriptorAlignment,
|
||||
/* Shader features */
|
||||
.device_robustness_state = &device->vk.robustness_state,
|
||||
.use_ngg = pdev->use_ngg,
|
||||
.use_ngg_streamout = pdev->use_ngg_streamout,
|
||||
.load_grid_size_from_user_sgpr = device->load_grid_size_from_user_sgpr,
|
||||
|
|
|
|||
|
|
@ -107,10 +107,10 @@ radv_DestroyPipeline(VkDevice _device, VkPipeline _pipeline, const VkAllocationC
|
|||
}
|
||||
|
||||
struct radv_shader_stage_key
|
||||
radv_pipeline_get_shader_key(const struct radv_device *device, const VkPipelineShaderStageCreateInfo *stage,
|
||||
VkPipelineCreateFlags2 flags, const void *pNext)
|
||||
radv_pipeline_get_shader_key(const struct radv_compiler_info *compiler_info,
|
||||
const VkPipelineShaderStageCreateInfo *stage, VkPipelineCreateFlags2 flags,
|
||||
const void *pNext)
|
||||
{
|
||||
const struct radv_compiler_info *compiler_info = &device->compiler_info;
|
||||
mesa_shader_stage s = vk_to_mesa_shader_stage(stage->stage);
|
||||
struct vk_pipeline_robustness_state rs;
|
||||
struct radv_shader_stage_key key = {0};
|
||||
|
|
@ -139,7 +139,7 @@ radv_pipeline_get_shader_key(const struct radv_device *device, const VkPipelineS
|
|||
key.version = compiler_info->override_compute_shader_version;
|
||||
}
|
||||
|
||||
vk_pipeline_robustness_state_fill(&device->vk.robustness_state, &rs, pNext, stage->pNext);
|
||||
vk_pipeline_robustness_state_fill(compiler_info->device_robustness_state, &rs, pNext, stage->pNext);
|
||||
|
||||
radv_set_stage_key_robustness(&rs, s, &key);
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ void radv_pipeline_init(struct radv_device *device, struct radv_pipeline *pipeli
|
|||
void radv_pipeline_destroy(struct radv_device *device, struct radv_pipeline *pipeline,
|
||||
const VkAllocationCallbacks *allocator);
|
||||
|
||||
struct radv_shader_stage_key radv_pipeline_get_shader_key(const struct radv_device *device,
|
||||
struct radv_shader_stage_key radv_pipeline_get_shader_key(const struct radv_compiler_info *compiler_info,
|
||||
const VkPipelineShaderStageCreateInfo *stage,
|
||||
VkPipelineCreateFlags2 flags, const void *pNext);
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ radv_compute_pipeline_hash(const struct radv_device *device, const VkComputePipe
|
|||
blake3_hasher ctx;
|
||||
|
||||
struct radv_shader_stage_key stage_key =
|
||||
radv_pipeline_get_shader_key(device, sinfo, create_flags, pCreateInfo->pNext);
|
||||
radv_pipeline_get_shader_key(&device->compiler_info, sinfo, create_flags, pCreateInfo->pNext);
|
||||
|
||||
_mesa_blake3_init(&ctx);
|
||||
radv_pipeline_hash(device, pipeline_layout, &ctx);
|
||||
|
|
@ -208,7 +208,7 @@ radv_compute_pipeline_compile(const VkComputePipelineCreateInfo *pCreateInfo, st
|
|||
int64_t stage_start = os_time_get_nano();
|
||||
|
||||
const struct radv_shader_stage_key stage_key =
|
||||
radv_pipeline_get_shader_key(device, &pCreateInfo->stage, pipeline->base.create_flags, pCreateInfo->pNext);
|
||||
radv_pipeline_get_shader_key(compiler_info, &pCreateInfo->stage, pipeline->base.create_flags, pCreateInfo->pNext);
|
||||
|
||||
radv_pipeline_stage_init(pipeline->base.create_flags, pStage, pipeline_layout, &stage_key, &cs_stage);
|
||||
|
||||
|
|
|
|||
|
|
@ -1803,7 +1803,7 @@ radv_generate_graphics_pipeline_key(const struct radv_device *device, const VkGr
|
|||
const VkPipelineShaderStageCreateInfo *stage = &pCreateInfo->pStages[i];
|
||||
mesa_shader_stage s = vk_to_mesa_shader_stage(stage->stage);
|
||||
|
||||
key.stage_info[s] = radv_pipeline_get_shader_key(device, stage, create_flags, pCreateInfo->pNext);
|
||||
key.stage_info[s] = radv_pipeline_get_shader_key(compiler_info, stage, create_flags, pCreateInfo->pNext);
|
||||
|
||||
if (s == MESA_SHADER_MESH && (state->shader_stages & VK_SHADER_STAGE_TASK_BIT_EXT))
|
||||
key.stage_info[s].has_task_shader = true;
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ radv_generate_rt_shaders_key(const struct radv_device *device, const VkRayTracin
|
|||
const VkPipelineShaderStageCreateInfo *stage = &pCreateInfo->pStages[i];
|
||||
mesa_shader_stage s = vk_to_mesa_shader_stage(stage->stage);
|
||||
|
||||
stage_keys[s] = radv_pipeline_get_shader_key(device, stage, create_flags, pCreateInfo->pNext);
|
||||
stage_keys[s] = radv_pipeline_get_shader_key(&device->compiler_info, stage, create_flags, pCreateInfo->pNext);
|
||||
}
|
||||
|
||||
if (pCreateInfo->pLibraryInfo) {
|
||||
|
|
|
|||
|
|
@ -560,6 +560,7 @@ struct radv_compiler_info {
|
|||
uint8_t override_ray_tracing_shader_version;
|
||||
|
||||
/* Shader features */
|
||||
const struct vk_pipeline_robustness_state *device_robustness_state;
|
||||
uint8_t sampled_image_desc_size;
|
||||
uint8_t combined_image_sampler_desc_size;
|
||||
uint8_t combined_image_sampler_offset;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue