# HG changeset patch # User sam # Date 1724763204 -25200 # Node ID e6fdd732784712da47d50cead41367424e65c333 # Parent 34832174824b6734c0a73263ff3219b90e57e64b add: option to bind descriptor without pipeline, but only pipeline layout diff -r 34832174824b -r e6fdd7327847 semicongine/rendering/renderer.nim --- a/semicongine/rendering/renderer.nim Mon Aug 26 23:04:50 2024 +0700 +++ b/semicongine/rendering/renderer.nim Tue Aug 27 19:53:24 2024 +0700 @@ -597,19 +597,25 @@ "Incompatible descriptor set types for set number " & $index & " in shader " & name(TShader) +proc bindDescriptorSet*[TDescriptorSet]( + commandBuffer: VkCommandBuffer, + descriptorSet: DescriptorSetData[TDescriptorSet], + index: static DescriptorSetIndex, + layout: VkPipelineLayout, +) = + assert descriptorSet.vk[currentFiF()].Valid, + "DescriptorSetData not initialized, maybe forgot to call initDescriptorSet" + svkCmdBindDescriptorSet(commandBuffer, descriptorSet.vk[currentFiF()], index, layout) + proc bindDescriptorSet*[TDescriptorSet, TShader]( commandBuffer: VkCommandBuffer, descriptorSet: DescriptorSetData[TDescriptorSet], index: static DescriptorSetIndex, pipeline: Pipeline[TShader], ) = - assert descriptorSet.vk[currentFiF()].Valid, - "DescriptorSetData not initialized, maybe forgot to call initDescriptorSet" static: assertCompatibleDescriptorSet(TDescriptorSet, TShader, index) - svkCmdBindDescriptorSet( - commandBuffer, descriptorSet.vk[currentFiF()], index, pipeline.layout - ) + bindDescriptorSet(commandBuffer, descriptorSet, index, pipeline.layout) proc assertCanRenderMesh(TShader, TMesh, TInstance: typedesc) = for attrName, attrValue in default(TShader).fieldPairs: