mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
lavapipe: Add lvp_spirv_to_nir
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28187>
This commit is contained in:
parent
04af9b3ac2
commit
5d43b8c46e
2 changed files with 17 additions and 4 deletions
|
|
@ -499,6 +499,17 @@ lvp_shader_lower(struct lvp_device *pdevice, struct lvp_pipeline *pipeline, nir_
|
|||
nir->info.stage);
|
||||
}
|
||||
|
||||
VkResult
|
||||
lvp_spirv_to_nir(struct lvp_pipeline *pipeline, const VkPipelineShaderStageCreateInfo *sinfo,
|
||||
nir_shader **out_nir)
|
||||
{
|
||||
VkResult result = compile_spirv(pipeline->device, sinfo, out_nir);
|
||||
if (result == VK_SUCCESS)
|
||||
lvp_shader_lower(pipeline->device, pipeline, *out_nir, pipeline->layout);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void
|
||||
lvp_shader_init(struct lvp_shader *shader, nir_shader *nir)
|
||||
{
|
||||
|
|
@ -514,14 +525,12 @@ static VkResult
|
|||
lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
|
||||
const VkPipelineShaderStageCreateInfo *sinfo)
|
||||
{
|
||||
struct lvp_device *pdevice = pipeline->device;
|
||||
gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage);
|
||||
assert(stage <= LVP_SHADER_STAGES && stage != MESA_SHADER_NONE);
|
||||
struct lvp_shader *shader = &pipeline->shaders[stage];
|
||||
nir_shader *nir;
|
||||
VkResult result = compile_spirv(pdevice, sinfo, &nir);
|
||||
VkResult result = lvp_spirv_to_nir(pipeline, sinfo, &nir);
|
||||
if (result == VK_SUCCESS) {
|
||||
lvp_shader_lower(pdevice, pipeline, nir, pipeline->layout);
|
||||
struct lvp_shader *shader = &pipeline->shaders[stage];
|
||||
lvp_shader_init(shader, nir);
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -741,6 +741,10 @@ lvp_pipeline_destroy(struct lvp_device *device, struct lvp_pipeline *pipeline, b
|
|||
void
|
||||
queue_thread_noop(void *data, void *gdata, int thread_index);
|
||||
|
||||
VkResult
|
||||
lvp_spirv_to_nir(struct lvp_pipeline *pipeline, const VkPipelineShaderStageCreateInfo *sinfo,
|
||||
nir_shader **out_nir);
|
||||
|
||||
void
|
||||
lvp_shader_optimize(nir_shader *nir);
|
||||
bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue