New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 804799 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Dx9 webgl GLSL shader compilation error

Reported by p...@sketchfab.com, Jan 23 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Steps to reproduce the problem:
1. windows 7 wit chrome go to https://sketchfab.com/models/725789b4e3e74232a59143478eb284e0

2. get shader compilation error

3. read compilation error from gl.getProgramInfoLog for PBR_Trans(Brows_MAT) shaders

"Shader Error: C:\fakepath(260,30): error X5629: Invalid register number: 12. Max allowed for o# register is 11.

Warning: D3D shader compilation failed with default flags. (vs_3_0)
 Retrying with avoid flow control
C:\fakepath(260,30): error X5629: Invalid register number: 12. Max allowed for o# register is 11.

Warning: D3D shader compilation failed with avoid flow control flags. (vs_3_0)
 Retrying with prefer flow control
C:\fakepath(190,28): error X5629: Invalid register number: 12. Max allowed for o# register is 11.

Warning: D3D shader compilation failed with prefer flow control flags. (vs_3_0)"

What is the expected behavior?
no compilation error.

What went wrong?
angle/glsl shader transpiler/compilation problems ?

Did this work before? N/A 

Does this work in other browsers? Yes

Chrome version: 63.0.3239.132  Channel: stable
OS Version: 7.0
Flash Version: 

Reports from our telemetry indicates whole range of desktop GPU (intel, nvidia, amd)

Sorry we cannot pinpoint to a reduced test case, as we cannot reproduce here due to lack of windows 7...
 

Comment 1 by p...@sketchfab.com, Jan 23 2018

Some gpus:
ANGLE (Intel(R) HD Graphics 520 Direct3D9Ex vs_3_0 ps_3_0)
ANGLE (Intel(R) HD Graphics 4400 Direct3D9Ex vs_3_0 ps_3_0)
ANGLE (AMD Radeon R9 200 Series Direct3D9Ex vs_3_0 ps_3_0)
ANGLE (Intel(R) HD Graphics 520 Direct3D9Ex vs_3_0 ps_3_0)
ANGLE (NVIDIA GeForce GTX 760 Direct3D9Ex vs_3_0 ps_3_0)

Btw, it might also be (probably) our fault, as it seems to happens on models with quite big shaders), but compilation error is quite cryptic...

Components: Internals>GPU>ANGLE
Could be the result of using builtins like gl_FragCoord/gl_PointSize/etc. D3D9 ANGLE is a bit tricky here. You can probably work around this by using one less varying.

Comment 3 by p...@sketchfab.com, Jan 23 2018

haaaaa, we hit the "varying max" there ?
That makes senses on the model(s) where the bug is reported.

Thanks, will check our varying counts !


Could have swear I saw more specific "Error: varying packing failed" kind of message from angle compiler report though. so maybe it hits it another way

Well, that "Invalid register number: 12" compilation error message could be clearer :) 

Thanks again

It's possible that ANGLE isn't properly counting registers in some edge cases.
Cc: vamshi.k...@techmahindra.com
Labels: Needs-Triage-M63 Triaged-ET Needs-Feedback
Unable to reproduce the issue on reported chrome version 63.0.3239.132 and on the latest canary 66.0.3331.0 using windows 7 with the below mentioned steps.
1. Launched chrome
2. Navigated to https://sketchfab.com/models/725789b4e3e74232a59143478eb284e0
We are able to see the 3D model with out any error. Attaching the screen cast of the same.

@Reporter: Could you please have a look at the screen cast and let us know if we have missed any steps while reproducing the issue. Any further inputs from your end may help us.

Thanks!
804799.mp4
5.2 MB View Download

Comment 6 by p...@sketchfab.com, Jan 25 2018

It may very well be GPU dependant, especially if jmad..@chromium is right about the varying count (repro would need one of the GPU listed in "comment 1")

Comment 7 by p...@sketchfab.com, Jan 25 2018

( so unless you can test with one GPU of the list, it might not be reproducible )
Project Member

Comment 8 by sheriffbot@chromium.org, Jan 25 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "vamshi.kommuri@techmahindra.com" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 9 by piman@chromium.org, Jan 26 2018

Owner: jmad...@chromium.org
Status: Assigned (was: Unconfirmed)
Status: Started (was: Assigned)
This isn't fixable, but I'll fix the error message. We were missing some counting on D3D9 only.
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/angle/angle/+/61d5325e631ea66f0f6b630fb2ecd6b48adb6309

commit 61d5325e631ea66f0f6b630fb2ecd6b48adb6309
Author: Jamie Madill <jmadill@chromium.org>
Date: Wed Jan 31 20:57:12 2018

D3D9: Improve varying packing failure mode.

D3D9 has a special limitation on varying packing, where each
variable takes up a full register width, and cannot share space
with other packed varyings.

A bug was counting registers incorrectly on D3D9. Fix this by
introducing a new limitation exposed to the ANGLE front-end via
the gl::Limitations structure. Now varying packing will fail
correctly in the ANGLE linking front-end with a more descriptive
error message, as such:

"Could not pack varying blah"
"Note: Additional non-conformant packing restrictions are enforced on D3D9."

Also change the packing so that input built-in variables are
counted towards varying limits (e.g. gl_PointSize), except for
gl_Position. On D3D9 we don't pack gl_PointSize, since it is
used in a special extra PSIZE register.

Also update some tests to be more robust.

Bug:  chromium:804799 
Change-Id: I9027266a8b66a28626f038f259bff42ebf09dcd2
Reviewed-on: https://chromium-review.googlesource.com/889898
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>

[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/VaryingPacking.cpp
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/VaryingPacking.h
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/Caps.h
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/tests/gl_tests/GLSLTest.cpp
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/Caps.cpp
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.h
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/renderer/d3d/ProgramD3D.cpp
[modify] https://crrev.com/61d5325e631ea66f0f6b630fb2ecd6b48adb6309/src/libANGLE/Program.cpp

Status: Fixed (was: Started)
Should have a more descriptive error message now, and varying counting should be more correct in ANGLE.

Sign in to add a comment