diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp index 7da429830..bf1e2ba5b 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp @@ -1092,14 +1092,24 @@ void GPUContextVulkan::DrawIndexedInstanced(uint32 indicesCount, uint32 instance void GPUContextVulkan::DrawInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs, uint32 drawCount) { - // TODO: implement it - MISSING_CODE("GPUContextVulkan::DrawInstancedIndirect"); + ASSERT(bufferForArgs && bufferForArgs->GetFlags() & GPUBufferFlags::Argument); + + auto bufferForArgsVK = (GPUBufferVulkan*)bufferForArgs; + const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer(); + OnDrawCall(); + vkCmdDrawIndirect(cmdBuffer->GetHandle(), bufferForArgsVK->GetHandle(), (VkDeviceSize)offsetForArgs, drawCount, sizeof(VkDrawIndirectCommand)); + RENDER_STAT_DRAW_CALL(0, 0); } void GPUContextVulkan::DrawIndexedInstancedIndirect(GPUBuffer* bufferForArgs, uint32 offsetForArgs, uint32 drawCount) { - // TODO: implement it - MISSING_CODE("GPUContextVulkan::DrawIndexedInstancedIndirect"); + ASSERT(bufferForArgs && bufferForArgs->GetFlags() & GPUBufferFlags::Argument); + + auto bufferForArgsVK = (GPUBufferVulkan*)bufferForArgs; + const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer(); + OnDrawCall(); + vkCmdDrawIndexedIndirect(cmdBuffer->GetHandle(), bufferForArgsVK->GetHandle(), (VkDeviceSize)offsetForArgs, drawCount, sizeof(VkDrawIndexedIndirectCommand)); + RENDER_STAT_DRAW_CALL(0, 0); } void GPUContextVulkan::SetViewport(const Viewport& viewport) diff --git a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp index 498fd3491..249289c7a 100644 --- a/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp +++ b/Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp @@ -1704,7 +1704,7 @@ bool GPUDeviceVulkan::Init() limits.HasGeometryShaders = false; // TODO: add geometry shaders support for Vulkan limits.HasInstancing = true; limits.HasVolumeTextureRendering = true; - limits.HasDrawIndirect = false; // TODO: add Draw Indirect support for Vulkan + limits.HasDrawIndirect = true; limits.HasAppendConsumeBuffers = false; // TODO: add Append Consume buffers support for Vulkan limits.HasSeparateRenderTargetBlendState = true; limits.HasDepthAsSRV = true;