Open Bug 1950581 Opened 23 days ago Updated 21 days ago

Firefox's SanitizeRenderer.cpp fails to recognize Adreno GPU for Surface Pro laptops

Categories

(Core :: Graphics: CanvasWebGL, defect, P2)

Firefox 136
defect

Tracking

()

UNCONFIRMED

People

(Reporter: piyush_soni, Unassigned)

Details

Attachments

(1 file)

Steps to reproduce:

Write this sample code in the Console to get the WebGL renderer string in Firefox:

var canvas = document.createElement('canvas');
var gl;
var debugInfo;
var renderer;

try {
gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
} catch (e) {
}

if (gl) {
debugInfo = gl.getExtension('WEBGL_debug_renderer_info');
renderer = gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL);
}

Actual results:

Observe that while for normal GPUs (NVIDIA / Intel / AMD etc.) it reports the correct vendor name even though it masks the actual GPU in most cases and tries to show a 'similar one', for Qualcomm Snapdragon based Surface Pro Windows laptops it reports :
"ANGLE (Unknown, Generic Renderer Direct3D11 vs_5_0 ps_5_0), or similar"

(Vendor name is reported as 'Unknown')

The actual WebGL 1 Driver Renderer as reported by the about:support page is :
"ANGLE (Unknown, Qualcomm(R) Adreno(TM) X1-85 GPU Direct3D11 vs_5_0 ps_5_0, D3D11-31.0.82.0)"

As can be observed, even though the original renderer string clearly reports the vendor name (Adreno) in it, Firefox is not able to recognize it because of this regex test (https://searchfox.org/mozilla-central/source/dom/canvas/SanitizeRenderer.cpp#231) trying to match every Adreno GPU with a mandatory 3 digits of model number after it. I think Firefox's intention is to not hide the vendor name at least because the "similar" GPU name it reports can be pretty misleading for WebGL based application developers. The ability to at least know the vendor name allows us to elegantly handle known vendor graphics driver related bugs (For example, our application 'Onshape' is trying to handle a graphics driver related bug only with Adreno GPUs, but Firefox hides that information while Chrome doesn't).

Expected results:

Firefox should have at least reported the name 'Adreno' in this case too. I think the fix would be to not try to match 3 digit model number for every Adreno GPU, but only for the presence of the word 'Adreno' in the first if block (like it's done for NVIDIA, Intel and others) and test for any model number only inside that if block - it's fine to not find a model number but the vendor name should never be masked.

If Mozilla team has bandwidth issues, I can probably create a simple fix and a PR. Please let me know.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core

Patches are always welcome! Thank you. ;)

Could you also attach your about:support output to this report when you get a chance? This sounds like an interesting hardware combination, and more detail would be helpful.

Severity: -- → S3
Flags: needinfo?(piyush_soni)
Priority: -- → P2
Flags: needinfo?(piyush_soni)

Attached the about:support report to the bug. Yes, it's probably a custom GPU made only for Qualcomm Snapdragon X chips (used in Microsoft Surface laptops/tablets). Please let me know if any other information is required.

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

Attachment

General

Creator:
Created:
Updated:
Size: