If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

MAX_TEXTURE_SIZE on Firefox is much smaller than Chrome

RESOLVED FIXED in Firefox 55

Status

()

Core
Canvas: WebGL
P1
normal
RESOLVED FIXED
11 months ago
22 days ago

People

(Reporter: xidorn, Assigned: jgilbert)

Tracking

Trunk
mozilla55
Unspecified
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox52 affected, firefox55 fixed)

Details

(Whiteboard: [gfx-noted])

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

11 months ago
On my MBP MacBook Pro (Retina, 15-inch, Late 2013), when I run the following commands in Web Console:
> var canvas = document.createElement('canvas');
> var gl = canvas.getContext('webgl');
> gl.getParameter(gl.MAX_TEXTURE_SIZE)

Firefox returns 4096, while Chrome returns 16384.

This machine has two graphics card: one is the builtin Intel Iris Pro, the other is NVIDIA GeForce GT 750M. Maybe Firefox doesn't try to use the more powerful one?
(Reporter)

Comment 1

11 months ago
And yeah, it seems Chrome is using the NVIDIA one, because if I further input
> var debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
> gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL)
Chrome returns "NVIDIA Corporation", while in Firefox, debugInfo itself is null.
OS: Unspecified → Mac OS X
Priority: -- → P4
Whiteboard: [gfx-noted]

Comment 2

5 months ago
I first reported this over three years ago on WebGL Dev.  It's not just MAX_TEXTURE_SIZE, it's also MAX_RENDERBUFFER_SIZE.  So on a 5K display, this is highly problematic.
Depends on: 737182, 684882
Created attachment 8865219 [details] [diff] [review]
Remove MAX_TEXTURE_SIZE/MAX_CUBE_MAP_TEXTURE_SIZE limit for Mac Intel hardware

The texture and render buffer sizes were restricted due to Mac Intel driver
bugs in bug 737182 and bug 684882. Chrome and Safari do not cap the size so
it seems likely that this is no longer an issue (although it would be good to
confirm that Apple has indeed fixed the driver).

On macOS 10.12 with a Late 2016 MacBook Pro, I forced the integrated GPU and
ran:

  var canvas = document.createElement('canvas');
  var gl = canvas.getContext('webgl');
  console.log(gl.getParameter(gl.MAX_TEXTURE_SIZE),
              gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE),
              gl.getParameter(gl.MAX_RENDERBUFFER_SIZE));

Chrome, Safari, and Firefox (with this patch applied) all print:

  16384 16384 16384

Also confirmed that the following test cases do not result in texture
corruption:

- attachment 607633 [details] (from bug 737182)
- https://threejs.org/examples/?q=car#webgl_materials_cars (from bug 684882)
Attachment #8865219 - Flags: review?(b56girard)
Assignee: nobody → birunthan
Status: NEW → ASSIGNED

Comment 4

5 months ago
I should add that the 4K limits posted were when I was running with the Nvidia GPU and not the Intel GPU of the 15" Macbook Pro just like the poster of this bug.  If there bugs in the drivers, then Chrome isn't guarding against that and neither is Safari.

Comment 5

5 months ago
There are two problems in that limiting code.  One is that the detection of the GPU seems to be wrong.  It's detecting and applying Intel limits when I'm running on Nvidia GPU.  The other is that your patch has fixed the limits for Intel, but left the Nvidia limits of 8191, which means that we can only get to 4096 on Nvidia parts for power-of-two texture sizes.

Here's one of the original positing I made to WebGL Dev for context.
https://groups.google.com/forum/#!topic/webgl-dev-list/AHONvz3oQTo
Comment on attachment 8865219 [details] [diff] [review]
Remove MAX_TEXTURE_SIZE/MAX_CUBE_MAP_TEXTURE_SIZE limit for Mac Intel hardware

Probably want a more active maintainer to review this that knows how this has evolved.
Attachment #8865219 - Flags: review?(b56girard) → review?(jmuizelaar)
(Assignee)

Comment 7

5 months ago
Comment on attachment 8865219 [details] [diff] [review]
Remove MAX_TEXTURE_SIZE/MAX_CUBE_MAP_TEXTURE_SIZE limit for Mac Intel hardware

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

We aren't necessarily ready to lift this yet, since last repro did find this to be an issue (at least on NV) in 10.8. Now, we only support 10.9, but have no indication it's been fixed, except that it's working on 10.12. (for me, at least)

I'll try to grab a 10.9 machine and try to repro, but we can only relax these restrictions for >=10.12 until we test on previous versions.

Further, this doesn't help your main issue, since this only fixes it with the integrated GPU forced, which is not common for users, and so will not fix this bug in the common case.
Attachment #8865219 - Flags: review?(jmuizelaar) → review-
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Updated

5 months ago
Assignee: birunthan → jgilbert
Priority: P4 → P1

Comment 10

5 months ago
mozreview-review
Comment on attachment 8865727 [details]
Bug 1310222 - Remove GL max-size reduction workarounds on OSX >=10.12 -

https://reviewboard.mozilla.org/r/137346/#review140384

LGTM
Attachment #8865727 - Flags: review?(dmu) → review+

Comment 11

5 months ago
mozreview-review
Comment on attachment 8865726 [details]
Bug 1310222 - Relax PoT requirement for resource size limits in WebGL. -

https://reviewboard.mozilla.org/r/137344/#review140386

LGTM
Attachment #8865726 - Flags: review?(dmu) → review+
Attachment #8865219 - Attachment is obsolete: true

Comment 12

5 months ago
Pushed by jgilbert@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee59f5e24bae
Relax PoT requirement for resource size limits in WebGL. - r=daoshengmu
https://hg.mozilla.org/integration/mozilla-inbound/rev/4dc76bc01b76
Remove GL max-size reduction workarounds on OSX >=10.12 - r=daoshengmu

Comment 13

5 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/ee59f5e24bae
https://hg.mozilla.org/mozilla-central/rev/4dc76bc01b76
Status: ASSIGNED → RESOLVED
Last Resolved: 5 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55

Comment 14

26 days ago
(In reply to Alecazam from comment #5)
> your patch has fixed the limits for Intel

Then I'm not sure if this is the same issue, but for reference my MacBook Air (13-inch, Early 2015) OS 10.11.6, Firefox 55.0.3, running:
> var canvas = document.createElement('canvas');
> var gl = canvas.getContext('webgl');
> gl.getParameter(gl.MAX_TEXTURE_SIZE)
returns 4096, while in Chrome it's 16384. This machine has only 1 GPU (Intel HD Graphics 6000).
(Assignee)

Comment 15

22 days ago
(In reply to jrodatus from comment #14)
> (In reply to Alecazam from comment #5)
> > your patch has fixed the limits for Intel
> 
> Then I'm not sure if this is the same issue, but for reference my MacBook
> Air (13-inch, Early 2015) OS 10.11.6, Firefox 55.0.3, running:
> > var canvas = document.createElement('canvas');
> > var gl = canvas.getContext('webgl');
> > gl.getParameter(gl.MAX_TEXTURE_SIZE)
> returns 4096, while in Chrome it's 16384. This machine has only 1 GPU (Intel
> HD Graphics 6000).

Updating to 10.12 will fix this for you.

Comment 16

22 days ago
(In reply to Jeff Gilbert [:jgilbert] from comment #15)
> Updating to 10.12 will fix this for you.

Thanks. Yes, I did understand that. Was aiming for compatibility with users who may not.

However, even Safari & Opera are reporting diff. values for GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,
so I'm thinking WebGL reports are not to be trusted in general:/
You need to log in before you can comment on or make changes to this bug.