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

Support KTX v2 #782

Open
javifernandez opened this issue Jun 30, 2023 · 3 comments
Open

Support KTX v2 #782

javifernandez opened this issue Jun 30, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@javifernandez
Copy link
Member

javifernandez commented Jun 30, 2023

Is your feature request related to a problem? Please describe.
Some Khronos tools like 'tktx' provide new capabilities to convert different image formats to KTX, However, most of the options and parameters imply generating KTX V2 signatures. Currently Wolvic requires textures in KTX v1.

Describe the solution you'd like

Describe alternatives you've considered
It's still possible to us other conversion tools that enforce KTX v1.

Additional context
KTX v1 spec - https://registry.khronos.org/KTX/specs/1.0/ktxspec.v1.html
KTX v2 spec - https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html

@javifernandez javifernandez added the enhancement New feature or request label Jun 30, 2023
@svillar
Copy link
Member

svillar commented Jun 30, 2023

Where is that dependency in Wolvic? I mean, where is the part in which we require v1? I don't remember having specific code for that...

@javifernandez
Copy link
Member Author

Where is that dependency in Wolvic? I mean, where is the part in which we require v1? I don't remember having specific code for that...

https://github.com/Igalia/vrb/blob/e16bd5dd4842ddad0bb5502969b3d80c048c86e8/android/java/org/mozilla/vrb/ktx/KTXTexture.java#L51

@HollowMan6 HollowMan6 assigned HollowMan6 and unassigned HollowMan6 Sep 22, 2023
@HollowMan6
Copy link
Collaborator

HollowMan6 commented Oct 11, 2023

Tried to implement KTX v2 spec:
470beea4187881fc477bfc45a915b541a374ad7d.patch.txt

https://github.com/HollowMan6/vrb/blob/470beea4187881fc477bfc45a915b541a374ad7d/android/java/org/mozilla/vrb/ktx/KTXTextureV2.java
And then I realized that we actually have several issues if we want to support it here:

  • KTX2 has introduced super compression, so we may want to support those compress schemes, and that can be complicated.
  • KTX2 uses Vulkan VkFormat enum values, and it no longer contains the image size information in levelImages Structure. This means that we will need to have a table that converts VkFormat into glInternalFormat and identify the format-specific number of bytes by ourselves when we read the image data.

So instead of reinventing the wheels, maybe we want to find some library that parses the KTX2 format here.

@HollowMan6 HollowMan6 removed their assignment Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants