Browse Source

Allow configuring vulkan renderer max descriptor sets per frame (#3461)

Nuno Silva 3 months ago
parent
commit
735f6233de
2 changed files with 6 additions and 1 deletions
  1. 5 0
      src/config.h
  2. 1 1
      src/renderer_vk.cpp

+ 5 - 0
src/config.h

@@ -170,6 +170,11 @@
 #	define BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER 0
 #endif // BGFX_CONFIG_RENDERER_DIRECT3D11_USE_STAGING_BUFFER
 
+/// Configure the amount of max descriptor sets per frame for Vulkan
+#ifndef BGFX_CONFIG_RENDERER_VULKAN_MAX_DESCRIPTOR_SETS_PER_FRAME
+#	define BGFX_CONFIG_RENDERER_VULKAN_MAX_DESCRIPTOR_SETS_PER_FRAME 1024
+#endif // BGFX_CONFIG_RENDERER_VULKAN_MAX_DESCRIPTOR_SETS_PER_FRAME
+
 /// Enable use of tinystl.
 #ifndef BGFX_CONFIG_USE_TINYSTL
 #	define BGFX_CONFIG_USE_TINYSTL 1

+ 1 - 1
src/renderer_vk.cpp

@@ -1130,7 +1130,7 @@ VK_IMPORT_DEVICE
 			);
 	}
 
-#define MAX_DESCRIPTOR_SETS (1024 * BGFX_CONFIG_MAX_FRAME_LATENCY)
+#define MAX_DESCRIPTOR_SETS (BGFX_CONFIG_RENDERER_VULKAN_MAX_DESCRIPTOR_SETS_PER_FRAME * BGFX_CONFIG_MAX_FRAME_LATENCY)
 
 	struct RendererContextVK : public RendererContextI
 	{