This commit is contained in:
luboslenco
2025-08-22 17:15:49 +02:00
parent e391f3dc5f
commit a77f4ba965
2 changed files with 6 additions and 7 deletions
+4 -5
View File
@@ -1,4 +1,3 @@
#ifndef NDEBUG
#define VALIDATE
#endif
@@ -951,15 +950,15 @@ void gpu_init_internal(int depth_buffer_bits, bool vsync) {
vkGetPhysicalDeviceSurfaceSupportKHR(gpu, graphics_queue_node_index, surface, &surface_supported);
VkSurfaceFormatKHR surf_formats[256];
uint32_t formatCount = sizeof(surf_formats) / sizeof(surf_formats[0]);
VkResult result = vkGetPhysicalDeviceSurfaceFormatsKHR(gpu, surface, &formatCount, surf_formats);
uint32_t format_count = sizeof(surf_formats) / sizeof(surf_formats[0]);
VkResult result = vkGetPhysicalDeviceSurfaceFormatsKHR(gpu, surface, &format_count, surf_formats);
if (formatCount == 1 && surf_formats[0].format == VK_FORMAT_UNDEFINED) {
if (format_count == 1 && surf_formats[0].format == VK_FORMAT_UNDEFINED) {
surface_format = surf_formats[0];
}
else {
bool found = false;
for (uint32_t i = 0; i < formatCount; ++i) {
for (uint32_t i = 0; i < format_count; ++i) {
if (surf_formats[i].format != VK_FORMAT_B8G8R8A8_SRGB) {
surface_format = surf_formats[i];
found = true;
+2 -2
View File
@@ -14,13 +14,13 @@
#define GPU_CLEAR_DEPTH 2
#define GPU_MAX_VERTEX_ELEMENTS 16
#define GPU_MAX_TEXTURES 16
#define GPU_CONSTANT_BUFFER_SIZE 512
#define GPU_CONSTANT_BUFFER_MULTIPLE 2048
#ifdef IRON_ANDROID
#define GPU_FRAMEBUFFER_COUNT 7
#else
#define GPU_FRAMEBUFFER_COUNT 3
#endif
#define GPU_CONSTANT_BUFFER_SIZE 512
#define GPU_CONSTANT_BUFFER_MULTIPLE 2048
typedef enum gpu_texture_state {
GPU_TEXTURE_STATE_SHADER_RESOURCE,