Closed Bug 774134 Opened 12 years ago Closed 12 years ago

Support S3 texture compression with Mesa drivers

Categories

(Core :: Graphics: CanvasWebGL, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla17
Tracking Status
firefox16 --- fixed

People

(Reporter: marco, Assigned: marco)

Details

Attachments

(1 file)

It's just a matter of setting an environment variable, but I don't know if there's a patent issue here.
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.
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.
Attached patch PatchSplinter Review
Attachment #642460 - Flags: review?(bjacob)
Comment on attachment 642460 [details] [diff] [review]
Patch

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

Yup, that is the right place.
Attachment #642460 - Flags: review?(bjacob) → review+
Keywords: checkin-needed
I'm landing it now, but you should really get yourself L3 access :)
http://hg.mozilla.org/integration/mozilla-inbound/rev/c81fb77dcb08
Assignee: nobody → mar.castelluccio
Target Milestone: --- → mozilla16
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?
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.
Yes, an external library (libtxc_dxtn) is needed only for compression/decompression, that WebGL doesn't support.
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.
(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.
Didn't make it to mozilla-central before the uplift (merge was blocked on bug 774259). Adjusting milestone accordingly.
Target Milestone: mozilla16 → mozilla17
What, the uplift aleady happened? Thought it was going to be tomorrow. Will have plenty of stuff to approve then... starting by that.
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
Attachment #642460 - Flags: approval-mozilla-aurora?
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.
Attachment #642460 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
https://hg.mozilla.org/mozilla-central/rev/c81fb77dcb08
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
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.
(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.
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.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: