darksylinc / betsy

Betsy GPU compressor
Other
314 stars 18 forks source link

Collection of issues #6

Open feliwir opened 3 years ago

feliwir commented 3 years ago

Hey, i've forked this project and made some modifications to it. However i wanted to let you know some issues i've found:

darksylinc commented 3 years ago

Hi!

PixelDepth is written as 1. According to ktxinfo from https://github.com/KhronosGroup/KTX-Software this must be 0 for non arrays. Same for numberOfArrayElements

Mmm... you're right. KTX spec says it must be 0. Our implementation is wrong. Sigh, the KTX spec is full of issues.

SDLwindow should be set to hidden / invisible to increase performance / startup time

Could you point where? It can be tricky to get right on all platforms for all vendors. It will need testing and knowing where would save me a lot of time.

Thanks!

Image is flipped after download from GPU and stored flipped inside the KTX file

I've been checking with PVRTexTool and it looks properly oriented. Additionally checking with RenderDoc shows the orientation we store (flipped) is correct.

Cheers

darksylinc commented 3 years ago

This is a capture of a KTX file generated with Betsy on PVRTexTool. Original is here. The orientation is correct.

Screenshot_2021-09-30_20-36-06

feliwir commented 3 years ago

Could you point where? It can be tricky to get right on all platforms for all vendors. It will need testing and knowing where would save me a lot of time.

https://github.com/darksylinc/betsy/blob/master/src/PlatformGL.cpp#L57 You don't have to use SDL_WINDOW_SHOWN here. I used GLFW in my fork (since it's a bit smaller than SDL) and don't show the window. Obviously it feels less buggy when no window pops up for a commandline tool and the window manager has less work to do. With Vulkan we could avoid having a Surface at all. See https://www.glfw.org/docs/3.3/context_guide.html#context_offscreen as a reference (works similarly for SDL)

I've been checking with PVRTexTool and it looks properly oriented. Additionally checking with RenderDoc shows the orientation we store (flipped) is correct.

Maybe i introduced that error in my fork... Will need to double check. Sorry for mentioning this without conforming this first. Another thing i did was compiling the GLSL shaders into the binary and doing the preprocessing at buildtime. If you're interested in any of these changes for upstream let me know! Thanks :)