diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 941ec0d668a..bdc9911b587 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -240,6 +240,8 @@ lvp_physical_device_init(struct lvp_physical_device *device, device->pscreen = pipe_loader_create_screen_vk(device->pld, true); if (!device->pscreen) return vk_error(instance, VK_ERROR_OUT_OF_HOST_MEMORY); + for (unsigned i = 0; i < ARRAY_SIZE(device->drv_options); i++) + device->drv_options[i] = device->pscreen->get_compiler_options(device->pscreen, PIPE_SHADER_IR_NIR, i); device->sync_timeline_type = vk_sync_timeline_get_type(&lvp_pipe_sync_type); device->sync_types[0] = &lvp_pipe_sync_type; diff --git a/src/gallium/frontends/lavapipe/lvp_pipeline.c b/src/gallium/frontends/lavapipe/lvp_pipeline.c index 14f359e9866..87d9da57764 100644 --- a/src/gallium/frontends/lavapipe/lvp_pipeline.c +++ b/src/gallium/frontends/lavapipe/lvp_pipeline.c @@ -364,7 +364,6 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, 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); - const nir_shader_compiler_options *drv_options = pdevice->pscreen->get_compiler_options(pipeline->device->pscreen, PIPE_SHADER_IR_NIR, (enum pipe_shader_type)stage); VkResult result; nir_shader *nir; @@ -420,7 +419,7 @@ lvp_shader_compile_to_ir(struct lvp_pipeline *pipeline, }; result = vk_pipeline_shader_stage_to_nir(&pdevice->vk, sinfo, - &spirv_options, drv_options, + &spirv_options, pdevice->physical_device->drv_options[stage], NULL, &nir); if (result != VK_SUCCESS) return result; diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index fe2b76732a9..d928d74eb11 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -126,6 +126,7 @@ struct lvp_physical_device { struct pipe_loader_device *pld; struct pipe_screen *pscreen; + const nir_shader_compiler_options *drv_options[MESA_SHADER_STAGES]; uint32_t max_images; struct vk_sync_timeline_type sync_timeline_type;