Last Comment Bug 774134 - Support S3 texture compression with Mesa drivers
: Support S3 texture compression with Mesa drivers
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Canvas: WebGL (show other bugs)
: unspecified
: All Linux
: -- normal (vote)
: mozilla17
Assigned To: Marco Castelluccio [:marco]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-15 17:38 PDT by Marco Castelluccio [:marco]
Modified: 2016-03-18 05:59 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
Patch (1.13 KB, patch)
2012-07-15 18:41 PDT, Marco Castelluccio [:marco]
jacob.benoit.1: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Review

Description Marco Castelluccio [:marco] 2012-07-15 17:38:28 PDT
It's just a matter of setting an environment variable, but I don't know if there's a patent issue here.
Comment 1 Benoit Jacob [:bjacob] (mostly away) 2012-07-15 18:07:48 PDT
oh, so are you saying that enabling s3tc with mesa is just a matter of setting an env var? what would that env var be?

Regarding possible patent issues: from our perspective, this wouldn't be any different from what we do on other platforms i.e. we're just exposing an existing feature through WebGL. It might be trickier for the Mesa team if implementing the OpenGL extension requires more than just transparently exposing a hardware feature --- I absolutely don't know about that. But from our point of view, it's not an issue.
Comment 2 Nicholas Nethercote [:njn] (on vacation until July 11) 2012-07-15 18:25:24 PDT
This was spun off from bug 773445.

There's a test case at http://media.tojicode.com/webgl-samples/dds.html.  Running Firefox normally on my Linux64 box I get a blank red cube.  With |force_s3tc_enable=true| set I see Lena on each edge of the cube.
Comment 3 Marco Castelluccio [:marco] 2012-07-15 18:41:00 PDT
Created attachment 642460 [details] [diff] [review]
Patch
Comment 4 Benoit Jacob [:bjacob] (mostly away) 2012-07-15 19:08:08 PDT
Comment on attachment 642460 [details] [diff] [review]
Patch

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

Yup, that is the right place.
Comment 5 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 08:33:52 PDT
I'm landing it now, but you should really get yourself L3 access :)
Comment 6 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 08:37:19 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/c81fb77dcb08
Comment 7 Vladimir Vukicevic [:vlad] [:vladv] 2012-07-16 09:43:26 PDT
Erm, the DRI web page around it says:

> setting this option to true will expose the extension even though it cannot be fully implemented

what does "cannot be fully implemented" mean, and does it affect what webgl requires?  Are we exposing an incomplete/incompatible S3TC implementation by doing this?
Comment 8 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 09:54:18 PDT
We looked at that yesterday and it seemed (iirc -- Marco could correct) that the non-fully-implemented warning is about lack of support for converting _to_ s3tc. Since that is not exposed by WebGL, not a problem for us.
Comment 9 Marco Castelluccio [:marco] 2012-07-16 09:57:50 PDT
Yes, an external library (libtxc_dxtn) is needed only for compression/decompression, that WebGL doesn't support.
Comment 10 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 10:14:12 PDT
Well, WebGL definitely supports decompression, by which I mean, rendering using a compressed texture. But comment 2 says that that is working fine with that environment variable.
Comment 11 Marco Castelluccio [:marco] 2012-07-16 10:18:09 PDT
(In reply to Benoit Jacob [:bjacob] from comment #10)
> Well, WebGL definitely supports decompression, by which I mean, rendering
> using a compressed texture. But comment 2 says that that is working fine
> with that environment variable.

Yes, I meant "conversion", not "decompression" :)
The external library is only needed for compression and conversion.
The force_s3tc_enable option will enable rendering pre-compressed textures, that is what WebGL needs.
Comment 12 Ed Morley [:emorley] 2012-07-16 11:17:43 PDT
Didn't make it to mozilla-central before the uplift (merge was blocked on bug 774259). Adjusting milestone accordingly.
Comment 13 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 11:39:07 PDT
What, the uplift aleady happened? Thought it was going to be tomorrow. Will have plenty of stuff to approve then... starting by that.
Comment 14 Benoit Jacob [:bjacob] (mostly away) 2012-07-16 11:42:02 PDT
Comment on attachment 642460 [details] [diff] [review]
Patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): not a regression. Just a missing feature for many (over 50%) of linux users
User impact if declined: no serious games on many linux machines; severely decreased performance in BananaBread
Testing completed (on m-c, etc.): just landed
Risk to taking this patch (and alternatives if risky): not risky, just sets an environment variable. Only problem I can foresee if this setting made Mesa crashier but we have no evidence of that, and at least 2 people in this bug tried.
String or UUID changes made by this patch: none
Comment 15 Alex Keybl [:akeybl] 2012-07-16 15:29:41 PDT
Comment on attachment 642460 [details] [diff] [review]
Patch

[Triage Comment]
Approving for Aurora 16. Aurora updates are currently disabled until we receive QA sign-off (or Friday, whichever is later), so the user impact that you describe has not been unleashed on our test audience yet.
Comment 16 Ryan VanderMeulen [:RyanVM] 2012-07-16 17:30:31 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/0add44c303d2
Comment 17 Ed Morley [:emorley] 2012-07-17 02:13:42 PDT
https://hg.mozilla.org/mozilla-central/rev/c81fb77dcb08
Comment 18 Andrea D'Amore 2016-03-18 04:12:18 PDT
I'm seeing this again in 44.0.2 and 45.0b10 on OS X 10.11.3 , the dds example loads only a red cube without texture.
The issue is there even when setting the env variable via:

    env force_s3tc_enable=true /Applications/Firefox.app/Contents/MacOS/firefox


In both cases the console output is:

   The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. dds.html
   Error: WebGL: getExtension('MOZ_WEBGL_compressed_texture_s3tc'): MOZ_ prefixed WebGL extension strings are deprecated. Support for them will be removed in the future. Use unprefixed extension strings. To get draft extensions, set the webgl.enable-draft-extensions preference. gl-util.js:242:23
   Your browser does not support the WEBGL_compressed_texture_s3tc extension dds.html:111:25


Please someone confirm this is happening on other platforms and reopen the ticket.
Comment 19 Marco Castelluccio [:marco] 2016-03-18 04:19:50 PDT
(In reply to Andrea D'Amore from comment #18)
> I'm seeing this again in 44.0.2 and 45.0b10 on OS X 10.11.3 , the dds
> example loads only a red cube without texture.
> The issue is there even when setting the env variable via:
> 
>     env force_s3tc_enable=true
> /Applications/Firefox.app/Contents/MacOS/firefox
> 
> 
> In both cases the console output is:
> 
>    The character encoding of the HTML document was not declared. The
> document will render with garbled text in some browser configurations if the
> document contains characters from outside the US-ASCII range. The character
> encoding of the page must be declared in the document or in the transfer
> protocol. dds.html
>    Error: WebGL: getExtension('MOZ_WEBGL_compressed_texture_s3tc'): MOZ_
> prefixed WebGL extension strings are deprecated. Support for them will be
> removed in the future. Use unprefixed extension strings. To get draft
> extensions, set the webgl.enable-draft-extensions preference.
> gl-util.js:242:23
>    Your browser does not support the WEBGL_compressed_texture_s3tc extension
> dds.html:111:25
> 
> 
> Please someone confirm this is happening on other platforms and reopen the
> ticket.

This is a Linux-specific bug, Mesa doesn't exist on Mac OS.
Could you open a new bug?

The console output you're seeing is strange, since the page (http://media.tojicode.com/webgl-samples/dds.html) is using GLUtil.getExtension(gl, "WEBGL_compressed_texture_s3tc") and not the MOZ_ prefixed extension.
Comment 20 Andrea D'Amore 2016-03-18 05:59:45 PDT
My bad, I'll open a new ticket.

Just FYI I checked this on my debian box and the demo is in fact correctly working on 44.0.2.

Note You need to log in before you can comment on or make changes to this bug.