-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to running test/simple/main.lua #193
Comments
看
这行信息,应该是几个月前的一个 bug ,早就解决了。问题应该和 bkaradzic/bimg#84 这个有关。我当初在公司的开发群里讨论过。但现在离职,所以没有记录了。 我刚才用 msvc 编译也没有重现。 考虑:
ps. msvc 应该可以在崩了后,立刻 vs attach 上去看。当然,我自己也用的 mingw 。 |
确认了,全部都用 release 去跑,是正常的。 然后在 debug 模式下,把 BX_ASSERT 这行 ASSERT 注释掉,重新编译一下 texturec 也能正常跑(删除了 res 和 .app 目录,用 debug 模式下的 texturec 重新转换)。 if (_imageContainer.m_ktx)
{
const uint32_t size = _imageContainer.m_numLayers == 1 && _imageContainer.m_cubeMap ? mipSize : mipSize * numSides;
uint32_t imageSize = bx::toHostEndian(*(const uint32_t*)&data[offset], _imageContainer.m_ktxLE);
// BX_ASSERT(size == imageSize, "KTX: Image size mismatch %d (expected %d).", size, imageSize);
BX_UNUSED(size, imageSize);
offset += sizeof(uint32_t);
}
} 是不是可以更新一下 colorcube2x2.ktx 这个资源,符合上面的 Image size 的 assert 判断就好啦? |
我好像记得当初在内部群讨论过这个问题,这个 colorcube2x2.ktx 文件似乎有问题。@junjie020 看看当初的聊天记录,最后的结论是? 根据 https://registry.khronos.org/KTX/specs/1.0/ktxspec.v1.html ktx 在保存 cubemap 时,
这个 ktx 文件符合过去版本的 texturec 的 (错误) 校验,但在 bkaradzic/bimg#63 之后,反而出错了。 |
btw, 我觉得 bimg 的工具实现对外部的文件数据输入做 assert 处理也不太对。应该输出 warning 或 error 信息。 |
这个 colorcube2x2.ktx 是用旧版本的 bimg 库生成的,需要使用 bkaradzic/bimg#82 这个 pr 之后的版本重新生成。 生成脚本已经不能正常工作了,我刚才稍微修了一下。但我觉得这个工具还需要完善,尤其是解析命令行的部分(不符合一般习惯):b9ca3ee 生成用的命令行如下:
|
@ylme 可以看看对不对。我本地测试应该是没问题的。 |
变成另一个报错了。
|
问题出在: 7c7f75f image.cpp 里打包 cubemap 时,传错了一个参数:倒数第二个参数应该是 true ,表示是一个 cubemap 。 我比较好奇的是,这并不是新引进的 bug ,但过去似乎也是用这段代码生成 colorcube2x2.ktx 的,为什么没有错 :( |
blame 了一下,发现最初是对的,在 0cf05ec 里把 true 改成了 false 。@junjie020 这是手误还是有其它考虑? |
更新后,可以正常运行 simple 了。 因为 simple 例子就是会在外面显示个天空盒,瞎猜一下,从 这个 issue 是不是可以关闭了? |
$ ./bin/mingw/debug/ant.exe test/simple/main.lua
尝试定位:
$ gdb D:/work/engine/ant/bin/mingw/debug/texturec.exe
(gdb) set args D:/work/engine/ant/bin/mingw/debug/texturec.exe -f D:/work/engine/ant/pkg/ant.resources.test/sky/colorcube2x2.ktx -o D:/work/engine/ant/test/simple/res/windows-direct3d11/texture/colorcube2x2.texture_21a28db096e7137d02daaab46b3bc47f4d3b7d9c/main.dds -q fastest --max 256 --linear -m
(gdb) r
我对图形不怎么了解,求指导一下,出现这种情况如何处理呢?
PS: 还是用 mingw 来玩 ant 了,用 VS 编译出来的 texturec.exe 崩了后完全没有 core dump 文件(用的 debug),不如直接在 gdb 里面看崩的堆栈方便。
The text was updated successfully, but these errors were encountered: