fixes for new d version

This commit is contained in:
Matthew 2026-04-17 14:42:24 +10:00
parent ca41d7e4f4
commit fe318c5f04

View File

@ -419,8 +419,6 @@ enum DescType : VkDescriptorType
DynamicUniform = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC, DynamicUniform = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC,
Storage = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, Storage = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
DynamicStorage = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC, DynamicStorage = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC,
Max,
} }
alias DT = DescType; alias DT = DescType;
@ -2376,11 +2374,9 @@ CreateSampler(Descriptor* desc, MipmapMode mode)
VkCheckA("vkCreateSampler failure", result); VkCheckA("vkCreateSampler failure", result);
} }
bool void
CreateDrawImages() CreateDrawImages()
{ {
bool success = true;
Format draw_format = cast(Format)GetDrawImageFormat(); Format draw_format = cast(Format)GetDrawImageFormat();
Format depth_format = cast(Format)VK_FORMAT_D32_SFLOAT; Format depth_format = cast(Format)VK_FORMAT_D32_SFLOAT;
@ -2389,15 +2385,13 @@ CreateDrawImages()
CreateDescriptor(&g_vk.draw_image, DescInfo(type: DT.StorageImage, format: draw_format, usage: IU.Draw, w: w, h: h, binding: 0)); CreateDescriptor(&g_vk.draw_image, DescInfo(type: DT.StorageImage, format: draw_format, usage: IU.Draw, w: w, h: h, binding: 0));
CreateDescriptor(&g_vk.depth_image, DescInfo(type: DT.Image, format: depth_format, usage: IU.Depth, w: w, h: h, binding: 0)); CreateDescriptor(&g_vk.depth_image, DescInfo(type: DT.Image, format: depth_format, usage: IU.Depth, w: w, h: h, binding: 0));
return success;
} }
bool bool
CreateSwapchain() CreateSwapchain()
{ {
bool success = true; bool success = true;
Arena* arena = &g_vk.frame_arenas[0]; Arena* arena = g_vk.FrameArena();
VkSurfaceCapabilitiesKHR cap; VkSurfaceCapabilitiesKHR cap;
vkGetPhysicalDeviceSurfaceCapabilitiesKHR(g_vk.physical_device, g_vk.surface, &cap); vkGetPhysicalDeviceSurfaceCapabilitiesKHR(g_vk.physical_device, g_vk.surface, &cap);
@ -3168,11 +3162,8 @@ Init(PlatformHandles platform_handles, u64 permanent_mem, u64 frame_mem)
if(success) if(success)
{ {
success = CreateDrawImages(); CreateDrawImages();
}
if(success)
{
Arena* arena = &g_vk.frame_arenas[0]; Arena* arena = &g_vk.frame_arenas[0];
VkSemaphoreCreateInfo sem_info = { sType: VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO }; VkSemaphoreCreateInfo sem_info = { sType: VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO };