Skip to content

Commit 135200f

Browse files
committed
Add support for graphics pipeline libraries
1 parent dd65653 commit 135200f

File tree

6 files changed

+150
-35
lines changed

6 files changed

+150
-35
lines changed

example/example.cpp

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmd
6767
auto instance = VulkanInstanceBuilder()
6868
.RequireExtension(VK_KHR_SURFACE_EXTENSION_NAME)
6969
.RequireExtension(VK_KHR_WIN32_SURFACE_EXTENSION_NAME)
70-
.DebugLayer(false)
70+
.DebugLayer(true)
7171
.Create();
7272

7373
// Create a surface for our window
@@ -239,7 +239,7 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmd
239239
.DebugName("textureSetLayout")
240240
.Create(device.get());
241241

242-
// Create a pipeline layouts
242+
// Create pipeline layouts
243243

244244
auto pipelineLayoutNoTex = PipelineLayoutBuilder()
245245
.AddSetLayout(uniformSetLayout.get())
@@ -260,23 +260,75 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmd
260260
.AddSubpassColorAttachmentRef(0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)
261261
.Create(device.get());
262262

263-
// Create pipelines (which shaders to use, blending rules, etc.)
263+
// Create pipelines
264264

265-
auto pipelineNoTex = GraphicsPipelineBuilder()
266-
.RenderPass(renderPass.get())
267-
.Layout(pipelineLayoutNoTex.get())
268-
.AddVertexBufferBinding(0, sizeof(Vertex))
269-
.AddVertexAttribute(0, 0, VK_FORMAT_R32G32B32_SFLOAT, offsetof(Vertex, x))
270-
.AddVertexAttribute(1, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(Vertex, u))
271-
.AddVertexAttribute(2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, r))
272-
.AddVertexShader(vertexShader.get())
273-
.AddFragmentShader(fragmentShaderNoTex.get())
274-
.AddDynamicState(VK_DYNAMIC_STATE_VIEWPORT)
275-
.AddDynamicState(VK_DYNAMIC_STATE_SCISSOR)
276-
.DebugName("pipelineNoTex")
277-
.Create(device.get());
265+
std::unique_ptr<VulkanPipeline> libraryNoTex, libraryBlend;
266+
std::unique_ptr<VulkanPipeline> pipelineNoTex, pipelineTextured;
267+
268+
// Can we use pipeline libraries?
269+
270+
if (device->EnabledFeatures.GraphicsPipelineLibrary.graphicsPipelineLibrary)
271+
{
272+
libraryNoTex = GraphicsPipelineBuilder()
273+
.RenderPass(renderPass.get())
274+
.Layout(pipelineLayoutNoTex.get())
275+
.Flags(
276+
VK_PIPELINE_CREATE_LIBRARY_BIT_KHR |
277+
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT)
278+
.LibraryFlags(
279+
VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT |
280+
VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT |
281+
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)
282+
.AddVertexBufferBinding(0, sizeof(Vertex))
283+
.AddVertexAttribute(0, 0, VK_FORMAT_R32G32B32_SFLOAT, offsetof(Vertex, x))
284+
.AddVertexAttribute(1, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(Vertex, u))
285+
.AddVertexAttribute(2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, r))
286+
.AddVertexShader(vertexShader.get())
287+
.AddFragmentShader(fragmentShaderNoTex.get())
288+
.AddDynamicState(VK_DYNAMIC_STATE_VIEWPORT)
289+
.AddDynamicState(VK_DYNAMIC_STATE_SCISSOR)
290+
.DebugName("libraryNoTex")
291+
.Create(device.get());
292+
293+
libraryBlend = GraphicsPipelineBuilder()
294+
.RenderPass(renderPass.get())
295+
.Layout(pipelineLayoutNoTex.get())
296+
.Flags(
297+
VK_PIPELINE_CREATE_LIBRARY_BIT_KHR |
298+
VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT)
299+
.LibraryFlags(
300+
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT)
301+
.AddColorBlendAttachment(ColorBlendAttachmentBuilder()
302+
.AlphaBlendMode()
303+
.Create())
304+
.DebugName("libraryNoTex")
305+
.Create(device.get());
306+
307+
pipelineNoTex = GraphicsPipelineBuilder()
308+
.Flags(VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT)
309+
.AddLibrary(libraryNoTex.get())
310+
.AddLibrary(libraryBlend.get())
311+
.DebugName("pipelineNoTex")
312+
.Create(device.get());
313+
}
314+
else
315+
{
316+
pipelineNoTex = GraphicsPipelineBuilder()
317+
.RenderPass(renderPass.get())
318+
.Layout(pipelineLayoutNoTex.get())
319+
.AddVertexBufferBinding(0, sizeof(Vertex))
320+
.AddVertexAttribute(0, 0, VK_FORMAT_R32G32B32_SFLOAT, offsetof(Vertex, x))
321+
.AddVertexAttribute(1, 0, VK_FORMAT_R32G32_SFLOAT, offsetof(Vertex, u))
322+
.AddVertexAttribute(2, 0, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, r))
323+
.AddVertexShader(vertexShader.get())
324+
.AddFragmentShader(fragmentShaderNoTex.get())
325+
.AddDynamicState(VK_DYNAMIC_STATE_VIEWPORT)
326+
.AddDynamicState(VK_DYNAMIC_STATE_SCISSOR)
327+
.DebugName("pipelineNoTex")
328+
.Create(device.get());
329+
}
278330

279-
auto pipelineTextured = GraphicsPipelineBuilder()
331+
pipelineTextured = GraphicsPipelineBuilder()
280332
.RenderPass(renderPass.get())
281333
.Layout(pipelineLayoutTextured.get())
282334
.AddVertexBufferBinding(0, sizeof(Vertex))

include/zvulkan/vulkanbuilders.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -401,28 +401,36 @@ class GraphicsPipelineBuilder
401401

402402
GraphicsPipelineBuilder& PolygonMode(VkPolygonMode mode) {rasterizer.polygonMode = mode; return *this;};
403403

404+
GraphicsPipelineBuilder& Flags(VkPipelineCreateFlags flags);
405+
GraphicsPipelineBuilder& LibraryFlags(VkGraphicsPipelineLibraryFlagsEXT flags);
406+
GraphicsPipelineBuilder& AddLibrary(VulkanPipeline* pipeline);
407+
404408
GraphicsPipelineBuilder& DebugName(const char* name) { debugName = name; return *this; }
405409

406410
std::unique_ptr<VulkanPipeline> Create(VulkanDevice *device);
407411

408412
private:
409-
VkGraphicsPipelineCreateInfo pipelineInfo = { };
410-
VkPipelineVertexInputStateCreateInfo vertexInputInfo = { };
411-
VkPipelineInputAssemblyStateCreateInfo inputAssembly = { };
413+
VkGraphicsPipelineCreateInfo pipelineInfo = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
414+
VkPipelineVertexInputStateCreateInfo vertexInputInfo = { VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO };
415+
VkPipelineInputAssemblyStateCreateInfo inputAssembly = { VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO };
412416
VkViewport viewport = { };
413417
VkRect2D scissor = { };
414-
VkPipelineViewportStateCreateInfo viewportState = { };
415-
VkPipelineRasterizationStateCreateInfo rasterizer = { };
416-
VkPipelineMultisampleStateCreateInfo multisampling = { };
417-
VkPipelineColorBlendStateCreateInfo colorBlending = { };
418-
VkPipelineDepthStencilStateCreateInfo depthStencil = { };
419-
VkPipelineDynamicStateCreateInfo dynamicState = {};
418+
VkPipelineViewportStateCreateInfo viewportState = { VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO };
419+
VkPipelineRasterizationStateCreateInfo rasterizer = { VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO };
420+
VkPipelineMultisampleStateCreateInfo multisampling = { VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO };
421+
VkPipelineColorBlendStateCreateInfo colorBlending = { VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO };
422+
VkPipelineDepthStencilStateCreateInfo depthStencil = { VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO };
423+
VkPipelineDynamicStateCreateInfo dynamicState = { VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO };
424+
425+
VkPipelineLibraryCreateInfoKHR libraryCreate = { VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR };
426+
VkGraphicsPipelineLibraryCreateInfoEXT pipelineLibrary = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT };
420427

421428
std::vector<VkPipelineShaderStageCreateInfo> shaderStages;
422429
std::vector<VkPipelineColorBlendAttachmentState> colorBlendAttachments;
423430
std::vector<VkVertexInputBindingDescription> vertexInputBindings;
424431
std::vector<VkVertexInputAttributeDescription> vertexInputAttributes;
425432
std::vector<VkDynamicState> dynamicStates;
433+
std::vector<VkPipeline> libraries;
426434

427435
struct ShaderSpecialization
428436
{

include/zvulkan/vulkaninstance.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class VulkanDeviceFeatures
2929
VkPhysicalDeviceRayQueryFeaturesKHR RayQuery = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR };
3030
VkPhysicalDeviceDescriptorIndexingFeatures DescriptorIndexing = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT };
3131
VkPhysicalDeviceFaultFeaturesEXT Fault = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT };
32+
VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT GraphicsPipelineLibrary = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT };
3233
};
3334

3435
class VulkanDeviceProperties
@@ -39,6 +40,7 @@ class VulkanDeviceProperties
3940
VkPhysicalDeviceAccelerationStructurePropertiesKHR AccelerationStructure = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_PROPERTIES_KHR };
4041
VkPhysicalDeviceDescriptorIndexingProperties DescriptorIndexing = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES_EXT };
4142
VkPhysicalDeviceLayeredDriverPropertiesMSFT LayeredDriver = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LAYERED_DRIVER_PROPERTIES_MSFT };
43+
VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT GraphicsPipelineLibrary = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT };
4244
};
4345

4446
class VulkanPhysicalDevice

src/vulkanbuilders.cpp

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,6 @@ ColorBlendAttachmentBuilder& ColorBlendAttachmentBuilder::BlendMode(VkBlendOp op
892892

893893
GraphicsPipelineBuilder::GraphicsPipelineBuilder()
894894
{
895-
pipelineInfo.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
896895
pipelineInfo.pVertexInputState = &vertexInputInfo;
897896
pipelineInfo.pInputAssemblyState = &inputAssembly;
898897
pipelineInfo.pViewportState = &viewportState;
@@ -905,23 +904,19 @@ GraphicsPipelineBuilder::GraphicsPipelineBuilder()
905904
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
906905
pipelineInfo.basePipelineIndex = -1;
907906

908-
vertexInputInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
909907
vertexInputInfo.vertexBindingDescriptionCount = 0;
910908
vertexInputInfo.pVertexBindingDescriptions = nullptr;
911909
vertexInputInfo.vertexAttributeDescriptionCount = 0;
912910
vertexInputInfo.pVertexAttributeDescriptions = nullptr;
913911

914-
inputAssembly.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
915912
inputAssembly.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
916913
inputAssembly.primitiveRestartEnable = VK_FALSE;
917914

918-
viewportState.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
919915
viewportState.viewportCount = 1;
920916
viewportState.pViewports = &viewport;
921917
viewportState.scissorCount = 1;
922918
viewportState.pScissors = &scissor;
923919

924-
depthStencil.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
925920
depthStencil.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
926921
depthStencil.depthBoundsTestEnable = VK_FALSE;
927922
depthStencil.minDepthBounds = 0.0f;
@@ -930,7 +925,6 @@ GraphicsPipelineBuilder::GraphicsPipelineBuilder()
930925
depthStencil.front = {};
931926
depthStencil.back = {};
932927

933-
rasterizer.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
934928
rasterizer.depthClampEnable = VK_FALSE;
935929
rasterizer.rasterizerDiscardEnable = VK_FALSE;
936930
rasterizer.polygonMode = VK_POLYGON_MODE_FILL;
@@ -942,23 +936,37 @@ GraphicsPipelineBuilder::GraphicsPipelineBuilder()
942936
rasterizer.depthBiasClamp = 0.0f;
943937
rasterizer.depthBiasSlopeFactor = 0.0f;
944938

945-
multisampling.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
946939
multisampling.sampleShadingEnable = VK_FALSE;
947940
multisampling.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
948941
multisampling.minSampleShading = 1.0f;
949942
multisampling.pSampleMask = nullptr;
950943
multisampling.alphaToCoverageEnable = VK_FALSE;
951944
multisampling.alphaToOneEnable = VK_FALSE;
952945

953-
colorBlending.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
954946
colorBlending.logicOpEnable = VK_FALSE;
955947
colorBlending.logicOp = VK_LOGIC_OP_COPY;
956948
colorBlending.blendConstants[0] = 0.0f;
957949
colorBlending.blendConstants[1] = 0.0f;
958950
colorBlending.blendConstants[2] = 0.0f;
959951
colorBlending.blendConstants[3] = 0.0f;
952+
}
953+
954+
GraphicsPipelineBuilder& GraphicsPipelineBuilder::AddLibrary(VulkanPipeline* pipeline)
955+
{
956+
libraries.push_back(pipeline->pipeline);
957+
return *this;
958+
}
960959

961-
dynamicState.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
960+
GraphicsPipelineBuilder& GraphicsPipelineBuilder::Flags(VkPipelineCreateFlags flags)
961+
{
962+
pipelineInfo.flags = flags;
963+
return *this;
964+
}
965+
966+
GraphicsPipelineBuilder& GraphicsPipelineBuilder::LibraryFlags(VkGraphicsPipelineLibraryFlagsEXT flags)
967+
{
968+
pipelineLibrary.flags = flags;
969+
return *this;
962970
}
963971

964972
GraphicsPipelineBuilder& GraphicsPipelineBuilder::RasterizationSamples(VkSampleCountFlagBits samples)
@@ -1191,6 +1199,29 @@ std::unique_ptr<VulkanPipeline> GraphicsPipelineBuilder::Create(VulkanDevice* de
11911199
colorBlending.pAttachments = colorBlendAttachments.data();
11921200
colorBlending.attachmentCount = (uint32_t)colorBlendAttachments.size();
11931201

1202+
if (!libraries.empty())
1203+
{
1204+
auto flags = pipelineInfo.flags;
1205+
pipelineInfo = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
1206+
pipelineInfo.flags = flags;
1207+
libraryCreate.libraryCount = (uint32_t)libraries.size();
1208+
libraryCreate.pLibraries = libraries.data();
1209+
}
1210+
1211+
const void** ppNext = &pipelineInfo.pNext;
1212+
1213+
if (libraryCreate.libraryCount > 0 && device->SupportsExtension(VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME))
1214+
{
1215+
*ppNext = &libraryCreate;
1216+
ppNext = &libraryCreate.pNext;
1217+
}
1218+
1219+
if (pipelineLibrary.flags != 0 && device->SupportsExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
1220+
{
1221+
*ppNext = &pipelineLibrary;
1222+
ppNext = &pipelineLibrary.pNext;
1223+
}
1224+
11941225
VkPipeline pipeline = 0;
11951226
VkResult result = vkCreateGraphicsPipelines(device->device, cache ? cache->cache : VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &pipeline);
11961227
device->CheckVulkanError(result, "Could not create graphics pipeline");
@@ -1721,6 +1752,10 @@ VulkanDeviceBuilder::VulkanDeviceBuilder()
17211752

17221753
// Extensions desired for debugging
17231754
OptionalExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME);
1755+
1756+
// For pipeline building
1757+
OptionalExtension(VK_KHR_PIPELINE_LIBRARY_EXTENSION_NAME);
1758+
OptionalExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME);
17241759
}
17251760

17261761
VulkanDeviceBuilder& VulkanDeviceBuilder::RequireExtension(const std::string& extensionName)
@@ -1823,6 +1858,7 @@ std::vector<VulkanCompatibleDevice> VulkanDeviceBuilder::FindDevices(const std::
18231858
enabledFeatures.DescriptorIndexing.descriptorBindingVariableDescriptorCount = deviceFeatures.DescriptorIndexing.descriptorBindingVariableDescriptorCount;
18241859
enabledFeatures.DescriptorIndexing.shaderSampledImageArrayNonUniformIndexing = deviceFeatures.DescriptorIndexing.shaderSampledImageArrayNonUniformIndexing;
18251860
enabledFeatures.Fault.deviceFault = deviceFeatures.Fault.deviceFault;
1861+
enabledFeatures.GraphicsPipelineLibrary.graphicsPipelineLibrary = deviceFeatures.GraphicsPipelineLibrary.graphicsPipelineLibrary;
18261862

18271863
// Figure out which queue can present
18281864
if (surface)

src/vulkandevice.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ void VulkanDevice::CreateDevice()
141141
*next = &EnabledFeatures.Fault;
142142
next = &EnabledFeatures.Fault.pNext;
143143
}
144+
if (SupportsExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
145+
{
146+
*next = &EnabledFeatures.GraphicsPipelineLibrary;
147+
next = &EnabledFeatures.GraphicsPipelineLibrary.pNext;
148+
}
144149

145150
VkResult result = vkCreateDevice(PhysicalDevice.Device, &deviceCreateInfo, nullptr, &device);
146151
CheckVulkanError(result, "Could not create vulkan device");

src/vulkaninstance.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,18 @@ std::vector<VulkanPhysicalDevice> VulkanInstance::GetPhysicalDevices(VkInstance
267267
*next = &dev.Properties.LayeredDriver;
268268
next = &dev.Properties.LayeredDriver.pNext;
269269
}
270+
if (checkForExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
271+
{
272+
*next = &dev.Properties.GraphicsPipelineLibrary;
273+
next = &dev.Properties.GraphicsPipelineLibrary.pNext;
274+
}
270275

271276
vkGetPhysicalDeviceProperties2(dev.Device, &deviceProperties2);
272277
dev.Properties.Properties = deviceProperties2.properties;
273278
dev.Properties.AccelerationStructure.pNext = nullptr;
274279
dev.Properties.DescriptorIndexing.pNext = nullptr;
275280
dev.Properties.LayeredDriver.pNext = nullptr;
281+
dev.Properties.GraphicsPipelineLibrary.pNext = nullptr;
276282

277283
VkPhysicalDeviceFeatures2 deviceFeatures2 = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 };
278284

@@ -302,6 +308,11 @@ std::vector<VulkanPhysicalDevice> VulkanInstance::GetPhysicalDevices(VkInstance
302308
*next = &dev.Features.Fault;
303309
next = &dev.Features.Fault.pNext;
304310
}
311+
if (checkForExtension(VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME))
312+
{
313+
*next = &dev.Features.GraphicsPipelineLibrary;
314+
next = &dev.Features.GraphicsPipelineLibrary.pNext;
315+
}
305316

306317
vkGetPhysicalDeviceFeatures2(dev.Device, &deviceFeatures2);
307318
dev.Features.Features = deviceFeatures2.features;
@@ -310,6 +321,7 @@ std::vector<VulkanPhysicalDevice> VulkanInstance::GetPhysicalDevices(VkInstance
310321
dev.Features.RayQuery.pNext = nullptr;
311322
dev.Features.DescriptorIndexing.pNext = nullptr;
312323
dev.Features.Fault.pNext = nullptr;
324+
dev.Features.GraphicsPipelineLibrary.pNext = nullptr;
313325
}
314326
else
315327
{

0 commit comments

Comments
 (0)