Closed Bug 1325113 Opened 7 years ago Closed 7 years ago

Implement WEBGL_compressed_texture_s3tc_srgb

Categories

(Core :: Graphics: CanvasWebGL, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: jujjyl, Assigned: svargas)

Details

(Keywords: dev-doc-complete, Whiteboard: [gfx-noted])

Attachments

(1 file, 1 obsolete file)

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.
Version: 50 Branch → Trunk
Priority: -- → P3
Whiteboard: [gfx-noted]
This is the corresponding Chromium bug and discussion:

https://bugs.chromium.org/p/chromium/issues/detail?id=630498
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-
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+
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
https://hg.mozilla.org/mozilla-central/rev/b693eb4b9ef6
Status: NEW → RESOLVED
Closed: 7 years ago
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.

Attachment

General

Created:
Updated:
Size: