Giter Club home page Giter Club logo

Comments (6)

xtexChooser avatar xtexChooser commented on May 23, 2024

See VmaAllocatorCreateInfo#367: long pVulkanFunctions = memGetAddress(struct + VmaAllocatorCreateInfo.PVULKANFUNCTIONS);

from engine.

xtexChooser avatar xtexChooser commented on May 23, 2024

这是一个暂时性的修复:

 .../graphics/vulkan/VulkanMemoryAllocator.java     | 22 +++++++++++++++++++++-
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/graphics/src/main/java/engine/graphics/vulkan/VulkanMemoryAllocator.java b/graphics/src/main/java/engine/graphics/vulkan/VulkanMemoryAllocator.java
index 3da57c7..b238a13 100644
--- a/graphics/src/main/java/engine/graphics/vulkan/VulkanMemoryAllocator.java
+++ b/graphics/src/main/java/engine/graphics/vulkan/VulkanMemoryAllocator.java
@@ -6,6 +6,8 @@ import org.lwjgl.system.MemoryStack;
 import org.lwjgl.util.vma.Vma;
 import org.lwjgl.util.vma.VmaAllocationCreateInfo;
 import org.lwjgl.util.vma.VmaAllocatorCreateInfo;
+import org.lwjgl.util.vma.VmaVulkanFunctions;
+import org.lwjgl.vulkan.VK;
 import org.lwjgl.vulkan.VK10;
 import org.lwjgl.vulkan.VkBufferCreateInfo;
 
@@ -28,7 +30,25 @@ public class VulkanMemoryAllocator {
         try(var stack = MemoryStack.stackPush()){
             var info = VmaAllocatorCreateInfo.callocStack(stack)
                     .physicalDevice(device.getPhysicalDevice().getNativePhysicalDevice())
-                    .device(device.getNativeDevice());
+                    .device(device.getNativeDevice())
+                    .pVulkanFunctions(VmaVulkanFunctions.callocStack(stack)
+                            .vkGetPhysicalDeviceProperties(VK10.vkGetInstanceProcAddr(device.getNativeDevice().getPhysicalDevice().getInstance(), stack.ASCII("vkGetPhysicalDeviceProperties")))
+                            .vkGetPhysicalDeviceMemoryProperties(VK10.vkGetInstanceProcAddr(device.getNativeDevice().getPhysicalDevice().getInstance(),stack.ASCII("vkGetPhysicalDeviceMemoryProperties")))
+                            .vkAllocateMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkAllocateMemory")))
+                            .vkFreeMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkFreeMemory")))
+                            .vkMapMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkMapMemory")))
+                            .vkUnmapMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkUnmapMemory")))
+                            .vkFlushMappedMemoryRanges(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkFlushMappedMemoryRanges")))
+                            .vkInvalidateMappedMemoryRanges(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkInvalidateMappedMemoryRanges")))
+                            .vkBindBufferMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkBindBufferMemory")))
+                            .vkBindImageMemory(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkBindImageMemory")))
+                            .vkGetBufferMemoryRequirements(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkGetBufferMemoryRequirements")))
+                            .vkGetImageMemoryRequirements(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkGetImageMemoryRequirements")))
+                            .vkCreateBuffer(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkCreateBuffer")))
+                            .vkDestroyBuffer(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkDestroyBuffer")))
+                            .vkCreateImage(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkCreateImage")))
+                            .vkDestroyImage(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkDestroyImage")))
+                            .vkCmdCopyBuffer(VK10.vkGetDeviceProcAddr(device.getNativeDevice(),stack.ASCII("vkCmdCopyBuffer"))));
             var ptr = stack.mallocPointer(1);
             var err = Vma.vmaCreateAllocator(info, ptr);
             if(err != VK_SUCCESS){

@mouse0w0
没有直接提交是因为:(*****************)

[20:41:56] [Engine/main] [ERROR]: Queue from QueueFamily#0 out of bound. size: 0 index: 0
java.lang.IllegalArgumentException: Queue from QueueFamily#0 out of bound. size: 0 index: 0
        at engine.graphics.vulkan.device.LogicalDevice.getQueue(LogicalDevice.java:95)
        at engine.graphics.vulkan.VKGraphicsBackend.initVulkan(VKGraphicsBackend.java:222)
        at engine.graphics.vulkan.VKGraphicsBackend.init(VKGraphicsBackend.java:170)
        at engine.graphics.GraphicsEngine.start(GraphicsEngine.java:64)
        at engine.graphics.EngineGraphicsManager.initialize(EngineGraphicsManager.java:118)
        at engine.graphics.EngineGraphicsManager.<init>(EngineGraphicsManager.java:64)
        at engine.client.EngineClientImpl.resourceStage(EngineClientImpl.java:147)
        at engine.EngineBase.initEngine(EngineBase.java:102)
        at engine.client.launch.Bootstrap.main(Bootstrap.java:22)
[20:41:56] [Engine/main] [ERROR]: Generated crash report file at F:\Project\UnknownDomainGames\PanguEngine\client\run\crashreport\Crash_2022-01-14_20-41-56_CLIENT.txt.

from engine.

mouse0w0 avatar mouse0w0 commented on May 23, 2024

这咋整啊

from engine.

xtexChooser avatar xtexChooser commented on May 23, 2024

这咋整啊

修啊((((

from engine.

mouse0w0 avatar mouse0w0 commented on May 23, 2024

Vulkan实现的维护者是@cvrunmin,现在这个光荣的任务就交给你们了。

from engine.

enesaltinkaya avatar enesaltinkaya commented on May 23, 2024
        VmaAllocatorCreateInfo allocatorInfo = VmaAllocatorCreateInfo.calloc();
        allocatorInfo.physicalDevice(_chosenGPU);
        allocatorInfo.device(_device);
        allocatorInfo.instance(_instance);

        VmaVulkanFunctions vmaVulkanFunctions = VmaVulkanFunctions.calloc().set(_instance, _device);
        allocatorInfo.pVulkanFunctions(vmaVulkanFunctions);

I think you need those last 2 lines of code.

from engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.