34#include "../../VulkanGraphics/Headers/VulkanDevice.h"
35#include <NDEVR/Pointer.h>
45 class VULKAN_COMPUTE_API VulkanComputeDevice
49 ~VulkanComputeDevice();
64 VkDevice
device()
const {
return m_device->device(); }
113 void discoverComputeQueue();
115 void createComputeCommandPool();
119 VkQueue m_compute_queue = VK_NULL_HANDLE;
120 VkCommandPool m_compute_command_pool = VK_NULL_HANDLE;
121 mutable VkCommandBuffer m_batch_cmd = VK_NULL_HANDLE;
122 uint04 m_compute_family_index = Constant<uint04>::Invalid;
123 bool m_is_dedicated_compute =
false;
The equivelent of std::vector but with a bit more control.
Provides a constant, unmodifiable pointer that has shared ownership of a dynamically allocated object...
void resetComputeCommandBuffer(VkCommandBuffer cmd) const
Reset a previously submitted (or freshly allocated) command buffer and begin recording.
void submitComputeCommands(VkCommandBuffer cmd) const
End and submit a command buffer without waiting or freeing.
bool hasDedicatedComputeQueue() const
Whether the compute queue is dedicated (not the graphics queue).
void endTransferBatch() const
End the transfer batch: submit the batched command buffer and wait for completion.
VkCommandBuffer beginComputeCommands() const
Allocate and begin a one-time-use compute command buffer.
void endComputeCommands(VkCommandBuffer cmd, bool wait_for_completion) const
End, submit, and optionally wait for a compute command buffer.
VkQueue computeQueue() const
Get the compute queue.
void beginTransferBatch() const
Begin a transfer batch.
uint04 computeFamilyIndex() const
Index of the compute queue family.
VkCommandBuffer batchCommandBuffer() const
Returns the active batch command buffer, or VK_NULL_HANDLE if no batch is active.
VkDevice device() const
Get the VkDevice handle.
Buffer< VkCommandBuffer > allocateComputeCommandBuffers(uint04 count) const
Allocate a batch of command buffers in a single Vulkan call.
VkCommandPool computeCommandPool() const
Get the compute command pool.
const ConstPointer< VulkanDevice > & vulkanDevice() const
Access the underlying VulkanDevice.
void waitComputeQueue() const
Block until all work on the compute queue has completed.
void freeComputeCommandBuffers(const Buffer< VkCommandBuffer > &cmds) const
Free a batch of command buffers.
uint04 findMemoryType(uint04 type_filter, uint04 properties) const
Find a memory type index matching the given filter and properties.
bool supportsCompute() const
Whether this device has a usable compute queue.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...