From 11d262dc1113606ec594c2d5097ceb0a62db0067 Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Wed, 4 Jan 2023 12:01:26 -0500 Subject: [PATCH] enable multiDrawIndirect feature, add indirect command struct --- include/Refresh.h | 9 +++++++++ src/Refresh_Driver_Vulkan.c | 1 + 2 files changed, 10 insertions(+) diff --git a/include/Refresh.h b/include/Refresh.h index 5ba1825..8a3408b 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -376,6 +376,14 @@ typedef struct Refresh_TextureSlice uint32_t level; } Refresh_TextureSlice; +typedef struct Refresh_IndirectDrawCommand +{ + uint32_t vertexCount; + uint32_t instanceCount; + uint32_t firstVertex; + uint32_t firstInstance; +} Refresh_IndirectDrawCommand; + /* State structures */ typedef struct Refresh_SamplerStateCreateInfo @@ -666,6 +674,7 @@ REFRESHAPI void Refresh_DrawPrimitives( ); /* Similar to Refresh_DrawPrimitives, but draw parameters are set from a buffer. + * The buffer layout should match the layout of Refresh_IndirectDrawCommand. * * buffer: A buffer containing draw parameters. * offsetInBytes: The offset to start reading from the draw buffer. diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 98c45a5..02eafdb 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -10537,6 +10537,7 @@ static uint8_t VULKAN_INTERNAL_CreateLogicalDevice( SDL_zero(deviceFeatures); deviceFeatures.fillModeNonSolid = VK_TRUE; deviceFeatures.samplerAnisotropy = VK_TRUE; + deviceFeatures.multiDrawIndirect = VK_TRUE; /* creating the logical device */