From 5b2b07944747cbc66351261e2ca23894c965176b Mon Sep 17 00:00:00 2001 From: Rune Date: Mon, 8 Jun 2026 17:42:10 +0200 Subject: [PATCH] compiler bug? --- BeefProj.toml | 4 ++-- BeefSpace.toml | 5 +++-- src/Program.bf | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/BeefProj.toml b/BeefProj.toml index 43d7126..f1b8495 100644 --- a/BeefProj.toml +++ b/BeefProj.toml @@ -7,9 +7,9 @@ StartupObject = "Vulkan.Example.Program" [Dependencies] corlib = "*" -Vulkan = "*" "Glfw.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/Glfw.git"} -VulkanMemoryAllocator = "*" +"VulkanMemoryAllocator.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/VulkanMemoryAllocator.git"} +"Vulkan-Beef.git" = {Git = "https://git.unicon-gmbh.de/Rune/Vulkan-Beef.git"} [Configs.Debug.Win64] PreBuildCmds = ["glslangvalidator -V $(ProjectDir)/src/shader.vert.glsl -o $(ProjectDir)/src/shader.vert.spv", "glslangvalidator -V $(ProjectDir)/src/shader.frag.glsl -o $(ProjectDir)/src/shader.frag.spv"] diff --git a/BeefSpace.toml b/BeefSpace.toml index dfb4629..aa2e6bb 100644 --- a/BeefSpace.toml +++ b/BeefSpace.toml @@ -1,10 +1,11 @@ FileVersion = 1 +Unlocked = ["VulkanMemoryAllocator.git"] [Workspace] StartupProject = "Vulkan.Example" [Projects] "Vulkan.Example" = {Path = "."} -Vulkan = {Path = "../BeefBindings_Vulkan"} "Glfw.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/Glfw.git"} -VulkanMemoryAllocator = {Path = "../../RandomStuff/Cpp2Beef/Bindings/VulkanMemoryAllocator"} +"VulkanMemoryAllocator.git" = {Git = "https://git.unicon-gmbh.de/BeefBindings/VulkanMemoryAllocator.git"} +"Vulkan-Beef.git" = {Git = "https://git.unicon-gmbh.de/Rune/Vulkan-Beef.git"} diff --git a/src/Program.bf b/src/Program.bf index eb4d0ba..e4b48e2 100644 --- a/src/Program.bf +++ b/src/Program.bf @@ -414,13 +414,13 @@ class Program VkBufferCreateInfo* bufferCI = scope .(null, 0, (.)size, .TransferSrc, .Exclusive ); - VkResult result = Vma.CreateBuffer(allocator, bufferCI, scope .() + VkResult result = allocator.CreateBuffer(bufferCI, scope .() { flags = .Mapped | .HostAccessSequentialWrite, usage = .Auto, }, let transferBuffer, let transferBufferAlloc, let transferBufferAllocInfo); CheckResult(result); - defer Vma.DestroyBuffer(allocator, transferBuffer, transferBufferAlloc); + defer allocator.DestroyBuffer(transferBuffer, transferBufferAlloc); Internal.MemCpy(transferBufferAllocInfo.pMappedData, ptr, size); @@ -433,7 +433,7 @@ class Program ); } bufferCI.usage = usage | .TransferDst; - result = Vma.CreateBuffer(allocator, bufferCI, scope .() + result = allocator.CreateBuffer(bufferCI, scope .() { usage = .Auto, }, out buffer, out allocation, ?); @@ -606,7 +606,7 @@ class Program } EmitFill(); - result = Vma.CreateAllocator(scope .() + result = vmaCreateAllocator(scope .() { physicalDevice = physicalDevice.device, device = device, @@ -615,17 +615,17 @@ class Program instance = instance }, out allocator); CheckResult(result); - defer:: Vma.DestroyAllocator(allocator); + defer:: allocator.Destroy(); } { var vertices = vertices; CreateAndPushBuffer(out vertexBuffer, let vertexBufferAllocation, .VertexBuffer, &vertices, sizeof(decltype(vertices))); - defer:: Vma.DestroyBuffer(allocator, vertexBuffer, vertexBufferAllocation); + defer:: allocator.DestroyBuffer(vertexBuffer, vertexBufferAllocation); var indices = indices; CreateAndPushBuffer(out indexBuffer, let indexBufferAllocation, .IndexBuffer, &indices, sizeof(decltype(indices))); - defer:: Vma.DestroyBuffer(allocator, indexBuffer, indexBufferAllocation); + defer:: allocator.DestroyBuffer(indexBuffer, indexBufferAllocation); } {