From 67c96c0c4a7312ef7e6601ff97d5f05c5f10ac6f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 6 Sep 2023 13:09:01 +0100 Subject: [PATCH] Added GraphicsPipeline::validate_vk() method to make it possible to query the Vulkan pipeline with add check against the validity of the viewID for that pipeline. --- include/vsg/state/GraphicsPipeline.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/vsg/state/GraphicsPipeline.h b/include/vsg/state/GraphicsPipeline.h index f9323e1e1..b8a7583d2 100644 --- a/include/vsg/state/GraphicsPipeline.h +++ b/include/vsg/state/GraphicsPipeline.h @@ -58,8 +58,12 @@ namespace vsg GraphicsPipeline(PipelineLayout* pipelineLayout, const ShaderStages& shaderStages, const GraphicsPipelineStates& pipelineStates, uint32_t subpass = 0); + /// return the Vukan Pipeline for specified viewID. VkPipeline vk(uint32_t viewID) const { return _implementation[viewID]->_pipeline; } + /// variant of vk(viewID) method that is slower but adds validation of the viewID parameter + VkPipeline validated_vk(uint32_t viewID) const { return (viewID < _implementation.size()) ? (_implementation[viewID] ? _implementation[viewID]->_pipeline : 0) : 0; } + /// VkGraphicsPipelineCreateInfo settings ShaderStages stages; GraphicsPipelineStates pipelineStates;