云风
云风
我在我的 linux 系统上倒是可以运行起来,但是在这一步出错: ``` [2024-05-17 08:05:51.18][ERROR]( ant.resource_manager|resource ) compile failed: /home/cloud/ant/pkg/ant.resources.test/sky/colorcube2x2.texture ---------------------------- 3rd/bimg/src/image.cpp(5278): ASSERT size == imageSize -> KTX: Image size mismatch 64 (expected 384). ``` @junjie020 这个 colorcube2x2.ktx 文件你是怎么制作的?有可能在...
colorcube2x2.ktx 这个文件看起来不符合标准,见 https://github.com/bkaradzic/bimg/pull/63 。 > The exception is non-array cubemap textures (any texture where numberOfFaces is 6 and numberOfArrayElements is 0). For these textures imageSize is the number of bytes...
去掉这个检查后,我在 linux 上遇到了同样的问题,接下来再看看具体为什么。 ``` 3rd/bgfx/src/renderer_vk.cpp(3848): ASSERT texture.m_currentImageLayout == texture.m_sampledLayout -> Mismatching image layout. Texture currently used as a framebuffer attachment? Fatal error at 3rd/bgfx/src/renderer_vk.cpp(3848): [DebugCheck] Mismatching image layout. Texture currently...
我查了一下,这里 `texture.m_currentImageLayout` 的值为 `VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL` ,它应该是 `VK_IMAGE_LAYOUT_GENERAL` 。是在 https://github.com/bkaradzic/bgfx/blob/master/src/renderer_vk.cpp#L2878 这行被改的。 即 assert 里描述的,这个 texture 被当作 framebuffer attachment 使用了。 调用栈: ``` #6 0x0000555555e275ed in bgfx::vk::RendererContextVK::getDescriptorSet ( this=0x7fffedbb2010, program=..., renderBind=..., scratchBuffer=..., _palette=0x7fffd6510940) at...
是这样的。这个是用来设新的 frame buffer ,设置新的就恢复旧的。 现在出错是在 submit() 里(同一次调用): https://github.com/bkaradzic/bgfx/blob/master/src/renderer_vk.cpp#L8315 调用 setFrameBuffer 把里面的 texture current layout 改了 运行到下面 https://github.com/bkaradzic/bgfx/blob/master/src/renderer_vk.cpp#L8771 调用 getDescriptorSet 时,断言 texture 的 current layout 就出错了。 不知道 bgfx vulkan 是不是有什么特殊的约束条件:比如当前 frame...
我把 https://github.com/ejoy/ant/blob/master/pkg/ant.hwi/main.lua#L7 改为 windows = "VULKAN" 后, debug 版本出现了同样的问题。btw, @fangyidong linux 版本这里也应该设置一下正确的 renderer 。 release 版可以运行,但效果不对,模型是黑色的。 奇怪的是,windows 下使用 vulkan 并没有触发 `3rd/bimg/src/image.cpp(5278): ASSERT size == imageSize -> KTX: Image size mismatch...
我猜想 linux 版如果编译 release 也是可以运行的。但是现在编译有点问题: ``` [104/417] Compile C++ build/linux/release/obj/ozz/ozz.obj FAILED: build/linux/release/obj/ozz/ozz.obj gcc -MMD -MT build/linux/release/obj/ozz/ozz.obj -MF build/linux/release/obj/ozz/ozz.obj.d -std=c++20 -O2 -Wall -I./3rd/ozz-animation/include -I./3rd/bee.lua -Iclibs/luabind -Ibuild/linux/release/lua54 -DNDEBUG -o build/linux/release/obj/ozz/ozz.obj -c clibs/ozz/ozz.cpp...
> linux renderer也是VULKAN对吧,这样我在 https://github.com/ejoy/ant/blob/master/pkg/ant.hwi/main.lua#L7 里面加一行就好? > > `linux = "VULKAN",` 理论上是的。因为每个平台都有多套 renderer 可选,如果不设置会让 bgfx 去猜。linux 下除了 vulkan 应该还有 opengl ,目前优先级比较低,所以默认选了 vulkan 。 而我们不打算支持 opengl ,所以 opengl 也没有得到充分测试。明确指定 vulkan 会好一些。btw, 你可以在...
一个渲染帧内处理很多次 resize 好像真没什么意义?
这个具体问题还在查。 bloom 的实现理论上没有问题,问题有可能出在 bgfx 的 vulkan renderer 里。也不只这一个问题。 另外,在 windows 上换用 vulkan renderer 可以完全复现,和 linux 关系不大。