#pragma once #include #include "dxvk_lifetime.h" namespace dxvk { /** * \brief DXVK command list * * Stores a command buffer that a context can use to record Vulkan * commands. The command list shall also reference the resources * used by the recorded commands for automatic lifetime tracking. * When the command list has completed execution, resources that * are no longer used may get destroyed. */ class DxvkCommandList : public RcObject { public: DxvkCommandList( const Rc& vkd, uint32_t queueFamily); ~DxvkCommandList(); /** * \brief Command buffer handle * \returns Command buffer handle */ VkCommandBuffer handle() const { return m_buffer; } void beginRecording(); void endRecording(); /** * \brief Adds a resource to track * * Adds a resource to the internal resource tracker. * Resources will be kept alive and "in use" until * the device can guarantee that the submission has * completed. */ void trackResource( const Rc& rc); /** * \brief Resets the command list * * Resets the internal command buffer of the command list and * marks all tracked resources as unused. When submitting the * command list to the device, this method will be called once * the command list completes execution. */ void reset(); private: Rc m_vkd; VkCommandPool m_pool; VkCommandBuffer m_buffer; DxvkLifetimeTracker m_resources; }; }