WebGL2: account for the fact that SRGB formats break the 1:1 mapping between sized formats and (unsized format, type) pairs

RESOLVED FIXED in mozilla35

Status

()

Core
Canvas: WebGL
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: bjacob, Assigned: bjacob)

Tracking

Other Branch
mozilla35
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Created attachment 8503369 [details] [diff] [review]
fix-srgb

This is a big difference between WebGL 1 + EXT_sRGB, and WebGL2.

The unsized format for SRGB formats is standard RGB/RGBA in WebGL2, whereas WebGL1 + EXT_sRGB had custom SRGB and SRGB_ALPHA constants for that.

I see that mostly as a quirk of the image-specification API and would rather not break the 1:1 nature of the table we use internally. Rather, it's an exception to ordinary image-specification validation rules.

This unearthed an issue with ValidateTexImage: it wasn't clear whether its internalFormat parameter was sized or unsized. That depended on the 'func' parameter. With this patch, it's now unambiguously sized, and this function internally queries the unsized format value when it needs to.
Attachment #8503369 - Flags: review?(jgilbert)
(Assignee)

Updated

4 years ago
Assignee: nobody → bjacob
(Assignee)

Comment 1

4 years ago
Fixed the WebGL conformance test for this. The patch here is what it takes to pass the fixed conformance test.

https://github.com/KhronosGroup/WebGL/pull/745
Attachment #8503369 - Flags: review?(jgilbert) → review+
https://hg.mozilla.org/mozilla-central/rev/27fdae08d9d8
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.