Add fallback for pipeline creation

Wait... you have to check an extra boolean to know if the extension is actually supported?! What were they thinking?!
This commit is contained in:
RaveYard 2025-04-12 14:32:38 +02:00 committed by Magnus Norddahl
commit b1a61d5f30
2 changed files with 7 additions and 1 deletions

View file

@ -374,6 +374,11 @@ void VkRenderPassManager::CreateZMinMaxPipeline()
VkRenderPassSetup::VkRenderPassSetup(VulkanRenderDevice* fb, const VkRenderPassKey &key) : PassKey(key), fb(fb)
{
const auto device = fb->GetDevice();
UsePipelineLibrary = device->SupportsExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME) // Is this supported?
&& device->EnabledFeatures.GraphicsPipelineLibrary.graphicsPipelineLibrary; // Well yes, but actually no.
// Precompile material fragment shaders:
if (gl_ubershaders)
{
@ -576,7 +581,7 @@ PipelineData* VkRenderPassSetup::GetGeneralizedPipeline(const VkPipelineKey& key
if (item == GeneralizedPipelines.end())
{
UniformStructHolder uniforms;
auto pipeline = LinkPipeline(gkey, true, uniforms);
auto pipeline = UsePipelineLibrary ? LinkPipeline(gkey, true, uniforms) : CreateWithStats(*CreatePipeline(gkey, true, uniforms), "Generalized (no pipeline library)");
auto ptr = pipeline.get();
auto& value = GeneralizedPipelines[gkey];
value.pipeline = std::move(pipeline);

View file

@ -118,6 +118,7 @@ private:
void AddFragmentOutputInterface(GraphicsPipelineBuilder& builder, FRenderStyle renderStyle, VkColorComponentFlags colorMask);
void AddDynamicState(GraphicsPipelineBuilder& builder);
bool UsePipelineLibrary = false;
VulkanRenderDevice* fb = nullptr;
VkRenderPassKey PassKey;
std::unique_ptr<VulkanRenderPass> RenderPasses[8];