diff --git a/src/imagination/vulkan/pvr_device.c b/src/imagination/vulkan/pvr_device.c index 52036bd19dc..ea9acf3ee6a 100644 --- a/src/imagination/vulkan/pvr_device.c +++ b/src/imagination/vulkan/pvr_device.c @@ -41,6 +41,7 @@ #include "git_sha1.h" #include "hwdef/rogue_hw_utils.h" +#include "pco/pco.h" #include "pvr_bo.h" #include "pvr_border.h" #include "pvr_clear.h" @@ -659,6 +660,9 @@ static void pvr_physical_device_destroy(struct vk_physical_device *vk_pdevice) * before freeing or that the freeing functions accept NULL pointers. */ + if (pdevice->pco_ctx) + ralloc_free(pdevice->pco_ctx); + if (pdevice->compiler) ralloc_free(pdevice->compiler); @@ -825,6 +829,15 @@ static VkResult pvr_physical_device_init(struct pvr_physical_device *pdevice, goto err_wsi_finish; } + pdevice->pco_ctx = pco_ctx_create(&pdevice->dev_info, NULL); + if (!pdevice->pco_ctx) { + ralloc_free(pdevice->compiler); + result = vk_errorf(instance, + VK_ERROR_INITIALIZATION_FAILED, + "Failed to initialize PCO compiler context"); + goto err_wsi_finish; + } + return VK_SUCCESS; err_wsi_finish: diff --git a/src/imagination/vulkan/pvr_pipeline.c b/src/imagination/vulkan/pvr_pipeline.c index 43cc5ddbed7..04f25080f8e 100644 --- a/src/imagination/vulkan/pvr_pipeline.c +++ b/src/imagination/vulkan/pvr_pipeline.c @@ -33,6 +33,7 @@ #include "compiler/shader_enums.h" #include "hwdef/rogue_hw_utils.h" #include "nir/nir.h" +#include "pco/pco.h" #include "pvr_bo.h" #include "pvr_csb.h" #include "pvr_csb_enum_helpers.h" @@ -56,6 +57,7 @@ #include "vk_pipeline_cache.h" #include "vk_render_pass.h" #include "vk_util.h" +#include "vulkan/runtime/vk_pipeline.h" /***************************************************************************** PDS functions diff --git a/src/imagination/vulkan/pvr_private.h b/src/imagination/vulkan/pvr_private.h index f948409470b..aaccee5aeea 100644 --- a/src/imagination/vulkan/pvr_private.h +++ b/src/imagination/vulkan/pvr_private.h @@ -38,6 +38,7 @@ #include "compiler/shader_enums.h" #include "hwdef/rogue_hw_defs.h" +#include "pco/pco.h" #include "pvr_border.h" #include "pvr_clear.h" #include "pvr_common.h" @@ -112,6 +113,7 @@ struct pvr_physical_device { struct wsi_device wsi_device; struct rogue_compiler *compiler; + pco_ctx *pco_ctx; }; struct pvr_instance {