Closed Bug 1081286 Opened 10 years ago Closed 10 years ago

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

Categories

(Core :: Graphics: CanvasWebGL, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: bjacob, Assigned: bjacob)

Details

Attachments

(1 file)

Attached patch fix-srgbSplinter Review
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: nobody → bjacob
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
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: