-
Notifications
You must be signed in to change notification settings - Fork 1.6k
ANGLE: Failure to compile TensorFlow.js WebGL shaders #47229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ANGLE: Failure to compile TensorFlow.js WebGL shaders #47229
Conversation
EWS run on previous version of this PR (hash 7da6bdd) |
7da6bdd
to
5863ae4
Compare
EWS run on previous version of this PR (hash 5863ae4) |
5863ae4
to
259e737
Compare
EWS run on previous version of this PR (hash 259e737) |
259e737
to
8f1f6bb
Compare
EWS run on previous version of this PR (hash 8f1f6bb) |
8f1f6bb
to
fbca0a3
Compare
EWS run on current version of this PR (hash fbca0a3) |
https://bugs.webkit.org/show_bug.cgi?id=294738 rdar://153836970 Reviewed by Mike Wyrzykowski. Increment, decrement operators with swizzles would fail to compile for integer vectors: ivec4 vec; vec.xyz++; This would produce: metal::int4 _uii; ANGLE_postIncrementInt(ANGLE_swizzle_ref(_uii, 0u, 1u, 2u)); ANGLE_postIncrementInt(T &a) would not match because the argument was rvalue ANGLE_SwizzleRef, and rvalues cannot bind to non-const lvalue references. Even if this was worked around somehow, the template would not work because T == ANGLE_SwizzleRef, when the original intention was that the T would be metal int, int2, int3, int4. Write the ANGLE_postIncrementInt and other functions without templates. This way the overload resolution applies the ANGLE_SwizzleRef::operator intX&() conversion operator. Since the conversion operator is applied, the returned value is a lvalue reference and can be bound to the arg. Due to the use of temporaries changes ANGLE_preIncrementInt, ANGLE_preDecrementInt functions to return the result by value instead by reference. In GLSL, these operators are not specified to produce a lvalue. As per the current code, the translator treats the result as rvalue. * Source/ThirdParty/ANGLE/src/compiler/translator/msl/ProgramPrelude.cpp: * Source/ThirdParty/ANGLE/src/compiler/translator/tree_ops/msl/RewriteUnaddressableReferences.cpp: (sh::ReturnsReference): (sh::IsUnaryLValueOp): * Source/ThirdParty/ANGLE/src/tests/compiler_tests/MSLOutput_test.cpp: ((MSLOutputTest, UintAssignmentOperators)): ((MSLOutputTest, UintSwizzleAssignmentOperators)): * Source/ThirdParty/ANGLE/src/tests/gl_tests/GLSLTest.cpp: Canonical link: https://commits.webkit.org/296744@main
fbca0a3
to
adfd582
Compare
Committed 296744@main (adfd582): https://commits.webkit.org/296744@main Reviewed commits have been landed. Closing PR #47229 and removing active labels. |
adfd582
fbca0a3