Comments (6)
See VmaAllocatorCreateInfo#367
: long pVulkanFunctions = memGetAddress(struct + VmaAllocatorCreateInfo.PVULKANFUNCTIONS);
from engine.
这是一个暂时性的修复:
.../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.
这咋整啊
from engine.
这咋整啊
修啊((((
from engine.
Vulkan实现的维护者是@cvrunmin,现在这个光荣的任务就交给你们了。
from engine.
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)
- 顶点数量为0的Mesh被绘制 HOT 1
- OpenGL渲染调用优化 HOT 1
- 透过玻璃能看到位于地下的玻璃 HOT 1
- 使用"GLxxC"类取代"GLxx"
- 删除SortedList
- 移除Guice与@RegObject并使用新注解实现依赖注入
- 自动指定方块与物品模型
- glMapBuffer性能低下 HOT 1
- 优化UniformBlock
- 区块网格面剔除不完全
- ShaderResource频繁绑定
- GUI双精度浮点数布局管理
- GUI独立的事件与布局线程
- 删除代码规范第三条“当方法返回值可能为null时,应使用Optional作为返回值” HOT 1
- 窗口的缩放未正确处理
- 无法正确渲染中文
- [Bug/Build] Graphics dependency leaking to dedicated server HOT 2
- 尝试渲染字体内不存在的字符时抛出NPE
- 区块渲染无法应用截锥剔除 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engine.