}
static VkResult
-lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline,
- const VkPipelineShaderStageCreateInfo *sinfo)
+compile_spirv(struct lvp_device *pdevice, const VkPipelineShaderStageCreateInfo *sinfo, nir_shader **nir)
{
- struct lvp_device *pdevice = pipeline->device;
gl_shader_stage stage = vk_to_mesa_shader_stage(sinfo->stage);
assert(stage <= MESA_SHADER_COMPUTE && stage != MESA_SHADER_NONE);
VkResult result;
- nir_shader *nir;
const struct spirv_to_nir_options spirv_options = {
.environment = NIR_SPIRV_VULKAN,
result = vk_pipeline_shader_stage_to_nir(&pdevice->vk, sinfo,
&spirv_options, pdevice->physical_device->drv_options[stage],
- NULL, &nir);
+ NULL, nir);
+ return result;
+}
+
+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 <= MESA_SHADER_COMPUTE && stage != MESA_SHADER_NONE);
+ nir_shader *nir;
+ VkResult result = compile_spirv(pdevice, sinfo, &nir);
if (result != VK_SUCCESS)
return result;