yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
f65d756bf
master
1// vk-transient-heap.h 2#pragma once 3 4#include "vk-base.h" 5#include "vk-buffer.h" 6#include "vk-command-buffer.h" 7 8namespace gfx 9{ 10 11using namespace Slang ; 12 13namespace vk 14{ 15 16class TransientResourceHeapImpl 17 :public TransientResourceHeapBaseImpl < DeviceImpl ,BufferResourceImpl > 18{ 19private : 20typedef TransientResourceHeapBaseImpl < DeviceImpl ,BufferResourceImpl > Super ; 21 22public : 23VkCommandPool m_commandPool ; 24DescriptorSetAllocator m_descSetAllocator ; 25List < VkFence > m_fences ; 26Index m_fenceIndex = -1 ; 27List < RefPtr < CommandBufferImpl >>m_commandBufferPool ; 28uint32_t m_commandBufferAllocId = 0 ; 29VkFence getCurrentFence () {return m_fences [m_fenceIndex ]; } 30void advanceFence (); 31 32Result init (const ITransientResourceHeap ::Desc & desc ,DeviceImpl * device ); 33 ~TransientResourceHeapImpl (); 34 35public : 36virtual SLANG_NO_THROW Result SLANG_MCALL 37createCommandBuffer (ICommandBuffer ** outCommandBuffer )override ; 38virtual SLANG_NO_THROW Result SLANG_MCALL synchronizeAndReset ()override ; 39}; 40 41}// namespace vk 42}// namespace gfx