google / bigwheels

BigWheels is a cross-platform, API agnostic framework to build graphics applications.
Apache License 2.0
94 stars 37 forks source link

[glTF] Load scenes with UINT8 indices #482

Closed footballhead closed 6 days ago

footballhead commented 5 months ago

Load scenes that contain 8-bit index buffers. How the index buffer ends up being packed depends on the capabilities of the device:

This allows us to load more Khronos glTF-Sample-Assets like TextureCoordinateTest.

image

Fixes #453

Keenuts commented 5 months ago

Seems like the required extension is https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_8bit_storage.html Promoted to core in VK 1.2. BigWheels default is Vulkan1.2, so I'd say we should probably leave the buffer as-is, and request the extension?

footballhead commented 5 months ago

Sg I'll look at adding UINT8 support to Geometry instead

footballhead commented 5 months ago

Actually I'm looking at https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_index_type_uint8.html which I believe is required for VK_INDEX_TYPE_UINT8_KHR. That's what I think I need for UINT8 support in Geometry. I don't see that it's been promoted

Keenuts commented 5 months ago

Ahh right, index buffer, not storage buffer, sorry I missed that! Not promoted, but seems like it's widely supported (>70% on Sasha willems' DB) since it was a VK_EXT_index_type_int8 before.

apazylbe commented 5 months ago

I tried on three devices I have (1 software lavapipe, and 2 android) and they all support VK_EXT_index_type_uint8. According to https://vulkan.gpuinfo.org/listextensions.php support for the extension is at 62%. Would it make sense to support UINT8 through the extension, or perhaps fall back to repacking if it is not available?

footballhead commented 5 months ago

I like the idea of supporting the extension with this as a fallback. I'll look into how to make that happen.

footballhead commented 2 months ago

I've incorporated #515 and #486 into this PR so it should be ready for review

footballhead commented 4 weeks ago

@apazylbe I made some non-trivial changes that I'd like you to review.

footballhead commented 1 week ago

@apazylbe merge conflicts are solved