Skip to content

KTX2Loader: Improve transcoder target format selection #29745

@donmccurdy

Description

@donmccurdy

Description

Related:

As described in the issue above, Firefox may indicate support for compressed formats that it actually emulates in drivers, decompressing or transcoding to another format. This emulation has much higher cost than just transcoding to the 'right' format in KTX2Loader, but we don't necessarily know what the right format is because Firefox doesn't say. We don't have this problem on ANGLE, but currently we are preserving a less-optimal choice of target transcoding format for ANGLE because of the Firefox issue.

Solution

  • Consider detecting the Firefox user agent and adjusting format selection as a special case, if we can do so reliably
    • For Linux+Firefox+RadeonSI we should prefer BCn formats over ETC2 as the target from ETC1S, when both are "supported"
    • For other platforms, is the reverse happening? Would Firefox report BCn support when only ETC2 is actually available?
  • Test major browsers on multiple platforms, check target format selection, and implement unit tests for transcoder target formats if possible (WASM in tests may be tricky...)
  • Consider preferring BC1/3 over BC7 for ETC1S transcoding
  • File an issue with Firefox about the emulated support
  • Fix invalid WebGPU feature detection in KTX2Loader for (non-existent) texture-compression-bptc and texture-compression-etc1

Alternatives

n/a

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions