Skip to content
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

Collection of issues #6

Open
feliwir opened this issue Sep 30, 2021 · 3 comments
Open

Collection of issues #6

feliwir opened this issue Sep 30, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@feliwir
Copy link

feliwir commented Sep 30, 2021

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

  • 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
  • SDLwindow should be set to hidden / invisible to increase performance / startup time
  • Image is flipped after download from GPU and stored flipped inside the KTX file
@feliwir feliwir changed the title Errors i've found: Collection of issues Sep 30, 2021
@darksylinc
Copy link
Owner

darksylinc commented Sep 30, 2021

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 darksylinc added the bug Something isn't working label Sep 30, 2021
darksylinc added a commit that referenced this issue Sep 30, 2021
@darksylinc
Copy link
Owner

darksylinc commented Sep 30, 2021

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
Copy link
Author

feliwir commented Oct 1, 2021

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants