Closed Bug 725467 Opened 12 years ago Closed 5 years ago

Long WebGL shader compile/link time

Categories

(Core :: Graphics: CanvasWebGL, defect)

10 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: pjcozziAGI, Unassigned)

Details

Attachments

(1 file)

Attached image NVIDIA driver reset
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7

Steps to reproduce:

A complex WebGL fragment shader takes ~5,300 ms to link in WebGL 
(on Linux and Windows without ANGLE).  With ANGLE, the browser tab hangs.  The graphics driver has also reset (image attached).  Perhaps this is really a driver issue.  In desktop OpenGL, the whole program compiles and links almost instantaneously.

Benoit Jacob, jacob.benoit.1@gmail.com, has a simple test case to reproduce.  This code is not public yet.  The console window shows the time it takes to call linkProgram in ms.

Also see the WebGL Dev List discussion:  http://groups.google.com/group/webgl-dev-list/browse_thread/thread/7ea743969189af53

Also see the chromium bug: http://code.google.com/p/chromium/issues/detail?id=113009

Perhaps related to ANGLE bug: http://code.google.com/p/angleproject/issues/detail?id=259
Component: Untriaged → Canvas: WebGL
Product: Firefox → Core
QA Contact: untriaged → canvas.webgl
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → INCOMPLETE

On my Windows10, compile+link shader on FireFox seems much slower than on Chrome. I made a simple test to reproduce.

https://raw.githack.com/takahirox/KHR_parallel_shader_compile_test/master/blocktime.html

Code snippet:

const startTime = performance.now();

const vertexShader = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vertexShader, vertexShaderCode);
gl.compileShader(vertexShader);

const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader, fragmentShaderCode);
gl.compileShader(fragmentShader);

const program = gl.createProgram();

gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);

gl.linkProgram(program);

const status = gl.getProgramParameter(program, gl.LINK_STATUS);
const endTime = performance.now();

Result:

Chrome: 3ms
FireFox: 43ms

My test platform:

OS: Windows10
GPU: Intel(R) HD Graphics 530
Browsers: FireFox Nightly 68.0a1 (2019-05-06) (64-bit), Chrome 74.0.3729.131 (Official Build) (64-bit)

This might be a Windows specific issue because no performance different between FireFox and Chrome on my coworker's Mac.

Do you folks think I'm facing the same issue Patrick reported above? Or might it be another problem and should I open a new bug report?

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

Attachment

General

Creator:
Created:
Updated:
Size: