Implement WEBGL_compressed_texture_s3tc_srgb

RESOLVED FIXED in Firefox 55

Status

()

P3
enhancement
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: jujjyl, Assigned: svargas)

Tracking

({dev-doc-complete})

Trunk
mozilla55
dev-doc-complete
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

2 years ago
The new WebGL draft extension WEBGL_compressed_texture_s3tc_srgb adds support for DXTn/S3TC compressed textures in sRGB color space. Draft spec here:

https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/

It would be good to have this extension in Firefox, naturally behind the enable-draft-extensions pref until the draft becomes community approved. This support was asked by folks over at Unity, apparently Chrome already supports it.
(Reporter)

Updated

2 years ago
Version: 50 Branch → Trunk

Updated

2 years ago
Priority: -- → P3
Whiteboard: [gfx-noted]

Comment 1

2 years ago
This is the corresponding Chromium bug and discussion:

https://bugs.chromium.org/p/chromium/issues/detail?id=630498
(Assignee)

Updated

2 years ago
Assignee: nobody → svargas
Comment on attachment 8872795 [details] [diff] [review]
0001-Bug-1325113-Implement-support-for-WEBGL_compressed_t.patch

Review of attachment 8872795 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/canvas/WebGLFormats.cpp
@@ +332,5 @@
> +    // EXT_texture_compression_s3tc_srgb
> +    AddFormatInfo(FOO(COMPRESSED_SRGB_S3TC_DXT1_EXT ), 0, 1,1,1,0, 0,0, UnsizedFormat::RGB , false, ComponentType::NormUInt);
> +    AddFormatInfo(FOO(COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt);
> +    AddFormatInfo(FOO(COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt);
> +    AddFormatInfo(FOO(COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT), 0, 1,1,1,1, 0,0, UnsizedFormat::RGBA, false, ComponentType::NormUInt);

2nd-to-last arg should be `true` not `false`, since this is an SRGB format.

::: dom/webidl/WebGLRenderingContext.webidl
@@ +827,5 @@
> +    const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT  = 0x8C4E;
> +    const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT  = 0x8C4F;
> +};
> +
> +

Just one blank newline here, please!

::: gfx/gl/GLContext.cpp
@@ +149,4 @@
>      "GL_EXT_texture3D",
>      "GL_EXT_texture_compression_dxt1",
>      "GL_EXT_texture_compression_s3tc",
> +    "GL_EXT_texture_compression_s3tc_srgb",

You forgot to remove this.

::: gfx/gl/GLContext.h
@@ +414,4 @@
>          EXT_texture3D,
>          EXT_texture_compression_dxt1,
>          EXT_texture_compression_s3tc,
> +        EXT_texture_compression_s3tc_srgb,

You forgot to remove this.
Attachment #8872795 - Flags: review?(jgilbert) → review-
(Assignee)

Comment 4

2 years ago
Attachment #8872795 - Attachment is obsolete: true
Attachment #8872800 - Flags: review?(jgilbert)
Attachment #8872800 - Flags: review?(jgilbert) → review+
Post the link to a try run for this change before I can land this.
Flags: needinfo?(svargas)
Comment on attachment 8872800 [details] [diff] [review]
0001-Bug-1325113-Implement-support-for-WEBGL_compressed_t.patch

Needs DOM peer review for webidl/bindings changes.
Attachment #8872800 - Flags: review?(kyle)
Attachment #8872800 - Flags: review?(kyle) → review+

Comment 8

2 years ago
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b693eb4b9ef6
Implement support for WEBGL_compressed_texture_s3tc_srgb - r=jgilbert,qdot

Comment 9

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b693eb4b9ef6
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Summary: Implement support for WebGL extension WEBGL_compressed_texture_s3tc_srgb → Implement WEBGL_compressed_texture_s3tc_srgb
You need to log in before you can comment on or make changes to this bug.