29 const VkCommandBuffer* data()
const {
return &_commandBuffer; }
30 operator VkCommandBuffer()
const {
return _commandBuffer; }
31 VkCommandBuffer vk()
const {
return _commandBuffer; }
33 std::atomic_uint& numDependentSubmissions() {
return _numDependentSubmissions; }
35 const uint32_t deviceID;
37 Mask traversalMask = MASK_ALL;
38 Mask overrideMask = MASK_OFF;
41 VkCommandBufferLevel level()
const {
return _level; }
46 Device* getDevice() {
return _device; }
47 const Device* getDevice()
const {
return _device; }
49 CommandPool* getCommandPool() {
return _commandPool; }
50 const CommandPool* getCommandPool()
const {
return _commandPool; }
52 void setCurrentPipelineLayout(
const PipelineLayout* pipelineLayout)
54 _currentPipelineLayout = pipelineLayout->vk(deviceID);
55 if (pipelineLayout->pushConstantRanges.empty())
56 _currentPushConstantStageFlags = 0;
58 _currentPushConstantStageFlags = pipelineLayout->pushConstantRanges.front().stageFlags;
61 VkPipelineLayout getCurrentPipelineLayout()
const {
return _currentPipelineLayout; }
62 VkShaderStageFlags getCurrentPushConstantStageFlags()
const {
return _currentPushConstantStageFlags; }
64 ref_ptr<ScratchMemory> scratchMemory;
68 CommandBuffer(CommandPool* commandPool, VkCommandBuffer commandBuffer, VkCommandBufferLevel level);
70 virtual ~CommandBuffer();
72 VkCommandBuffer _commandBuffer;
73 VkCommandBufferLevel _level;
75 std::atomic_uint _numDependentSubmissions{0};
76 ref_ptr<Device> _device;
77 ref_ptr<CommandPool> _commandPool;
78 VkPipelineLayout _currentPipelineLayout;
79 VkShaderStageFlags _currentPushConstantStageFlags;