mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 07:00:12 +01:00
anv: Use vk_pipeline_shader_stage_to_nir
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17337>
This commit is contained in:
parent
c2b3d9ca2b
commit
62915eb4fe
1 changed files with 9 additions and 17 deletions
|
|
@ -50,15 +50,13 @@
|
||||||
* we can't do that yet because we don't have the ability to copy nir.
|
* we can't do that yet because we don't have the ability to copy nir.
|
||||||
*/
|
*/
|
||||||
static nir_shader *
|
static nir_shader *
|
||||||
anv_shader_compile_to_nir(struct anv_device *device,
|
anv_shader_stage_to_nir(struct anv_device *device,
|
||||||
void *mem_ctx,
|
const VkPipelineShaderStageCreateInfo *stage_info,
|
||||||
const struct vk_shader_module *module,
|
void *mem_ctx)
|
||||||
const char *entrypoint_name,
|
|
||||||
gl_shader_stage stage,
|
|
||||||
const VkSpecializationInfo *spec_info)
|
|
||||||
{
|
{
|
||||||
const struct anv_physical_device *pdevice = device->physical;
|
const struct anv_physical_device *pdevice = device->physical;
|
||||||
const struct brw_compiler *compiler = pdevice->compiler;
|
const struct brw_compiler *compiler = pdevice->compiler;
|
||||||
|
gl_shader_stage stage = vk_to_mesa_shader_stage(stage_info->stage);
|
||||||
const nir_shader_compiler_options *nir_options =
|
const nir_shader_compiler_options *nir_options =
|
||||||
compiler->nir_options[stage];
|
compiler->nir_options[stage];
|
||||||
|
|
||||||
|
|
@ -135,10 +133,10 @@ anv_shader_compile_to_nir(struct anv_device *device,
|
||||||
};
|
};
|
||||||
|
|
||||||
nir_shader *nir;
|
nir_shader *nir;
|
||||||
VkResult result = vk_shader_module_to_nir(&device->vk, module,
|
VkResult result =
|
||||||
stage, entrypoint_name,
|
vk_pipeline_shader_stage_to_nir(&device->vk, stage_info,
|
||||||
spec_info, &spirv_options,
|
&spirv_options, nir_options,
|
||||||
nir_options, mem_ctx, &nir);
|
mem_ctx, &nir);
|
||||||
if (result != VK_SUCCESS)
|
if (result != VK_SUCCESS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|
@ -698,13 +696,7 @@ anv_pipeline_stage_get_nir(struct anv_pipeline *pipeline,
|
||||||
return nir;
|
return nir;
|
||||||
}
|
}
|
||||||
|
|
||||||
VK_FROM_HANDLE(vk_shader_module, module, stage->info->module);
|
nir = anv_shader_stage_to_nir(pipeline->device, stage->info, mem_ctx);
|
||||||
nir = anv_shader_compile_to_nir(pipeline->device,
|
|
||||||
mem_ctx,
|
|
||||||
module,
|
|
||||||
stage->info->pName,
|
|
||||||
stage->stage,
|
|
||||||
stage->info->pSpecializationInfo);
|
|
||||||
if (nir) {
|
if (nir) {
|
||||||
anv_device_upload_nir(pipeline->device, cache, nir, stage->shader_sha1);
|
anv_device_upload_nir(pipeline->device, cache, nir, stage->shader_sha1);
|
||||||
return nir;
|
return nir;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue