thatcosmonaut / FNA3D

FNA3D - 3D Graphics Library for FNA
http://fna-xna.github.io/
Other
4 stars 2 forks source link

Require EXT_vertex_attribute_divisor #44

Closed flibitijibibo closed 4 years ago

flibitijibibo commented 4 years ago

For hardware instancing support, we need an additional extension to support the VertexBufferBinding.Divisor property. This extension is safe to require, as all drivers made after August 2018 should have it.

diff --git a/src/FNA3D_Driver_Vulkan.c b/src/FNA3D_Driver_Vulkan.c
index 5f50593..c469ec2 100644
--- a/src/FNA3D_Driver_Vulkan.c
+++ b/src/FNA3D_Driver_Vulkan.c
@@ -8594,7 +8594,8 @@ FNA3D_Device* VULKAN_CreateDevice(
    const char* deviceExtensionNames[] =
    {
        VK_KHR_SWAPCHAIN_EXTENSION_NAME,
-       VK_KHR_MAINTENANCE1_EXTENSION_NAME
+       VK_KHR_MAINTENANCE1_EXTENSION_NAME,
+       VK_EXT_VERTEX_ATTRIBUTE_DIVISOR_EXTENSION_NAME
    };
    uint32_t deviceExtensionCount = SDL_arraysize(deviceExtensionNames);
    VkFormatProperties formatPropsBC1, formatPropsBC2, formatPropsBC3;
thatcosmonaut commented 4 years ago

Applied: https://github.com/thatcosmonaut/FNA3D/commit/6c4d487141fd0625e6111e56c2e1d78494a5ff81