|
693c9aa0
|
2015-04-07T17:50:36
|
|
Replace setArray function in TPublicType with functions from TType
Having only one way of setting or clearing arrayness of types clarifies
code dealing with arrays.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I98cb7c44fd66440c9de8b4c6c4a02827e9300db7
Reviewed-on: https://chromium-review.googlesource.com/264361
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
93a90fd0
|
2015-04-07T18:14:07
|
|
Remove half-baked non-sized array support
ANGLE used to accept shaders with non-sized arrays in initializer lists.
Fix this. Proper support for implicitly sized arrays will be implemented
later for ESSL3.
TEST=angle_unittests
BUG=angleproject:941
Change-Id: I53c5ccf0f7ef09ad30e142f8350812959fc4846c
Reviewed-on: https://chromium-review.googlesource.com/264360
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
9638c352
|
2015-04-01T14:34:52
|
|
Support assigning array constructors in HLSL output
This adds support to the following type of shader code, where an array
constructor is used as a source of assignment:
float a[3];
a = float[3](0.0, 1.0, 2.0);
The assignment gets replaced in the HLSL code by a function call where
the array is an out parameter and the constructor parameters are regular
parameters.
Constructors cannot yet be used in initializers.
With this change in place, some of the relevant dEQP tests start passing.
TEST=dEQP-GLES3.functional.shaders.arrays.constructor.*
BUG=angleproject:941
Change-Id: I13ed603c02a30d9f9950a61c4d562ae9fac058ec
Reviewed-on: https://chromium-review.googlesource.com/263403
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
f40319e9
|
2015-03-10T14:33:00
|
|
Add basic support for array constructors
Add limited support for parsing array constructors and writing them out as
GLSL code.
Still missing from this version: HLSL output, array support in
initializer lists, arrays with implicit size.
BUG=angleproject:941
Change-Id: I7febf80923c4cd0b730399f1f49f9456cf3668e9
Reviewed-on: https://chromium-review.googlesource.com/260572
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
711d8663
|
2015-04-02T19:43:57
|
|
Revert "Implement gradient operation AST analysis"
This reverts commit 2fc57a2ace58b7ae3106344c56be94948f761b2a.
Change-Id: I619297090c8441c1b90099437f8764263cdd68cc
Reviewed-on: https://chromium-review.googlesource.com/263728
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
c457e7bb
|
2015-04-02T19:43:52
|
|
Revert "Implement discontinuous loops AST analysis"
This reverts commit f30a9ba96bdfa014fc182060c714a2c75451f4cf.
Change-Id: I577cfd1e7d5d6138413c29205cbf4d35b6861226
Reviewed-on: https://chromium-review.googlesource.com/263754
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
186160b2
|
2015-04-02T19:34:38
|
|
Revert "Implemented a CallDAG to allow for more AST analysis"
failures in angle_unittests and compilation failure on clang (see: https://build.chromium.org/p/chromium.gpu.fyi/builders/GPU%20Mac%20Builder%20%28dbg%29/builds/30016/steps/compile/logs/stdio) .
This reverts commit b34d1d12969496b1b0fb53934b8ce3200304f900.
Change-Id: Ia995fb2db0e891294f3461de01617cb13e5ae381
Reviewed-on: https://chromium-review.googlesource.com/263727
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
f30a9ba9
|
2015-03-19T10:39:13
|
|
Implement discontinuous loops AST analysis
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: Icc37abf51a1407c9e7bc708dc08d3ba4050a496a
Reviewed-on: https://chromium-review.googlesource.com/261189
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2fc57a2a
|
2015-03-18T12:55:45
|
|
Implement gradient operation AST analysis
This will allow narrowing down which usages of
[[flatten]] and [[unroll]] are actually useful.
BUG=angleproject:937
BUG=395048
Change-Id: Ic31e434c7b5bb6c32eff2336e5949391bfee25a5
Reviewed-on: https://chromium-review.googlesource.com/260930
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
b34d1d12
|
2015-02-11T11:15:24
|
|
Implemented a CallDAG to allow for more AST analysis
The CallDAG preprocesses the AST to construct a DAG of
functions that can be used for several analysis.
Use it to implement check for recursion and max call
depth. It will also be used to limit the usage of
[[flatten]] and [[unroll]].
BUG=angleproject:937
BUG=395048
Change-Id: I643e0ed605ad095e4fd7da4977d842be5e6a12e0
Reviewed-on: https://chromium-review.googlesource.com/229352
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
b2d6a9be
|
2015-03-30T16:00:53
|
|
Stub simplifying array assignment for HLSL output
Add an AST traverser that rejects shaders with expressions that use the return
value of an assignment where an array is assigned to another array. In the
future this should be made into a tool that can simplify these expressions so
that return values of array assignments are not used.
In its current form this code prevents OutputHLSL from producing garbage code
when the original code contains expressions like a = (b = c); where a, b, and c
are all arrays.
BUG=angleproject:960
Change-Id: I11353d7ed7160c853e58a0ef3471ca439cb314c8
Reviewed-on: https://chromium-review.googlesource.com/263070
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
1269076c
|
2015-03-31T12:55:28
|
|
Add basic support for assigning arrays in HLSL output
Implement support for assignments where the return value of the assignment
is not used in another part of the expression.
TEST=WebGL conformance tests
BUG=angleproject:960
Change-Id: Ibf9d71a75d27d139d2aabb5162ab04a0974321d3
Reviewed-on: https://chromium-review.googlesource.com/263222
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
f6c694bc
|
2015-03-26T14:50:53
|
|
Assign built-in function return type in promote()
This finishes the refactoring of unary math operation handling so that
IntermUnary::promote has the complete code for setting the return type of
the node.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: I19bd8d53029e24f734c9436eceb446b37e7fcf26
Reviewed-on: https://chromium-review.googlesource.com/262416
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
dca3e796
|
2015-03-26T13:24:04
|
|
Refactor unary math operator handling to clarify responsibilities
Shuffle the code around so that each part has a clear responsibility:
IntermUnary::promote is responsible for setting the return type of the
node, Intermediate::addUnaryMath is responsible for creating the node
object, and ParseContext::createUnaryMath is responsible for validating
the operand type.
This removes duplicated bool type check for logical not.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: I9f5a0abb6434ad2730441ea9199ec3f5382ebcda
Reviewed-on: https://chromium-review.googlesource.com/262415
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
5321c808
|
2015-04-02T17:08:16
|
|
Add unsigned literal support to GLSL output
BUG=angleproject:964
Change-Id: I8eb3cfd8d49beded4ac55ead97b50c7691e4980a
Reviewed-on: https://chromium-review.googlesource.com/263710
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
f0d10f89
|
2015-03-31T12:56:52
|
|
Replace non-copyable macro with a helper class.
This class provides a simpler scheme for blocking default copy
and assignment operators. It also reduces the amount of code
needed since it's inherited to child classes. This also fixes
the conflict between our macro and the same-named macro in
Chromium code.
BUG=angleproject:956
Change-Id: If0dc72aa3f63fbc7b8fa34907418821c64c39e2f
Reviewed-on: https://chromium-review.googlesource.com/263257
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
|
|
fc7cfd1c
|
2015-03-31T14:46:18
|
|
Fix array function parameter syntax in HLSL equality function
The fact that passing shaders to the platform compiler is deferred until
linking is performed allowed this bug to pass undetected in earlier manual
testing.
TEST=WebGL conformance tests
BUG=angleproject:941
Change-Id: Ic12b5d0c5547057551df90086453e897a161d559
Reviewed-on: https://chromium-review.googlesource.com/263221
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
69c11b5d
|
2015-03-26T12:59:00
|
|
Move validation from Intermediate::addUnaryMath to ParseContext
Intermediate should only have logic for creating node objects, validation
of parameter types belongs in ParseContext.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Ie90697641fabb2a837ccc4571a93616d63ea64e6
Reviewed-on: https://chromium-review.googlesource.com/262414
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
5e5c826c
|
2015-03-26T14:04:54
|
|
Fix float-int conversion return type precision tracking
Float-int conversion functions are defined to always return highp values.
BUG=angleproject:865
TEST=angle_unittests
Change-Id: Idf243b483f7b5edfcb54de2755af11e17c3756d3
Reviewed-on: https://chromium-review.googlesource.com/262413
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
ff699005
|
2015-03-23T14:38:42
|
|
Disallow operations on structs containing samplers
ESSL 1.00 spec section 5.9 says that equality operators don't operate on
structs containing sampler types. Section 5.7 also suggests this. ESSL
3.00 doesn't have a similar restriction.
ESSL 1.00 spec section 4.1.7 says that structs containing samplers can't
be used as l-values. This is interpreted to apply also in the case of
ESSL 3.00, which similarly disallows samplers as l-values, but doesn't
explicitly mention structs.
BUG=angleproject:954
TEST=angle_unittests, WebGL conformance tests
Change-Id: I73f74962a192e8d9449990ffa5f3d8c851491601
Reviewed-on: https://chromium-review.googlesource.com/261822
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ae37a5c8
|
2015-03-20T16:50:15
|
|
Support equality between structs containing arrays in HLSL output
This requires sorting all equality functions together so that struct
equality functions can have dependencies on array equality functions, but
support for array equality functions that have dependencies on struct
equality functions is also maintained.
There's no automated test coverage for this specifically. The change was
tested by manually inspecting shader output and ensuring that there were
no test regressions in tests listed below.
TEST=dEQP-GLES3.functional.shaders.*
BUG=angleproject:954
Change-Id: If7199ab2446804afae50f103bb625101172882b9
Reviewed-on: https://chromium-review.googlesource.com/261550
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
7fb4955d
|
2015-03-18T17:27:44
|
|
Support array equality operator in HLSL output
This requires adding functions to the shader source that can do the
comparison for a specific array size.
There's no automated test coverage specifically for this functionality,
since all deqp tests that cover this also require array constructors to
be supported. The change has been tested by manually inspecting shader
output. No regressions were seen in automated tests listed below.
TEST=dEQP-GLES3.functional.shaders.*, angle_unittests
BUG=angleproject:941
Change-Id: Ie2ca7c016a3f0bcb3392a96d6d20d6f803d28bf0
Reviewed-on: https://chromium-review.googlesource.com/261530
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
9dd217bc
|
2015-03-20T14:24:31
|
|
Disallow operations on structures containing arrays in ESSL1
Comparing structures that contain arrays to each other and assigning
structures that contain arrays is "not defined" in ESSL 1.00 (section
5.7). Sections 5.8 and 5.9 further suggest that these operations are not
allowed. Additionally some platform drivers on Linux seem to reject
shaders produced by ANGLE which compare structures containing arrays.
This might require changing the output GLSL version for ESSL 3.00.
BUG=angleproject:954
TEST=angle_unittests
Change-Id: I5f3a016f360f940f2fc1ec1ff8e60d13a977eb69
Reviewed-on: https://chromium-review.googlesource.com/261531
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
47fd36a7
|
2015-03-19T14:22:24
|
|
Move some validation from IntermBinary::promote to ParseContext
This makes the role of promote() in the system clearer and helps to make
the code more understandable, since more of the checks are in the same
logical place.
BUG=angleproject:952
TEST=angle_unittests, WebGL conformance tests
Change-Id: Idb2de927d872e46210d71cf6de06a6f8c1fc5da1
Reviewed-on: https://chromium-review.googlesource.com/260803
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c8ef69d2
|
2015-03-18T16:43:22
|
|
Fix C4702 issues (unreachable code) in ANGLE, excluding <xtree>
Change-Id: Ia7603139af266fd7b14efc8c3465225738456e67
Reviewed-on: https://chromium-review.googlesource.com/261038
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e79904c3
|
2015-03-18T16:56:42
|
|
Accept equality and assignment for arrays in parsing
This is enough to support the operations in GLSL output. HLSL output will
likely require additional work to support this.
BUG=angleproject:941
Change-Id: I728d511ab07af94bc3382dc2796c1e9ac79d1442
Reviewed-on: https://chromium-review.googlesource.com/260801
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1ade24db
|
2015-03-19T16:29:32
|
|
Add #version 300 es to ESSL output when needed
BUG=angleproject:953
Change-Id: Ib9e45fab1d35f8c78abd0ac2209ac4f63afe4465
Reviewed-on: https://chromium-review.googlesource.com/261170
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
d6b14287
|
2015-03-17T14:31:35
|
|
Move binary op array check to ParseContext
Also piece together an addAssign function in ParseContext that uses the
binary op array check. This will make it easier to change the
array-related checks in the future to use shaderVersion. Moving
validation out from IntermBinary::promote also makes the architecture
clearer, promote()'s role should be mainly to determine the type of the
return value of the binary operation, not to do validation.
BUG=angleproject:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: If1de33ea250893527be7f0d7930d4678a0864684
Reviewed-on: https://chromium-review.googlesource.com/260571
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b2983c95
|
2015-03-18T14:02:46
|
|
Correctly insert unmangled function names to symbol table
This fixes detecting some cases of function parameter mismatch
(previously a mangled function name corresponding to no function
parameters was added to the symbol table for each user-defined function,
and this was returned when doing function lookups with no parameters).
Also fixes detection of reusing a function name as a variable/struct
name.
New unit tests are added to ensure that these fixes don't regress.
BUG=angleproject:936
TEST=angle_unittests, WebGL conformance tests
Change-Id: I2dadde9dcc01c7a4a653c1982c36377b89e6d437
Reviewed-on: https://chromium-review.googlesource.com/260800
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
fc1806e1
|
2015-03-17T13:03:11
|
|
Move most of addBinaryMath from Intermediate to ParseContext
Some type checks for binary math will be different based on the shading
language version, which is easily accessible in ParseContext. Because of
this and also for architectural simplicity it makes more sense to have
the checks in ParseContext.
BUG=angle:941
TEST=angle_unittests, WebGL conformance tests
Change-Id: I92a499f47e1cbc6a7b6391ce0fa04284803e7140
Reviewed-on: https://chromium-review.googlesource.com/260570
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6341939f
|
2015-03-13T11:51:07
|
|
Fix code duplication in OutputHLSL
While debugging, I came across the piece of code in
OutputHLSL::OutputHLSL which is unnecessarily duplicated,
this change just fixes it.
Change-Id: I0549d58696417ccf651bacfa19f489b290d4ba6e
Reviewed-on: https://chromium-review.googlesource.com/259960
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2728eda4
|
2015-03-16T10:23:50
|
|
Revert "A special state to track field selection is not necessary."
This reverts commit f8dc4fb66d2ee473b6ba37626f02756422863f6c.
The special state to track field selection is actually necessary to avoid
reduce/reduce conflicts when array constructors are added to the grammar.
BUG=angleproject:941
TEST=WebGL conformance tests, angle_unittests
Change-Id: I55476483c9e83241e8978cd58f05ef303c7c8680
Reviewed-on: https://chromium-review.googlesource.com/260260
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
4f52da4a
|
2015-03-11T10:48:41
|
|
Remove no-op functionality from IdentifyBuiltIns and refactor
Adding array built-ins like gl_FragData and gl_LastFragData to the
symbol table with a name that included their size in brackets was
incorrect and unnecessary. Remove this. The array built-ins should only
be added with their proper name and with an array type.
Also refactor the code to reduce unnecessary repetition of conditions.
The previous version attempted to split the built-ins that had
dependencies on resources into their own part of the code, but this split
was not clearly defined and only made the code harder to follow and
prone to issues.
TEST=WebGL conformance tests
Change-Id: I7a77865a594864a22f3b566f9d3da1d0ead46466
Reviewed-on: https://chromium-review.googlesource.com/258751
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
61ffec88
|
2015-03-11T10:35:01
|
|
Fix formatting of IdentifyBuiltIns
Fix indentation of case labels, fix too long lines, put braces on their
own lines and remove extraneous spacing and comments that didn't
contribute to the readability of the code.
TEST=WebGL conformance tests
Change-Id: Ie33d0a7c4412c448081f5d879fa9f64baaf8d537
Reviewed-on: https://chromium-review.googlesource.com/258750
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
44efa0b8
|
2015-03-04T17:11:05
|
|
Conditionally enable IEEE strictness for isnan()
ANGLE's ESSL3 built-in function isnan() implementation just uses HLSL
intrinsic function isnan(). For HLSL intrinsic function isnan() to work
properly, IEEE strictness needs to be enabled for D3D compiler.
This change detects use of isnan() in shaders and passes compiler flag
D3DCOMPILE_IEEE_STRICTNESS whenever isnan is used in shaders. This
change also moves existing workarounds in D3DWorkaroundType to
D3DCompilerWorkarounds.
BUG=angle:927
TEST= dEQP tests
dEQP-GLES3.functional.shaders.builtin_functions.common.isnan.*
Change-Id: I1ce5b1a7a825fdd720a37dc9aeb71320e55162d9
Reviewed-on: https://chromium-review.googlesource.com/255834
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
092e1a12
|
2015-03-09T07:40:11
|
|
Initialize fragmentPrecisionHigh in constructor.
This was the only field not initialized by the constructor, which
looks like an oversight.
Change-Id: If61424d574c663113a4c6d31e94b6ec13b412884
Reviewed-on: https://chromium-review.googlesource.com/257360
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
fc7fab72
|
2015-03-06T12:03:18
|
|
Fix matrix compound multiplication
Matrix compound multiplication was lacking transposes. Add them so that
results match normal multiplication.
BUG=angleproject:938
TEST=dEQP-GLES3.functional.shaders.matrix.mul_assign.*
Change-Id: I4c5159de0727afb4ee2831586f04fa817619de7a
Reviewed-on: https://chromium-review.googlesource.com/256366
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
51585037
|
2015-03-05T19:40:42
|
|
Remove unnecessary ifdef APPLE from built-in emulation
The emulation is already toggled by a compilation flag, so having it
behind an ifdef only adds unnecessary complexity, particularly when
testing changes to the emulation code.
BUG=angleproject:865
Change-Id: Idf7854c2b5323609880b527ed806440dcc8ac091
Reviewed-on: https://chromium-review.googlesource.com/256365
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
8efc5ad5
|
2015-03-03T17:21:10
|
|
Initialize BuiltInFunctionEmulator outside Compiler
This moves GLSL output specific code from the Compiler class to the
GLSL/ESSL translators.
BUG=angleproject:865
Change-Id: I2d552e9cdb41f7d8ddfee7b0249a99d629a6d7d7
Reviewed-on: https://chromium-review.googlesource.com/255471
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
72ba85bf
|
2015-03-04T14:23:26
|
|
Fix regression in addFunctionCallOrMethod
Fix a crash when parsing a shader with incorrect constructor arguments.
BUG=angleproject:911
TEST=WebGL conformance tests
Change-Id: I3459612f36185db861a361fa916cc6b671795037
Reviewed-on: https://chromium-review.googlesource.com/255870
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|
|
95cd3c68
|
2015-03-03T16:45:32
|
|
Move some output out of BuiltInFunctionEmulator subclasses
This paves the way for getting rid of the BuiltInFunctionEmulator
subclasses in favor of initializing the BuiltInFunctionEmulator
dynamically in Compiler subclasses. The eventual goal is getting rid of
GLSL output specific functionality in Compiler, which should be
language-agnostic.
BUG=angle:865
Change-Id: Ibb114b905785c7343b2726c97699268c982536a0
Reviewed-on: https://chromium-review.googlesource.com/255470
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
c4ba3bef
|
2015-03-02T14:42:24
|
|
Refactor addFunctionCallOrMethod out of glslang.y
TEST=angle_unittests
BUG=angle:911
Change-Id: I6d4c0f0bfbf9e6252e241ae5bb1b6acdb463fce6
Reviewed-on: https://chromium-review.googlesource.com/255451
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
5dbece59
|
2015-02-27T20:35:38
|
|
Implement trunc, round, roundEven (Emulated roundEven)
BUG=angle:934
Change-Id: If33256bf3707f3f0202147276c71f08c65518205
Reviewed-on: https://chromium-review.googlesource.com/254842
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2cd7a0ed
|
2015-02-27T13:57:32
|
|
Remove switch fall-through on HLSL
Remove fall-through from non-empty labels in switch statements.
Tested with dEQP-GLES3.functional.shaders.*switch*. All pass except for tests
that require dFdx/dFdy, which fail for an unrelated reason.
Additional test coverage could still be useful for cases where a label is
terminated by a continue or return statement.
BUG=angle:921
Change-Id: I4741867789a9308d66d0adeabdaf83907106e2d2
Reviewed-on: https://chromium-review.googlesource.com/254550
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
687ef22c
|
2015-03-03T10:58:05
|
|
Fix derivatives being related to an extension on ESSL3
dFdx, dFdy and fwidth are parts of the core language in ESSL3.
This fixes a regression from the patch "Set symbol extension at insertion".
BUG=angle:926
Change-Id: I6c0bbce3afad1f064ff115a16e23ea79bd584e49
Reviewed-on: https://chromium-review.googlesource.com/255450
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
05b6b7fc
|
2015-03-02T17:08:09
|
|
Add an SH_GLSL_CORE_OUTPUT profile.
So we could generate shaders for Apple using core GL profile.
By switching to core profile, we still pass most WebGL conformance tests 1.0.2 on Linux, but not all, so apparently more work is needed.
However, I think it's OK to check this CL in because this output profile will be only used behind a chromium switch.
BUG=angleproject:933
TEST=webgl conformance tests
Change-Id: Iad70e1aebf82349d3fc5f4116c1d6bc4448193fd
Reviewed-on: https://chromium-review.googlesource.com/255282
Tested-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7749005a
|
2015-03-03T18:36:05
|
|
Fix min built-in function support
One of the recent change that uses generic types to compact
the symbol table initialization has introduced a bug in 'min'
function implementation, just fixing it here.
TEST= dEQP tests:
dEQP-GLES3.functional.shaders.operator.common_functions.min.lowp_uvec*
Change-Id: I0e3d386c89bc07c3b656ec5029b8ce57f663cf46
Reviewed-on: https://chromium-review.googlesource.com/255369
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c9d9b30a
|
2015-02-20T23:02:15
|
|
Set symbol extension at insertion.
BUG=angle:926
Change-Id: I4c96ae89c79d720d99bde803541c3158ba4629ab
Reviewed-on: https://chromium-review.googlesource.com/251662
Tested-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
05ae50dc
|
2015-02-20T10:16:47
|
|
Add basic support for HLSL output of switch and case
This patch outputs switch and case statements in HLSL, but ignores fall-through.
Switch statements that include fall-through cause the platform HLSL compiler to
generate errors.
BUG=angle:921
Change-Id: I10efbfb45076cf4fd79840698abafd8111e597d4
Reviewed-on: https://chromium-review.googlesource.com/251527
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
01cd8afa
|
2015-02-20T10:39:20
|
|
Add GLSL output of switch and case
BUG=angle:921
Change-Id: I0d752440ce6ffdfcc005f1a6123694bdfeb1b067
Reviewed-on: https://chromium-review.googlesource.com/251526
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c8716df9
|
2015-02-26T17:17:22
|
|
Fix an issue with handling an error case inside ValidateSwitch
In case a condition with a wrong type is given to a case statement, it
generates an error but the compiler recovers. This caused ValidateSwitch
to assert. Fix this.
BUG=angle:921
Change-Id: I7949798cab923c2b168817471896470c6c611878
Reviewed-on: https://chromium-review.googlesource.com/254080
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
482907eb
|
2015-02-23T16:56:33
|
|
Set symbol operations at insertion.
BUG=angle:926
Change-Id: Ifc8f62ebe1277214a4d3fbd5c56eb5faeff8e389
Reviewed-on: https://chromium-review.googlesource.com/251650
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e9cc469f
|
2015-02-19T16:00:13
|
|
Accept mismatching auxiliary interpolations.
The ES3.1 spec, and discussion on Khronos.org, confirm that dEQP is
correct in accepting mismatching centroid specifiers in shader
linkage. Mismatching flat/smooth is still a link error.
Fixes:
shaders.linkage.varying.rules.differing_interpolation_2
Change-Id: I3016f4147e7c1b16b02371ee95866c8daf826212
Reviewed-on: https://chromium-review.googlesource.com/251205
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
5cc9ac85
|
2015-02-20T11:27:56
|
|
Fix shadow samplers with textureProj and vertex shaders.
Fixes:
dEQP-GLES3.functional.shaders.texture_functions.textureproj.sampler2dshadow_fragment
dEQP-GLES3.functional.shaders.texture_functions.textureproj.sampler2dshadow_bias_fragment
dEQP-GLES3.functional.shaders.texture_functions.textureprojoffset.sampler2dshadow_fragment
dEQP-GLES3.functional.shaders.texture_functions.textureprojoffset.sampler2dshadow_bias_fragment
and some of:
dEQP-GLES3.functional.shaders.texture_functions.texture*.sampler2dshadow_vertex
BUG=angle:925
Change-Id: I080e379ded95469f0486ae9c8bb1756842118a2d
Reviewed-on: https://chromium-review.googlesource.com/251530
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
ac5274df
|
2015-02-20T10:19:08
|
|
Add validation for the structure of switch statements
Implement a traverser to check for the following errors:
-More than one default or replicated constant expression
-No statement between a label and the end of a switch statement
-Statements in a switch statement before the first case statement
-Mismatch between the type of init-expression and type of a case label
-Case or default label nested inside other control flow nested within the
corresponding switch
Tested by manually disabling shading language version checks for switch
and by manually enabling case statements in a Chromium build and checking
that the expected errors are generated.
BUG=angle:921
Change-Id: I99c49c17c8b520849adbe4d8521e46cb10e20e41
Reviewed-on: https://chromium-review.googlesource.com/251524
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3c1dfb5a
|
2015-02-20T11:34:03
|
|
Add stubs for switch and case output
BUG=angle:921
Change-Id: I58bd645a8d53ef5bad9b680e54c8948d50932fca
Reviewed-on: https://chromium-review.googlesource.com/251525
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
73941deb
|
2015-02-25T14:34:49
|
|
Disable the HLSL code in Angle if it is not being used.
We're only using the HLSL code in Windows so
it's not necessary to compile and distribute it on other platforms.
This adds a defined ANGLE_ENABLE_HLSL that can be checked in files that
are used by non-HLSL code as well. Mostly the HLSL code is just not
include by the build system.
Details of the space savings (heavily truncated)
Total change: -165717 bytes
===========================
-606 - Source: angle/src/common/utilities.cpp
-627 - Source: angle/src/compiler/translator/FlagStd140Structs.cpp
-695 - Source: /usr/include/c++/4.8/bits/stl_algo.h
-710 - Source: angle/src/compiler/translator/TranslatorHLSL.cpp
-713 - Source: angle/src/compiler/translator/IntermNode.h
-863 - Source: /usr/include/c++/4.8/bits/stl_map.h
-935 - Source: angle/src/compiler/translator/blocklayout.cpp
-1515 - Source: angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
-1655 - Source: angle/src/compiler/translator/UnfoldShortCircuit.cpp
-2375 - Source: /usr/include/c++/4.8/bits/vector.tcc
-3135 - Source: angle/src/compiler/translator/RewriteElseBlocks.cpp
-4656 - Source: angle/src/compiler/translator/UtilsHLSL.cpp
-5265 - Source: angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
-6505 - Source: /usr/include/c++/4.8/bits/stl_tree.h
-11480 - Source: angle/src/compiler/translator/UniformHLSL.cpp
-13580 - Source: angle/src/compiler/translator/StructureHLSL.cpp
-18964 - Source: ??
(constant strings and a few vtbls)
-89332 - Source: angle/src/compiler/translator/OutputHLSL.cpp
Change-Id: I23ccc98abd0a21f847dd34f9482800b3ba679d56
Reviewed-on: https://chromium-review.googlesource.com/251528
Tested-by: bratell at Opera <bratell@opera.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
53f076fa
|
2015-02-20T10:55:14
|
|
Add basic error checks for switch and case
Check that the case labels have constant scalar integers, and that switch
statements are initialized with scalar integers. Also check that case and
default labels do not exist outside switch statements. Allow break
statements inside switch statements.
Tested by manually disabling shading language version checks for switch
in a Chromium build and checking that the expected errors are generated.
BUG=angle:921
Change-Id: Ibe83d0db52958c493ded5640d4babf670dc02d55
Reviewed-on: https://chromium-review.googlesource.com/251523
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a3a36664
|
2015-02-17T13:46:51
|
|
Implement parsing switch statements
Put in some groundwork for parsing switch statements and case labels in
the parser, including definitions for IntermNode classes. Intermediate
functions for adding the statements are stubbed to only generate errors
for now.
Tested by manually disabling shading language version checks for switch
in a Chromium build and checking that the expected errors are generated.
BUG=angle:921
Change-Id: I064b3e0c4c1b724a083cf5bc78eebfdd3794eb1b
Reviewed-on: https://chromium-review.googlesource.com/250380
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
49300865
|
2015-02-20T14:54:49
|
|
Refactor validating jump statements out of glslang.y
Move the logic to ParseContext. This will simplify changing the logic for
the break statement that is needed to implement switch.
BUG=angle:921, angle:911
TEST=WebGL conformance tests
Change-Id: Ib8bbc7075c05d345e90377202b5446fb3307f94c
Reviewed-on: https://chromium-review.googlesource.com/251522
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
f3cc4aef
|
2015-02-23T13:51:25
|
|
Use generic types to compact the symbol table initialization.
Just like in the spec text, use symbolic types that represent multiple
concrete types. The few signatures that get generated more than once
are only added to the symbol table once because it ignores duplicates.
BUG=angle:926
Change-Id: I216f03d22502b724dbefc87c5a021d6021c3a434
Reviewed-on: https://chromium-review.googlesource.com/251620
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Nicolas Capens <capn@chromium.org>
|
|
6b19d765
|
2015-02-19T09:40:39
|
|
Implement missing variants of abs/sign
This change adds ANGLE support for abs/sign variants introduced
in ESSL3.
BUG=angle:923
TEST=Unit tests, dEQP tests
Unit Tests:
TypeTrackingTest.BuiltInAbsSignFunctionFloatResultTypeAndPrecision
TypeTrackingTest.BuiltInAbsSignFunctionIntResultTypeAndPrecision
dEQP tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.abs
dEQP-GLES3.functional.shaders.builtin_functions.common.sign
Change-Id: I2a3b028611f0eaaac3c031f8926d34a0e146663d
Reviewed-on: https://chromium-review.googlesource.com/251491
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
29190088
|
2015-02-20T16:42:54
|
|
Make Angle code 40 KB smaller by using string literals directly.
The implicit conversion of hundreds of string literals
to TString generated a lot of machine code. By keeping them
as string literals all the way the code will be smaller and faster.
This is the change with clang for x64 (note VisitUnary in particular):
Total change: -41392 bytes
==========================
2 added, totalling +469 bytes across 1 sources
2 removed, totalling -472 bytes across 1 sources
5 shrunk, for a net change of -41389 bytes (54126 bytes before, 12737 bytes after) across 1 sources
279692 unchanged, totalling 51433327 bytes
------------------------------------------------------------------------------------------------------------------------------------
-41392 - Source: /home/bratell/src/chromium/src/third_party/angle/src/compiler/translator/OutputHLSL.cpp - (gained 469, lost 41861)
------------------------------------------------------------------------------------------------------------------------------------
New symbols:
+328: sh::OutputHLSL::outputConstructor(Visit, TType const&, char const*, TVector<TIntermNode*> const*) type=t, size=328 bytes
+141: sh::OutputHLSL::outputTriplet(Visit, char const*, char const*, char const*) type=t, size=141 bytes
Removed symbols:
-133: sh::OutputHLSL::outputTriplet(Visit, std::basic_string<char, std::char_traits<char>, pool_allocator<char> > const&, std::basic_string<char, std::char_traits<char>, pool_allocator<char> > const&, std::basic_string<char, std::char_traits<char>, pool_allocator<char> > const&) type=t, size=133 bytes
-339: sh::OutputHLSL::outputConstructor(Visit, TType const&, std::basic_string<char, std::char_traits<char>, pool_allocator<char> > const&, TVector<TIntermNode*> const*) type=t, size=339 bytes
Shrunk symbols:
-388: sh::OutputHLSL::writeEmulatedFunctionTriplet(Visit, char const*) type=t, (was 628 bytes, now 240 bytes)
-714: sh::OutputHLSL::visitBranch(Visit, TIntermBranch*) type=t, (was 1017 bytes, now 303 bytes)
-9738: sh::OutputHLSL::visitAggregate(Visit, TIntermAggregate*) type=t, (was 17609 bytes, now 7871 bytes)
-14132: sh::OutputHLSL::visitBinary(Visit, TIntermBinary*) type=t, (was 17627 bytes, now 3495 bytes)
-16417: sh::OutputHLSL::visitUnary(Visit, TIntermUnary*) type=t, (was 17245 bytes, now 828 bytes)
Change-Id: Id0f87d72f6d7f1ab7b543f0d28d5a8b7c7db9ec7
Reviewed-on: https://chromium-review.googlesource.com/251090
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: bratell at Opera <bratell@opera.com>
|
|
80d934bb
|
2015-02-19T10:16:12
|
|
Enable MSVS warning 4512.
Fix up the missing DISALLOW_COPY_AND_ASSIGN macros and various small
problems preventing us from turning on this warning. This should
ensure we more often use the DISALLOW macro going forward.
Change-Id: I2e1a9d23a31a51279a577fad8dffb8c1530e2ee8
Reviewed-on: https://chromium-review.googlesource.com/251100
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Cooper Partin <coopp@microsoft.com>
Tested-by: Cooper Partin <coopp@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7c1f6f19
|
2015-02-19T18:56:09
|
|
Revert "Implement missing variants of abs/sign"
This for some reason is failing angle_unittests:
http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28NVIDIA%29/builds/13296
Happens across platforms.
This reverts commit 3e142e47cc5b40564bcdba4252fd326bc28ca343.
Change-Id: Ideb20457546c0dec10c9584182cc8d5ead42309d
Reviewed-on: https://chromium-review.googlesource.com/251160
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
b6e07a6a
|
2015-02-16T12:22:10
|
|
Implement ESSL3 modf
This is the first built-in function that has an out parameter, so l-value
checks are added for built-ins.
BUG=angle:918
Change-Id: Ifd5befe955224f706f864e25107879c9cdce9e9f
Reviewed-on: https://chromium-review.googlesource.com/250780
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
3e142e47
|
2015-02-19T09:40:39
|
|
Implement missing variants of abs/sign
This change adds ANGLE support for abs/sign variants introduced
in ESSL3.
BUG=angle:923
TEST=dEQP tests
Tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.abs
dEQP-GLES3.functional.shaders.builtin_functions.common.sign
Change-Id: If22032be2c1ed08451275262e311ef5ac613d45e
Reviewed-on: https://chromium-review.googlesource.com/251060
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
3eab00a0
|
2015-02-12T16:02:39
|
|
Fix constant folding integer modulus
Constant folding % used to generate results from division instead of
results from modulus. Fix this and introduce a test for this and other
integer constant folding, that checks that the right constant values are
found in the IntermNode tree.
BUG=angle:916
TEST=angle_unittests
Change-Id: I75e59b7734eb206378a1b2957af0a5437a90097c
Reviewed-on: https://chromium-review.googlesource.com/249691
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
0c1726e6
|
2015-02-18T14:35:02
|
|
Implement isnan/isinf
This change adds ANGLE support for isnan/isinf.
BUG=angle:922
TEST=dEQP tests:
dEQP-GLES3.functional.shaders.builtin_functions.common.isnan.*
(high precision tests still fail)
Tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.builtin_functions.common.isinf.*
Reduced number of errors in tests:
EQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.isnan.*
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.isinf_*
Change-Id: I52bf18b59365ea7031746ae840550162d7e6b96e
Reviewed-on: https://chromium-review.googlesource.com/250761
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|
|
2b45573b
|
2015-02-17T20:24:59
|
|
Implement missing vector relational functions
This change adds ANGLE support for following vector relational
function variants introduced in GLES3:
bvec lessThan(uvec x, uvec y)
bvec lessThanEqual(uvec x, uvec y)
bvec greaterThan(uvec x, uvec y)
bvec greaterThanEqual(uvec x, uvec y)
bvec equal(uvec x, uvec y)
bvec notEqual(uvec x, uvec y)
BUG=angle:920
TEST=dEQP tests
Reduced number of errors in tests:
dEQP-GLES3.functional.shaders.constant_expressions.builtin_functions.vector_relational.*
Change-Id: Id45ce77b35f39403e587a577622271d8e9815225
Reviewed-on: https://chromium-review.googlesource.com/250377
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a3a5cc6a
|
2015-02-13T13:12:22
|
|
Expose the IntermNode tree generated in the compiler for testing
This refactoring makes it possible for tests to access the IntermNode
tree produced by compilation by calling compileTree(). Removing
ParseContext usage from OutputHLSL has the additional benefit of better
separation between parsing and output.
BUG=angle:916
Change-Id: Ib40954832316328772a5c1dcbbe6b46b238e4e65
Reviewed-on: https://chromium-review.googlesource.com/249723
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
42077bb1
|
2015-02-16T15:32:37
|
|
Implement missing variants of min, max and clamp
BUG=angle:914
TEST=dEQP tests
Tests passing 100% because of this change:
dEQP-GLES3.functional.shaders.operator.common_functions.min.*
dEQP-GLES3.functional.shaders.operator.common_functions.max.*
dEQP-GLES3.functional.shaders.operator.common_functions.clamp.*
Reduced number of errors in tests:
EQP-GLES3.functional.shaders.constant_expressions.builtin_functions.common.*
These tests are not yet passing because of constant expressions
bug (angle bug:913)
Change-Id: Ibccee47ed78e994e40a0effe9afa9cf9692492b0
Reviewed-on: https://chromium-review.googlesource.com/250330
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
ff805cc3
|
2015-02-13T10:59:34
|
|
Separate integer and float modulus
Integer and float modulus are separated into Mod and IMod operator types
to make the code clearer and to make GetOperatorString return the correct
value for both.
Change-Id: Ibfbca2c558bf919b0eab6404d7349f87fe47a18c
Reviewed-on: https://chromium-review.googlesource.com/249692
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
09b22474
|
2015-02-11T11:47:26
|
|
Add addBinaryMath and addUnaryMath helpers to ParseContext
This refactoring reduces code duplication and moves functionality that is
not immediately related to the language grammar out of glslang.y.
BUG=angle:911
Change-Id: If5e225461890ed542dee01905829df1c9a6f5e27
Reviewed-on: https://chromium-review.googlesource.com/248570
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
1033e1d8
|
2015-02-12T12:03:13
|
|
Move operator definitions to their own file
This generalizes GetOperatorString so that it can be used outside
ValidateLimitations.
BUG=angle:911
Change-Id: I43a160b3d7d60388ad529a72f1720d3171f67315
Reviewed-on: https://chromium-review.googlesource.com/249073
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
9b82084f
|
2015-02-12T10:40:10
|
|
Fix HLSL varying struct linking.
We would always expand a struct name to always include its symbol
ID. This fixes the workaround to only affect scoped structs.
We can leave global structs, which are by definition uniquely named,
without decorating them with a symbol ID.
This fixes several tests in dEQP's shader.linkage.varying.struct.
Re-land with GLSL translator bug fixed.
BUG=angle:910
Change-Id: I23a932bd1dadea5e9aafabde697e6a2af9a43f2b
Reviewed-on: https://chromium-review.googlesource.com/249134
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
b960cc4a
|
2015-02-12T15:33:20
|
|
Revert "Allow varying structs to match between stages."
This patch has a bug which breaks the GLSL to GLSL translator.
See broken GPU FYI bot builds on the Chromium waterfall:
http://build.chromium.org/p/chromium.gpu.fyi/builders/Win7%20Release%20%28NVIDIA%29/builds/13074
This reverts commit 489ffc4d69656c2dbfdbe07e3fa6e38baeb3e072.
Change-Id: I8241c6d658f4f31af91b89af1141d3d778ff7c70
Reviewed-on: https://chromium-review.googlesource.com/249131
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
f4780c1c
|
2015-02-11T16:33:11
|
|
Use correct non-square register count in structs.
For struct varyings with nested structs, we would count registers
incorrectly, and produce D3D link errors.
This fixes tests in the dEQP's shaders.linkage.varying.struct.
BUG=angle:910
Change-Id: I47ea6dba36bf57cf94a7e7f30997c6c9096c2b40
Reviewed-on: https://chromium-review.googlesource.com/247243
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
489ffc4d
|
2015-02-11T16:33:07
|
|
Allow varying structs to match between stages.
We would always expand a struct name to always include its symbol
ID. This workaround fixed scoped structs with the same name. It
would also block any possiblity of linking the structs successfully.
Instead we can use the workaround only on inner-scoped structs, and
leave global structs, which are by definition uniquely named, as
they are.
This fixes several tests in dEQP's shader.linkage.varying.struct.
BUG=angle:910
Change-Id: I81b8dadc7ea493152aff0c44d607114eaaabb142
Reviewed-on: https://chromium-review.googlesource.com/247242
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
2857f489
|
2015-02-09T15:35:29
|
|
Fix struct uniform packing.
Our current code would not adapt properly for members that did
not fit in the previous register. Instead, use the correct adjusted
value as returned from the block layout encoder.
This fixes a dEQP WebGL test: gles2/shaders/linkage.
BUG=angle:910
Change-Id: Id77d0c76ce767665b3db97cb4d14e8008254fd9f
Reviewed-on: https://chromium-review.googlesource.com/247241
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
55e79e09
|
2015-02-09T15:35:00
|
|
Implement equality ops for nested structs.
This fixes the WebGL test glsl_misc_struct_equals as well as
several dEQP tests in functional.shaders.struct.
BUG=391957
BUG=angle:910
Change-Id: I09f3cd3f51bbc3541b64dbcfddfe01884ddba6f5
Reviewed-on: https://chromium-review.googlesource.com/247083
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
b3dced29
|
2015-01-12T14:54:55
|
|
Implementing gl_InstanceID in the HLSL compiler.
Fixes:
dEQP-GLES3.functional.instanced.draw_arrays_instanced.instance_id
dEQP-GLES3.functional.instanced.draw_arrays_instanced.mixed
dEQP-GLES3.functional.instanced.draw_elements_instanced.instance_id
dEQP-GLES3.functional.instanced.draw_elements_instanced.mixed
BUG=angle:601
Change-Id: I6e120eebc90d00e025fc58f096064e6ed1da826b
Reviewed-on: https://chromium-review.googlesource.com/246911
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
0fbd128c
|
2015-02-02T14:46:09
|
|
Extension behavior is now reset between each shader translation unit.
The extension behavior was being shared between translation units,
this was causing states to be cached between shader compilers. This
has been fixed now by adding a new ResetExtensionBehavior() function.
A unit test has also been added for testing extensions when compiling
shaders. A test has been included which tests that the internal state
of the extension behavior is being reset properly.
BUG=453543
Change-Id: Icb2a07019b5db972dc75cdbbdece4b7e9757c682
Reviewed-on: https://chromium-review.googlesource.com/245522
Tested-by: David Yen <dyen@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
37997145
|
2015-01-28T10:06:34
|
|
Defer dependent HLSL global var inits.
Some global initializers depend on other globals, for instance a
varying or attribute value. Since we use a static proxy variable for
these varyings, we need to initialize the global static after we
initialize the proxy in the shader preamble. This fixes a long-
standing compiler bug.
We should also add a WebGL test for this.
BUG=angle:878
Change-Id: I71db103a6b8c24fb862e0d8b32293da9bc2e8103
Reviewed-on: https://chromium-review.googlesource.com/243581
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
32aab01d
|
2015-01-27T14:12:26
|
|
Use a stack for OutputHLSL info log output.
Previously we would always reference mBody in several intermediate
output methods. This made using these traversals from within the
header, or for utility methods, very difficult. Instead, use a stack
where we write to the top InfoLog, and can push/pop from the stack.
This gives us more flexibility.
BUG=angle:878
Change-Id: I8a6c0382bad18b44d75158274c701db13d4d4e65
Reviewed-on: https://chromium-review.googlesource.com/243580
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
3ae6465f
|
2015-01-26T15:51:39
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I3df0fffb19f5ecbe439fbc2a8d6d239a5dc6b638
Reviewed-on: https://chromium-review.googlesource.com/243334
Tested-by: Austin Kinross <aukinros@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
1be8870b
|
2015-01-19T16:56:44
|
|
Avoid precision emulation overhead on unused values
Avoid rounding intermediate values when the intermediate value is not
consumed. For example, this avoids rounding the return value of
assignment, so "b = a;" becomes "b = frm(a);" instead of "frm(b =
frm(a))".
BUG=angle:874
TEST=compiler_tests
Change-Id: Ifcdb53fb1d07a2cf24e429cc237c2d0262dc32f8
Reviewed-on: https://chromium-review.googlesource.com/241852
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
74cafab1
|
2015-01-23T23:17:32
|
|
Revert "Fix lots of variable shadowing in ANGLE"
Caused WebGL CTS failures on the texture-npot test:
https://www.khronos.org/registry/webgl/sdk/tests/conformance/textures/texture-npot.html
This reverts commit c67e6e9fade44ef8938724e82db11db725e9c8e5.
Change-Id: I089e99859231e0d657084ac3647257c650a9da92
Reviewed-on: https://chromium-review.googlesource.com/243041
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
c67e6e9f
|
2015-01-21T16:01:07
|
|
Fix lots of variable shadowing in ANGLE
BUG=angle:877
Change-Id: I15168ae32605b26aee08274464ffe68adb5a7e87
Reviewed-on: https://chromium-review.googlesource.com/242351
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Austin Kinross <aukinros@microsoft.com>
|
|
e6664f06
|
2015-01-09T16:22:24
|
|
Added PointSprites Support for renderers that do not support Geometry Shaders
Change-Id: Iae9ac5f8fbba68dba5e49ccda7bb7eebb05c8e9a
Reviewed-on: https://chromium-review.googlesource.com/240450
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
31b5fc62
|
2015-01-16T12:13:36
|
|
Add support for bitwise operations in ESSL3
Add support for <<, >>, &, |, ^, and their compound assignment variants
<<=, >>=, &=, |=, ^=. Also add support for bitwise not (~).
BUG=angle:870
Change-Id: I5e6a835409589556d5d58d58078fdf505cfd8da5
Reviewed-on: https://chromium-review.googlesource.com/241850
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7700ff65
|
2015-01-15T12:16:29
|
|
Add basic support for ESSL3 vec2 (un)pack functions
The functions are emulated on HLSL, and use the native functions on
OpenGL 4.2+ and GLES3.0. Emulation for OpenGL versions <= 4.1 is not yet
implemented.
BUG=angle:865
Change-Id: I6803a1767dacdb3dca12f13924651fd38fcacb75
Reviewed-on: https://chromium-review.googlesource.com/240961
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
abf6dadd
|
2015-01-14T14:45:16
|
|
Implement matrix inverse built-in
Inverse is emulated in HLSL by calculating the cofactor matrix and
dividing that with the determinant. This results in the transpose of the
inverse as is required. Better performing options might exist especially
for 4x4 matrices, but this is enough for a working implementation.
BUG=angle:859
Change-Id: I5185797cc1ed86865f5f4342707abdc2977a186b
Reviewed-on: https://chromium-review.googlesource.com/240331
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d68157fc
|
2015-01-16T12:24:17
|
|
Fix issues related to modulus operator
Make sure that "scalar %= vector" is not approved by the compiler, and
that % and %= are only exposed on GLES3.
BUG=angle:854
Change-Id: I3ac7eb607bd86a6caa905d2bef5d397688ad3fd3
Reviewed-on: https://chromium-review.googlesource.com/241410
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Gregoire Payen de La Garanderie <Gregory.Payen@imgtec.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
80a5a6c6
|
2015-01-12T15:35:27
|
|
Clean up BuiltInFunctionEmulator public interface
This removes all language-specific bits from BuiltInFunctionEmulator
parent class, and makes the public interface of BuiltInFunctionEmulator
minimal.
Writing comments around emulated function definitions is removed from
OutputHLSL, they are not necessary as the emulated function definitions
are just another part of the shader header.
Change-Id: I9abf57d86f4e37b0674d7dfafe653298f205dd27
Reviewed-on: https://chromium-review.googlesource.com/240230
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e39706d0
|
2014-12-30T16:40:36
|
|
Implement simple ESSL3 matrix functions
Add support for built-in functions outerProduct, determinant, transpose
and the variations of matrixCompMult that were previously unsupported.
BUG=angle:859
Change-Id: Ie2b9cf83cd80c5a886c6d4eb190c7ce25a32d0a4
Reviewed-on: https://chromium-review.googlesource.com/239873
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
e17e3197
|
2015-01-02T12:47:59
|
|
Use BuiltInFunctionEmulatorHLSL for all emulated functions
Implementation of missing built-in functions is a separate concern from
outputting the intermediate tree itself as HLSL, so it makes sense to
have all of the built-in emulation in a class that is separate from
OutputHLSL. Being able to reuse the same logic for different emulated
functions also makes the code more compact.
Change-Id: Id503dc3a5c5e743ec65722add56d6ba216a03a7f
Reviewed-on: https://chromium-review.googlesource.com/239872
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
2aafa18b
|
2015-01-08T19:04:48
|
|
Fix null check after addUnaryMath is called for a built-in function
The intermTypedNode pointer null check should be done before the pointer
is used, not after. In practice the pointer should never be null if
IntermUnary::promote() is consistent with the built-in function table,
but it's useful to have the null check as a fail-safe when developing.
Change-Id: I24e0d7399ef9d628f474e99fbca08dbd67fdd8c3
Reviewed-on: https://chromium-review.googlesource.com/240411
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
9e0478f6
|
2015-01-13T11:13:54
|
|
Move the block layout code to translator.
This code is easily accessible from the translator, with the proper
export calls. This facilitates adding a common static library, since
this code calls some methods in translator.
BUG=angle:773
Change-Id: I0c50098ec3f67c2df7749b3c2518be0a9fd939e2
Reviewed-on: https://chromium-review.googlesource.com/240093
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
f6bdb312
|
2015-01-09T15:21:38
|
|
Refactor defining emulated functions in BuiltInFunctionEmulator
This removes the fixed enumeration of emulated functions in favor of a
dynamic map. This makes the code more compact and flexible. The main
benefit is that maintaining the list emulated functions is a lot simpler
now.
Change-Id: Ic9951a496b9f021c76ad5b4c3daccd89af5ac093
Reviewed-on: https://chromium-review.googlesource.com/239871
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nicolas Capens <capn@chromium.org>
|