|
b8b0122f
|
2016-11-20T23:25:53
|
|
Add compiler support for shared memory
The patch adds handling of the 'shared' qualifier in the shader
compiler.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: Iaa288026af0faf2a30e40495faa6ea1f5ff02323
Reviewed-on: https://chromium-review.googlesource.com/413200
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
aecfa8e6
|
2016-12-09T12:47:26
|
|
Constant fold compute shader local work group size
gl_WorkGroupSize should be written into the AST as a constant node
instead of a symbol node. In correct shaders, local size is guaranteed
to have been declared before any references to gl_WorkGroupSize -
otherwise the shader translator was already generating an error.
This ensures that work group size can be used to size arrays as
specified and also works around a crash issue on NVIDIA Linux OpenGL
driver.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: I9b1a4bff16ecf2c3db1511c3702756346cdd2f6b
Reviewed-on: https://chromium-review.googlesource.com/418735
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2d73665d
|
2016-11-30T10:37:49
|
|
Handle constant folding arithmetic involving infinity
Constant folding arithmetic operations that involve infinity are now
handled correctly in the cases where the result is infinity or zero.
The implementation mostly relies on C++ to implement IEEE float
arithmetic correctly so that unnecessary overhead is avoided.
Constant folding arithmetic operations that result in overflow now
issue a warning but result in infinity. This is not mandated by the
spec but is a reasonable choice since it is the behavior of the
default IEEE rounding mode.
Constant folding arithmetic operations that result in NaN in IEEE will
generate a warning but the NaN is kept. This is also not mandated by
the spec, but is among the allowed behaviors.
There's no special handling for ESSL 1.00. ESSL 1.00 doesn't really
have the concept of NaN, but since it is not feasible to control
generating NaNs at shader run time either way, it should not be a big
issue if constant folding may generate them as well.
TEST=angle_unittests
BUG=chromium:661857
Change-Id: I06116c6fdd02f224939d4a651e4e62f2fd4c98a8
Reviewed-on: https://chromium-review.googlesource.com/414911
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
08d4aa93
|
2016-11-23T16:15:49
|
|
Refactor constant folding tests
The constant folding test classes are moved into a separate file in
test_utils. This will enable adding multiple test files that use
constant folding test classes, so that constant folding tests can be
organized better.
TEST=angle_unittests
BUG=chromium:661857
Change-Id: I00bf25a4b941bdc1364ff5aa9bee2d571e4b0ea0
Reviewed-on: https://chromium-review.googlesource.com/414910
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f1a2aefc
|
2016-11-25T11:03:56
|
|
Test shader built-in corner cases in constant folding tests
IEEE rules for generating zero or infinity are now checked for the
constant folding of several built-in functions except for the cases
where ESSL 3.00.6 explicitly states that the results are undefined.
BUG=chromium:661857
TEST=angle_unittests
Change-Id: I2ce427229a5583039694d060ea6db29c5bdace97
Reviewed-on: https://chromium-review.googlesource.com/414370
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
28cb0368
|
2016-11-22T15:42:37
|
|
Check for misconfiguration of shader built-ins
Fail compiler initialization if the built-in resources are invalid.
This avoids creating zero-sized arrays out of built-ins into the
symbol table, which could later lead to asserts when these built-ins
were indexed by constants.
BUG=chromium:667468
TEST=angle_unittests
Change-Id: I9553c7c91ea355abb35b9cc6088ee14b40b0922b
Reviewed-on: https://chromium-review.googlesource.com/413037
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
1b896c62
|
2016-11-16T13:10:44
|
|
translator: remove code related to for-loop unrolling
For loop unrolling is not used and causes the translator fuzzer to find
a hang when unrolling tons of nested loops (duh).
Also remove MMap.h which was unused.
This is essentially a revert of https://codereview.appspot.com/4331048
BUG=chromium:665255
Change-Id: Id6940f7e306d4ed53bc992f751e9ffe733190f17
Reviewed-on: https://chromium-review.googlesource.com/412023
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
99bd5f40
|
2016-11-07T12:44:29
|
|
Fix GLSL float parsing corner cases
This fixes parsing floats that are out-of-range, and floats that have
more digits than the standard library float parsing functions can
handle. In these cases, we now fall back to a custom implementation of
float parsing. The custom parsing path can correctly process floats
with up to hundreds of millions of digits in their mantissa part.
Rounding behavior of the custom float parser may not be entirely
consistent with the standard parser, but the error should be at most
a few ULP. This can be considered acceptable since floating point
operations are not expected to be exact in GLSL in general. Settling
for lower accuracy also enables the parser to run in constant memory,
instead of having to store all the significant digits of the decimal
mantissa being parsed.
BUG=angleproject:1613
TEST=angle_unittests
Change-Id: I04a5d9ae5aaca48ef14b79cca5b997078614eb1c
Reviewed-on: https://chromium-review.googlesource.com/412082
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
049edfa2
|
2016-11-11T14:35:37
|
|
Add volatile, coherent and restrict memory qualifiers
The patch adds support for the three remaining memory qualifiers:
volatile, coherent and restrict.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: Ie662d304af2399468df1d976e04c38dada1e2cec
Reviewed-on: https://chromium-review.googlesource.com/385876
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
55644211
|
2016-11-08T11:07:34
|
|
Fix constant folding right shift corner cases
Right-shifting the minimum signed integer needs to be handled as a
special case, since it can't go through the usual path that clears the
sign bit.
Code for right-shifting by zero also had a typo that resulted in
setting the wrong value to the result.
BUG=chromium:662706
TEST=angle_unittests
Change-Id: Ief24d738064906a72212242e0917ce30e45d6b25
Reviewed-on: https://chromium-review.googlesource.com/408158
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
45bcc784
|
2016-11-07T13:58:48
|
|
translator: Scope all classes with "sh".
I was seeing an odd problem with our PoolAlloc conflicting with the
glslang/Vulkan TIntermNode, so the fix was to move everything to a
separate namespace.
The bison grammars are also regenerated. No functional changes.
BUG=angleproject:1576
Change-Id: I959c7afe4c092f0d458432c07b4dcee4d39513f3
Reviewed-on: https://chromium-review.googlesource.com/408267
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
acb4b81a
|
2016-11-07T13:50:29
|
|
translator: Put ShaderLang APIs in "sh" namespace.
Working with glslang in Vulkan means we are static linking libANGLE
with functions that have the same name as our translator APIs. We
can fix this by scoping our APIs. We don't need to scope the types
of the file, since they don't conflict.
This will require a follow-up patch to remove the unscoped APIs
once we switch over Chromium.
We also scope TCompiler and some related classes to avoid multiply
defined link errors with glslang.
BUG=angleproject:1576
Change-Id: I729b19467d2ff7d374a82044b16dbebdf2dc8f16
Reviewed-on: https://chromium-review.googlesource.com/408337
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
bbe9fb5e
|
2016-11-03T17:16:05
|
|
Check that implicitly sized array constructors have arguments
Array size must be greater than zero according to the ESSL 3.00.6
spec.
BUG=angleproject:1602
TEST=angle_unittests
Change-Id: I1fa54b143bc821583822cbc5139464cdd058b6c1
Reviewed-on: https://chromium-review.googlesource.com/407257
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
e7dc9d71
|
2016-11-03T16:58:47
|
|
Fix handling bvec on the right hand side of a logical op
The vector/matrix size matching is not done for logical ops similarly
to other binary ops. For that reason both left and right hand side
need to be checked for being scalar.
BUG=angleproject:1601
TEST=angle_unittests
Change-Id: Ie87da68d6cb0d439f0e6273d374fc7d836c82309
Reviewed-on: https://chromium-review.googlesource.com/406988
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
02bd82cd
|
2016-11-03T10:29:43
|
|
Fix handling unsized arrays with incorrect initializer
In case the initializer of an unsized array is not an array, the array
size still needs to be set to some value > 0 in order to not hit
asserts in the code that parses accessing the array. An error was
already being generated in the case an unsized array has a non-array
initializer, but the variable will still have an array type in the
symbol table.
BUG=chromium:661592
TEST=angle_unittests
Change-Id: I4a11527eab0404ba9e59ebb7227faef13dbea62c
Reviewed-on: https://chromium-review.googlesource.com/407256
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
0982a2bf
|
2016-11-01T15:13:46
|
|
Prefix internal names in GLSL output
Prefixing internal names will avoid clashes with user-defined names.
We use prefix webgl_angle_ so that the internal names are both
reserved in WebGL on one hand and clearly separated from hashed names
starting with just webgl_ on the other hand.
BUG=angleproject:1597
TEST=WebGL conformance tests
Change-Id: I7deef9c1a38105c8b57eda13c84eec13e515a91a
Reviewed-on: https://chromium-review.googlesource.com/406247
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
0e3aee3f
|
2016-10-27T12:56:38
|
|
Check precision qualification for all declarations
Precision qualification is now checked properly also for declarations
that don't have qualifiers.
BUG=angleproject:1574
TEST=angle_unittests
Change-Id: I3d186df0763e071614c1da9a355a6f6fefdc8091
Reviewed-on: https://chromium-review.googlesource.com/403949
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
de318b26
|
2016-10-25T16:18:25
|
|
Disallow samplers as ternary operands
Quoting the ESSL 1.00 spec section 4.1.7: "Except for parameters to
texture lookup functions, array indexing, structure field selection,
and parentheses, samplers are not allowed to be operands in
expressions."
ESSL 3.00 has a similar passage related to opaque types.
Validate this correctly. Compatibility risk should be low, since
attempting to use samplers in ternary operators was already failing
before this in most cases.
BUG=angleproject:1551
TEST=angle_unittests
Change-Id: I6cbb536f473ba9674d558b14a458f3799f9c7c9c
Reviewed-on: https://chromium-review.googlesource.com/402694
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2cc85b3b
|
2016-08-05T16:22:53
|
|
Add support for images in the compiler
The patch adds support for GLSL ES 3.1 image types.
Internal format layout qualifiers for images are added.
Support for the readonly and writeonly qualifiers are added. The other
memory qualifiers are omitted as to make the patch simpler.
Tests are added which check for correct and incorrect usage of images,
internal format layout and memory qualifiers.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: Ie4d3acb2a195de11b405ad54110a04c4c1de0b7e
Reviewed-on: https://chromium-review.googlesource.com/378855
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
635671dc
|
2016-10-20T07:57:36
|
|
Fix pruning empty declarations from loop headers
Empty declarations are possible in loop init expressions. Make
PruneEmptyDeclarations take this into account.
BUG=angleproject:1550
TEST=angle_unittests
Change-Id: If407babf9b6f7a26dfcf73ff345493d3e2af3f9a
Reviewed-on: https://chromium-review.googlesource.com/401147
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
336b1470
|
2016-10-05T16:37:55
|
|
Split TIntermFunctionDefinition from TIntermAggregate
This makes the code easier to understand. Function definition nodes
always have just two children, the parameters node and the function
body node, so there was no proper reason why they should be aggregate
nodes.
As a part of this change, intermediate output is modified to print
symbol table ids of functions so that debugging function id related
functionality will be easier in the future.
After this patch, TIntermAggregate is still used for function
prototypes, function parameter lists, function calls, variable and
invariant declarations and the comma (sequence) operator.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ib88b4ca5d21abd5f126836ca5900d0baecabd19e
Reviewed-on: https://chromium-review.googlesource.com/394707
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
4310354e
|
2016-10-10T12:28:13
|
|
Handle corner cases of shifting signed integers better
Right-shifting a negative number should sign-extend according to the
ESSL 3.00.6 spec. Implement sign-extending right shift so that it
doesn't hit any undefined behavior in the C++ spec. Negative lhs
operands are now allowed for bit-shift right.
Also implement bit-shift left via conversion to unsigned integer, so
that it does not hit signed integer overflow. Negative lhs operands
are now allowed also for bit-shift left as well.
BUG=chromium:654103
TEST=angle_unittests
Change-Id: Iee241de9fd0d74c2f8a88219bddec690bb8e4db2
Reviewed-on: https://chromium-review.googlesource.com/395688
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
d569619d
|
2016-10-06T11:09:24
|
|
translator: Fail compilation if precision emu unsupported.
The fuzzer uncovered a case where we were trying to emulate precision
on HLSL 3.0, causing an ASSERT crash.
BUG=chromium:653276
Change-Id: I2e666a1ff4f605541e25f04264146063559cb835
Reviewed-on: https://chromium-review.googlesource.com/394237
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
7f9a55f7
|
2016-10-03T14:32:08
|
|
Fix integer math overflows in the preprocessor
Evaluating integer expressions in the ESSL preprocessor may result in
overflowing the signed integer range. Implement wrapping overflow for
preprocessor expressions in a way that doesn't hit any undefined
behavior. In the ESSL spec, preprocessor expressions are defined to
have mostly the same semantics as in C++. Since C++ doesn't define
what happens on signed integer overflow, we choose to make most of the
operators wrap on overflow for backward compatibility and consistency
with the rest of the ESSL spec.
We reuse the existing wrapping overflow helpers that are
used for constant folding. To be able to do this, the type used in the
preprocessor expression parser is changed from 64-bit to 32-bit.
Shifting negative numbers is implemented as a logical shift. This
cannot be disallowed since dEQP requires shaders shifting negative
numbers to pass compilation.
Undefined bitwise shifts where the offset is greater than 31 will now
result in a compile-time error.
A couple of test cases are now covered by the preprocessor tests
rather than full compilation tests. This isolates the tests better and
they run faster.
BUG=chromium:652223
TEST=angle_unittests
Change-Id: I84be40d404c10ecd0846c5d477e626a94a2a8587
Reviewed-on: https://chromium-review.googlesource.com/392146
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
f51fdd2e
|
2016-10-03T10:03:40
|
|
Ensure that all functions have a body node in the AST
Some traversers that insert code to main() assume that the main()
function has a non-null body node in place. This assumption was
previously wrong, since functions could be missing the body node
in case the function body was empty.
Fix possible invalid dereferencing of missing function body nodes by
always adding an empty sequence node to represent the body of
functions that have an empty body in the ESSL source. This also
enables simplifying some tree traversers that used to take the
possibility of missing function body nodes into account.
Also fix AddDefaultReturnStatements to check the last statement inside
the function body for a return statement, instead of checking the
first statement.
BUG=angleproject:1539
TEST=angle_unittests, angle_end2end_tests
Change-Id: I2fbd18c78653fa2f1a96dbd9a619accc4874030d
Reviewed-on: https://chromium-review.googlesource.com/392046
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
42fad76d
|
2016-09-28T10:06:29
|
|
Handle negation of minimum representable integer
Negating the minimum representable integer overflows, so it
has undefined behavior in C++. Handle this as a special case in the
code.
BUG=chromium:637050
TEST=angle_unittests
Change-Id: Ic6e6d638faddad9b70b5d1637bb4b42ef4f43784
Reviewed-on: https://chromium-review.googlesource.com/390551
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
1be4d493
|
2016-09-27T11:15:38
|
|
Fix handling integer overflow in constant folding
Integer operations that overflow are defined to wrap in the ESSL
3.00.6 spec. Constant folding that happens inside the shader
translator should also follow the wrapping rules.
The new implementations of wrapping integer addition and subtraction
use unsigned integers to perform calculations. Unsigned integers are
defined to implement arithmetic in modulo 2^n in the C++ spec. This
behavior is also leveraged to implement wrapping unsigned integer
multiplication.
The implementation of wrapping signed integer multiplication is
slightly trickier. The operands are casted to a wider type to perform
the multiplication in a way that doesn't overflow, and then the result
is truncated and casted back to the narrower integer type.
Incorrect tests that expected errors to be generated from integer
overflow in constant folding are removed.
BUG=chromium:637050
TEST=angle_unittests
Change-Id: I0de7e25881d254803455fbf22907c192f49d09ff
Reviewed-on: https://chromium-review.googlesource.com/390252
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
d4453573
|
2016-09-27T13:21:46
|
|
Fix integer division constant folding corner cases
ESSL has undefined behavior when the integer modulus operator is used
on negative operands. Generate a warning and fold the result to zero
in this case.
In case the minimum representable signed integer is divided by -1, the
result is defined to be either the maximum or minimum representable
value. We choose to fold the calculation to the maximum representable
value in this case.
BUG=angleproject:1537
TEST=angle_unittests
Change-Id: I57fac6b54a3553b7a0f0e36cc6ba0ed59a88eea9
Reviewed-on: https://chromium-review.googlesource.com/390251
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2cacb778
|
2016-09-26T08:50:40
|
|
Fix folding shifts when operands have different signedness
The code used to incorrectly assert that the right-hand side of shift
should have the same signedness as the left-hand side. Instead simply
assert that both the lhs and rhs are integer typed, and also don't
rely on aliasing via union when accessing bit shift operands.
Also disallow constant folded bit shifts where the right hand side is
greater than 31. Shifting with values greater than the width of the
type has undefined results in both ESSL and C++.
BUG=chromium:648135
TEST=angle_unittests
Change-Id: I84a99abc55f0eeda549b4781e954d17ba7b87552
Reviewed-on: https://chromium-review.googlesource.com/389351
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d4a07fbb
|
2016-09-20T10:24:23
|
|
Disallow bit-shifting when the left operand is negative.
BUG=648063
Change-Id: I82d9fbdaf8791a396dd71eeb57d93967ba5d65bf
Reviewed-on: https://chromium-review.googlesource.com/387115
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
415f29e0
|
2016-09-07T16:37:38
|
|
Disallow layout+invariant combo on ESSL 3.00 variable declarations
This combination is not allowed by the formal grammar in the ESSL 3.00
spec, and should still be disallowed in ESSL 3.00 shaders even though
the shader parser now implements the more flexible ESSL 3.10 grammar.
BUG=angleproject:1507
TEST=angle_unittests
Change-Id: I766a468fd7314c7e60e020b5b204aa6950263633
Reviewed-on: https://chromium-review.googlesource.com/381933
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
7ebb97fc
|
2016-09-08T18:01:50
|
|
Use 64-bits compile options
BUG=chromium:645071
Change-Id: I31825123bf4cb45fb37a93f538e8936487beb5ff
Reviewed-on: https://chromium-review.googlesource.com/382712
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d0bad2c7
|
2016-09-09T18:01:16
|
|
Split ternary node class from TIntermSelection
Ternary operator nodes are typed parts of expressions, they always
have two children and the children are also guaranteed to be
TIntermTyped. "If" selection nodes can't be a part of an expression,
they can have either one or two children and the children are code
blocks. Due to all of these differences it makes sense to store these
using two different AST node classes.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I913ab1d806e3cdb5c21106f078cc9c0b6c72ac54
Reviewed-on: https://chromium-review.googlesource.com/384512
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
87d410c8
|
2016-09-05T13:33:26
|
|
Disallow multiple locations on output variables
GLSL ES specs from version 3.00 to 3.20 all mention that output layout
location qualifier may appear at most once within a declaration.
Enforce this rule when parsing shaders.
Also set max draw buffers to 8 when compiling GLSL ES >= 3.00 in the
qualification order tests and shader translator sample, so that
parsing locations > 0 will succeed.
BUG=angleproject:1505
TEST=angle_unittests
Change-Id: I50fe409041385f5e10e695f43dc3a572433e9772
Reviewed-on: https://chromium-review.googlesource.com/381211
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
a223430c
|
2016-08-31T12:05:39
|
|
Promote unary nodes automatically
Unary nodes now get their type set automatically based on the
operation and operand. The operand should only be changed to another
of the same type after the node is constructed. The operation can't
be changed on unary and binary nodes after they've been constructed.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Ib1ea3dcb1162261966c02d5f03d8091cf647fac1
Reviewed-on: https://chromium-review.googlesource.com/378935
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3272a6d3
|
2016-08-29T17:54:50
|
|
Promote and fold indexing nodes similarly to other binary ops
Indexing nodes now get their type set in TIntermBinary::promote, same
as math and logic ops. They are also constant folded through
TIntermBinary::fold() instead of having special functions for constant
folding them in ParseContext.
Index nodes for struct and interface block member access now always
have integer type, instead of sometimes having the type of the field
they were used to access.
Usage of TIntermBinary constructor is cleaned up so only the
constructor that takes in left and right operands is used. The type
of TIntermBinary nodes is always determined automatically.
Together these changes make the code considerably cleaner.
Note that the code for constant folding for array indexing is actually
never hit because constant folding array constructors is still
intentionally disabled in the code.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Ifcec45257476cdb0d495c7d72e3cf2f83388e8c5
Reviewed-on: https://chromium-review.googlesource.com/377961
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
613b959d
|
2016-09-05T12:05:53
|
|
Clean up qualification order checks
Move determining whether qualification order checks are relaxed to
QualifierTypes.cpp. The ParseContext only needs to construct
TTypeQualifierBuilder with the shader version as a parameter, and it
will make the decision based on that. ParseContext still passes
diagnostics to the TTypeQualifierBuilder functions that return
variable qualification to make it more explicit when errors are
generated.
Also encapsulate looking for symbols in the AST inside
compiler_test.cpp.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: I4190e6a680ace0cc0568a517e86353a95cc63c08
Reviewed-on: https://chromium-review.googlesource.com/380556
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
c28888b3
|
2016-07-22T15:27:42
|
|
Relax checks when parsing type qualifiers in GLSL ES 3.10
The grammar in GLSL ES 3.10 does not impose a strict order on the
qualifiers and also allows multiple layout qualifiers.
This patch relaxes the checks when parsing a type qualifier.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: Ib3653a1ed1bfced099a6b2cbf35a7cd480c9100a
Reviewed-on: https://chromium-review.googlesource.com/379016
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
70866b89
|
2016-07-22T15:27:42
|
|
Change grammar to support features from es31
The grammar has been changed so that ES31 grammar is followed more
closely. The ES31 grammar is not fully supported, only functionality
related to qualifier enumeration is added.
The ParseContext is changed so that type qualifiers can be now joined
together (i.e. like layout qualifiers). This will allow enumeration of
multiple storage qualifiers (i.e. uniform readonly coherent) which is
essential for support of ES31 features.
Some of the error checks had to be moved closer to the root of the
parse tree since some of the information about the expression might be
missing.
Unfortunately, as there is no explicit ordering imposed by the
grammar, additional checks for proper order of qualifiers had to be
added. I also included unit tests which test against malformed
shaders.
BUG=angleproject:1442
TEST=angle_end2end_tests
TEST=angle_unittests
TEST=dEQP-GLES3.functional.shaders.*precision*
TEST=dEQP-GLES3.functional.shaders.*function*
TEST=dEQP-GLES2.functional.shaders.*
Change-Id: Ib3653a1ed1bfced099a6b2cbf35a7cd480c9100d
Reviewed-on: https://chromium-review.googlesource.com/362940
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
e5bb72ff
|
2016-09-01T01:41:27
|
|
Remove SH_EMULATE_BUILT_IN_FUNCTIONS which isn't used
The flag is not used in chrome. We decide to do per emulation per flag.
BUG=chromium:642227
Change-Id: I936d53e5015186e35e672d0cb51c853a941582d2
Reviewed-on: https://chromium-review.googlesource.com/379077
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
d5da505d
|
2016-08-29T13:16:55
|
|
Fix constant folding non-square outerProduct
Use all the vector elements correctly when constant folding non-square
outerProduct. Previously the code used to discard some elements of the
smaller outerProduct operand. Also clear up confusion about matrix
rows/columns in matrix constant folding code in general.
BUG=angleproject:1482
TEST=angle_unittests
Change-Id: I7cba8f97a92b875de01e57255d54258cdfd92a47
Reviewed-on: https://chromium-review.googlesource.com/377298
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
558b038c
|
2016-08-26T17:54:34
|
|
Don't accept sampler operands for unary operators
Unary plus and minus used to be accepted with sampler operands.
Increment/decrement operators also now generate a clearer error
message if a sampler operand is supplied.
TEST=angle_unittests
BUG=angleproject:1480
Change-Id: I2c5165c4eaac7b023d96e46a177e36f6536b0125
Reviewed-on: https://chromium-review.googlesource.com/376319
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4c4c8e72
|
2016-08-04T12:25:34
|
|
Add compute program compilation and linking support
Compute shaders can be now compiled and linked to create programs.
Some tests are added to verify successful and unsuccessful compute
shader linking.
The patch also replaces std::array<int, 3> with a custom struct
WorkGroupSize.
BUG=angleproject:1442
TEST=angle_end2end_tests
TEST=angle_unittests
Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84
Reviewed-on: https://chromium-review.googlesource.com/366740
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f69682be
|
2016-08-16T14:50:42
|
|
Add unittests to verify invariant doesn't leak
This is a followup CL of
https://chromium-review.googlesource.com/366720. Unittests is added to
check invariant status does not leak across shaders.
This CL also moves mInvariantVaryings and mGlobalInvariant from
TSymbolTable to TSymbolTableLevel. So at the end of a compilation, the
levels pop, and the settings will be cleared and will not affect the
next compilation.
Change-Id: I1199fade7a637276ab149ab9a599621b9977298b
Reviewed-on: https://chromium-review.googlesource.com/370844
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
244be01a
|
2016-08-18T15:26:02
|
|
Fix struct compound assignment being allowed in GLSL parsing
The shader translator used to accept some invalid struct operations,
like struct += struct and struct == struct with a different type. Fix
this.
BUG=angleproject:1476
TEST=angle_unittests
Change-Id: Ia2303fc1f740da4d78242e094ee6004b07364973
Reviewed-on: https://chromium-review.googlesource.com/372718
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4e94fea8
|
2016-08-09T14:31:37
|
|
Emulate gl_FragColor broadcasting behavior when GL_EXT_draw_buffers is
enabled.
BUG=angleproject:1467,635433
TEST=WebGL conformance, angle_unittests
Change-Id: I9eb4ce715732087a3786da886f42243716f2b9b2
Reviewed-on: https://chromium-review.googlesource.com/367532
Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
b088360f
|
2016-08-04T17:48:58
|
|
Add compute shader special variables
Support is added for the compute shader special variables given in
OpenGL GLSL ES 3.1 Revision 4, 7.1.3 Compute Shader Special Variables.
Unit tests are added for legal and illegal usage of the special
variables.
BUG=angleproject:1442
TEST=angle_unittests
Change-Id: Idb25811c15c4044c55c611c0e73ef26eb5b3e9d7
Reviewed-on: https://chromium-review.googlesource.com/366661
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
802abe01
|
2016-08-04T17:48:32
|
|
Add compute shader compilation support in the glsl compiler
Support is added for compute shader compilation. There is a small
extension to the parser so that 'local_size_x = ', 'local_size_y = '
and 'local_size_z = ' are supported as layout qualifiers.
A few shader compilation tests are added and one which checks the AST
whether the layout qualifiers are properly parsed.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I67283797d1cf13fa4ac47faa2a6e66d93a2db867
Reviewed-on: https://chromium-review.googlesource.com/362300
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e93d24ef
|
2016-07-28T12:06:05
|
|
Add es3.1 shader constants
The patch adds all shader built-in constants.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I81cae479d6506a8faa2dce023d5fcc2c1291d521
Reviewed-on: https://chromium-review.googlesource.com/364460
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
461e3af8
|
2016-07-21T18:15:34
|
|
preprocessor: Fix negative shift with bad ids.
Fix this by producing an error on undefined or negative shifts.
BUG=629518
Change-Id: Idfca5ed3fc8e557f6178408f3426a5ef2ce7cf14
Reviewed-on: https://chromium-review.googlesource.com/362020
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
e58e1416
|
2016-07-18T16:40:46
|
|
ShCheckVariablesWithinPackingLimits add sh::ShaderVariable overload
This overload doesn't take a stripped down version of the variable
information, which makes it possible to handle varying structs
correctly by flattening them as individual variables.
BUG=621031
Change-Id: I367629fce3d17dd7e1f876c5937eb37f3d97c7f4
Reviewed-on: https://chromium-review.googlesource.com/361460
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
90892fbd
|
2016-07-14T14:44:51
|
|
Refine swizzle/indexing constant folding code
Fix constant folding of subscripting non-square matrices. Previously
constant folding would offset the pointer into the matrix in multiples
of the number of columns, when it should offset the pointer in
multiples of the number of rows.
Also change the MalformedShaderTest so that it only succeeds if vector
swizzle is being checked correctly. Previously compilation would fail
in the test either way because the shader code contained a call to an
undefined function.
Also refactor indexing checks and constant folding so that constant
folding is done entirely separately from out-of-range checks. Bogus
comments are removed from the constant folding functions.
BUG=angleproject:1444
TEST=angle_unittests, angle_end2end_tests
Change-Id: I7073b38f759e9b3635ee05947df4f6d8e23a39d5
Reviewed-on: https://chromium-review.googlesource.com/360112
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b741c761
|
2016-06-29T15:49:22
|
|
Support precision emulation on HLSL
Re-submit with missing virtual destructor and angle::NonCopyable
added.
Add precision emulation support to HLSL 4.1 output. This makes it
possible for developers to test their shaders for precision issues
easily on Chrome on Windows without having to use the GL backend. The
patch has been verified with Chrome on Windows to reproduce some
precision bugs in real-world WebGL content, including old versions of
the babylon.js library.
The EmulatePrecision AST transformation still relies on writing out
raw shader code for the rounding functions, with raw HLSL code added
alongside pre-existing GLSL and ESSL code. In some ways it would be
nicer to do the EmulatePrecision step as a pure AST transformation,
but on the other hand the raw code is much more readable and easier
to optimize.
To better support multiple output languages in EmulatePrecision, add a
RoundingHelperWriter class that has different subclasses for writing
the rounding functions in different languages.
The unit tests are expanded to cover the HLSL output of precision
emulation. The parts of the tests that require the HLSL output are
only active on Windows where ANGLE_ENABLE_HLSL define is added to the
unit tests. Putting the HLSL tests in an entirely separate file is a
worse alternative, since it would require either a lot of code
duplication or add a lot of boilerplate to the individual tests.
BUG=angleproject:1437
TEST=angle_unittests
Change-Id: I47d501037c206f4bd8b976d3acab9b21c717084c
Reviewed-on: https://chromium-review.googlesource.com/360152
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3fdaf6f2
|
2016-07-13T15:07:41
|
|
Revert "Support precision emulation on HLSL"
Forgot to add virtual destructors.
BUG=angleproject:1437
This reverts commit a42e8b2cb9d0857f53c0490b5be3bf25b4e1f827.
Change-Id: If33fecfeca9947deedf4668c64dbadf25a5dc5eb
Reviewed-on: https://chromium-review.googlesource.com/360122
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
a42e8b2c
|
2016-06-29T15:49:22
|
|
Support precision emulation on HLSL
Add precision emulation support to HLSL 4.1 output. This makes it
possible for developers to test their shaders for precision issues
easily on Chrome on Windows without having to use the GL backend. The
patch has been verified with Chrome on Windows to reproduce some
precision bugs in real-world WebGL content, including old versions of
the babylon.js library.
The EmulatePrecision AST transformation still relies on writing out
raw shader code for the rounding functions, with raw HLSL code added
alongside pre-existing GLSL and ESSL code. In some ways it would be
nicer to do the EmulatePrecision step as a pure AST transformation,
but on the other hand the raw code is much more readable and easier
to optimize.
To better support multiple output languages in EmulatePrecision, add a
RoundingHelperWriter class that has different subclasses for writing
the rounding functions in different languages.
The unit tests are expanded to cover the HLSL output of precision
emulation. The parts of the tests that require the HLSL output are
only active on Windows where ANGLE_ENABLE_HLSL define is added to the
unit tests. Putting the HLSL tests in an entirely separate file is a
worse alternative, since it would require either a lot of code
duplication or add a lot of boilerplate to the individual tests.
BUG=angleproject:1437
TEST=angle_unittests
Change-Id: Ia4ba0374cd415908f16f34752321af1cb93525a5
Reviewed-on: https://chromium-review.googlesource.com/358473
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
61b81acf
|
2016-06-28T14:15:20
|
|
Support non-square matrices in precision emulation
In case the shader version is greater than ESSL 1.00, the precision
emulation needs to output rounding functions for non-square matrix
types.
Writing emulated compound assignment functions for non-square matrices
already had most of the code in place before this change.
New compound assignment operators like >>= don't need floating point
precision emulation in ESSL 3.00, since all of them only operate on
integers.
BUG=angleproject:1434
TEST=angle_unittests
Change-Id: I4678f511edf4f9f744fe23bb8d7dab4387f07f20
Reviewed-on: https://chromium-review.googlesource.com/358472
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
91d56945
|
2015-07-21T18:56:48
|
|
Emulate the pack/unpack functions for unorms.
BUG=angleproject:1044
Change-Id: I2cfb792de43d3a6fddd750100c74f948948dc1f6
Reviewed-on: https://chromium-review.googlesource.com/287290
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
c2128ff5
|
2016-07-04T10:26:17
|
|
translator: Fix two bugs that trigger ASSERTs.
The first bug was a result of constant-folding a vector swizzle that
was out-of-bounds. The second bug was a result of using a semicolon
in a preprocessor define.
BUG=angleproject:1425
Change-Id: Id6643b1f3e3b13cc021bd721ef2572487fe3c8d3
Reviewed-on: https://chromium-review.googlesource.com/357864
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
474a08c0
|
2016-06-28T10:49:46
|
|
Remove qualifiers from empty struct declarations in output
Empty struct declarations with qualifiers are rejected by NVIDIA GL
driver version 367.27. For example this kind of construct that is
expected to be accepted by the WebGL conformance tests is rejected:
const struct a {
int i;
};
Since qualifiers do not carry meaning unless a struct declaration
has declarators, they can be simply omitted from the translator
output in this kind of cases to work around this driver issue.
New unit test is added to check that pruning empty declarations works
correctly.
BUG=angleproject:1430
BUG=622492
TEST=WebGL conformance tests, angle_unittests
Change-Id: Id83f83124ae597fcdfa15100d336c2c207d9449c
Reviewed-on: https://chromium-review.googlesource.com/356362
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
10fcd9be
|
2016-06-30T12:24:09
|
|
Add a helper class for compiler string matching tests
The MatchOutputCodeTest class makes it easier to implement tests that
do string matching on compiler output. Inheriting test classes set the
compiler settings, tests then call compile() with the shader string
and can call foundInCode() to check if the output code contains a
given string.
Various compiler unit tests that already did string matching are
refactored to make use of this new helper class. Some tests now use
SH_GLES3_SPEC instead of SH_GLES2_SPEC - this should not have a
significant impact on test coverage.
Some compileTestShader function variants that are now unused can be
removed from the code.
BUG=angleproject:1430
TEST=angle_unittests
Change-Id: I1fd3529d5a1c6ab192f95ace800cf162604e68e7
Reviewed-on: https://chromium-review.googlesource.com/357800
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
dcf12c70
|
2016-06-28T15:03:06
|
|
Fix validating non-square matrix compound multiplication
The validation previously checked that two matrices in compound
multiplication are the exact same size, which isn't correct for
non-square matrices introduced in ESSL 3.00.
Instead, check that the matrix multiplication is valid and that the
resulting value has the same number of columns as the lvalue. The
number of rows in the result is taken from the lvalue so it doesn't
need to be checked.
BUG=angleproject:1431
TEST=angle_unittests
Change-Id: I6f32b7dc037d72c3c5cfdfffcda5d996e8450283
Reviewed-on: https://chromium-review.googlesource.com/356411
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
19d1dc99
|
2016-03-08T17:18:46
|
|
Add option to limit the number of function parameters
Trying to compile user-defined functions that have thousands of
parameters introduces some instability in native compilers, so it is
better to reject shaders with large numbers of function parameters
in ANGLE.
The check is only enabled if the SH_LIMIT_EXPRESSION_COMPLEXITY flag
is turned on. The default limit for the number of parameters is 1024,
but it can also be configured.
BUG=angleproject:1338
TEST=angle_unittests
Change-Id: I5c9b7a4e97e67f36e77f969368336fa8fffba1c3
Reviewed-on: https://chromium-review.googlesource.com/331970
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c4a96d67
|
2015-07-23T17:37:39
|
|
Names of built-in functions cannot be redeclared as functions
With ESSL 3.00, names of built-in functions cannot be redeclared as
functions, and therefore an error needs to be generated if a built-in
function is overloaded.
This is fixed by inserting unmangled built-ins into a special set in
the symbol table and checking if function declarations match any of
the built-ins in the set.
The regular symbol table structures can't be used for storing the
unmangled names because that interferes with name hashing in
OutputGLSL.
Credit goes to Arun Patole, apatole@nvidia.com for initially
investigating this issue and developing the first version of the
patch.
BUG=angleproject:1066
TEST=angle_unittests,
dEQP-GLES3.functional.shaders.functions.invalid.overload_builtin_function*
(2 tests started passing with this change)
Change-Id: I28c8325f5a3a8f4a97226b0dfdbb9762724fa609
Reviewed-on: https://chromium-review.googlesource.com/328994
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
39046169
|
2016-02-08T15:05:17
|
|
CollectVariables: Don't include block name in field name.
The spec mandates that the instance name of a block determines how the
active uniform name for this field is reported. However, our handling
of this was a bit bugged. We would include the proper prefix on the
compiler-side, but this mangled the hashing, and was also not strictly
needed. We now also expose the instance name, so we can determine the
proper prefix for variable linking on the GL-side of things. This also
is consistent with how we handle other spec issues, where the GL-side
handles the GL-API specific functionality.
This also allows us to fix name hashing of instanced uniform blocks,
which was previously broken because we would hash the full name of the
active uniform, instead of just the field.
BUG=angleproject:1306
Change-Id: I06ace6dbc3f75fdd8129677360dcc142aa89136e
Reviewed-on: https://chromium-review.googlesource.com/326681
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
9b4e8626
|
2015-12-22T15:53:22
|
|
Redesign samplers in shaders on D3D11
Translation of samplers to HLSL on D3D11 is changed as follows:
Instead of passing around HLSL sampler and HLSL texture references in
shaders, all references to ESSL samplers are converted to constant
indices within the shader body. Each ESSL sampler is identified by an
unique index. In the code generated to implement ESSL texture functions,
these indices are used to index arrays of HLSL samplers and HLSL
textures to get the sampler and texture to use.
HLSL textures and samplers are grouped into arrays by their types. Each
unique combination of a HLSL texture type + HLSL sampler type gets its
own array. To convert a unique sampler index to an index to one of these
arrays, a constant offset is applied. In the most common case of a 2D
texture and a regular (non-comparison) sampler, the index offset is
always zero and is omitted.
The end goal of this refactoring is to make adding extra metadata for
samplers easier. The unique sampler index can be used in follow-up
changes to index an array of metadata passed in uniforms, which can
contain such things as the base level of the texture.
This does not solve the issues with samplers in structs.
The interface from the point of view of libANGLE is still exactly the
same, the only thing that changes is how samplers are handled inside the
shader.
On feature level 9_3, the D3D compiler has a bug where it can report that
the maximum sampler index is exceeded when in fact it is not. This can
happen when an array of samplers is declared in the shader. Because of
this the new approach can't be used on D3D11 feature level 9_3, but it
will continue using the old approach instead.
BUG=angleproject:1261
TEST=angle_end2end_tests,
dEQP-GLES3.functional.shaders.texture_functions.* (no regressions)
dEQP-GLES3.functional.texture.units.* (no regressions)
Change-Id: I5fbb0c4280000202dc2795a628b56bd8194ef96f
Reviewed-on: https://chromium-review.googlesource.com/320571
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
|
|
924b7de2
|
2016-01-21T13:54:28
|
|
Always write to gl_Position when compiling shaders with
SH_GLSL_COMPATIBILITY_OUTPUT.
BUG=angleproject:1277
Change-Id: Ib820a46151637e8c61e94b966b970de46ccca6b9
Reviewed-on: https://chromium-review.googlesource.com/323160
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Ian Ewell <ewell@google.com>
|
|
5f80d016
|
2016-01-11T11:16:01
|
|
Disallow invariant(all) pragma in ESSL 3.00 fragment shaders
ESSL 3.00.4 section 4.6.1 says that using #pragma STDGL invariant(all)
in a fragment shader is an error, so make it an error. This spec
language is not found in ESSL 1.00, and it's been removed in ESSL 3.10.
BUG=angleproject:1276
TEST=angle_unittests
Change-Id: I2022f35475f867304b55dfb142f8568f6df28830
Reviewed-on: https://chromium-review.googlesource.com/321240
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
8d8b108a
|
2016-01-04T16:44:57
|
|
Disallow local function prototypes
Function prototypes should not be allowed inside other functions
according to ESSL 3.00.4 section 4.2.4.
BUG=angleproject:1068
TEST=angle_unittests,
dEQP-GLES*.functional.shaders.functions.invalid.local_function_proto*
Change-Id: I54160da4d49b92a6cd7cbee020e67733963d4e10
Reviewed-on: https://chromium-review.googlesource.com/320091
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
5d653186
|
2016-01-04T14:43:28
|
|
Disallow multiple function prototypes in ESSL 1.00
The same function can't be declared twice in ESSL 1.00. In ESSL 3.00 this
is allowed.
A function prototype following the definition of that function is not
interpreted as redeclaration, and the shader compiler continues to allow
this.
BUG=angleproject:1067
TEST=angle_unittests,
dEQP-GLES2.functional.shaders.functions.invalid.double_declare*
Change-Id: I6d2ddafd456d378d92839600f19069ad1cd19aff
Reviewed-on: https://chromium-review.googlesource.com/320082
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
66641c61
|
2016-01-04T15:31:15
|
|
Fix typo in shader test
The only error in the test should be the non-integer index. gl_FragColor
should be used correctly.
BUG=angleproject:1254
TEST=angle_unittests
Change-Id: I0b7a36be5485661cc03bf2c476aaacae5d3b6e76
Reviewed-on: https://chromium-review.googlesource.com/320280
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
add0ef14
|
2015-12-17T15:43:31
|
|
Remove deprecated ShShaderOutput versions.
These aren't referenced from Chromium code any more.
BUG=chromium:550487
Change-Id: Ie4094667ec5f739efd9f1253ffdb779deaf3cebc
Reviewed-on: https://chromium-review.googlesource.com/319162
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Kenneth Russell <kbr@chromium.org>
|
|
8e89866d
|
2015-12-11T12:24:21
|
|
Remove redundant index integer check from ValidateLimitations
Non-integer indices are already rejected in the parser, so the
ValidateLimitations pass doesn't need to check for them.
ESSL 1.00 spec is not actually terribly clear about whether the
parser should do this check, but the language grammar in the spec only
has indexing with "integer_expression" so it seems like ANGLE's
interpretation of only allowing indexing with integers is correct.
ESSL 3.00 makes this restriction explicitly clear in section 5.7.
BUG=angleproject:1254
TEST=angle_unittests
Change-Id: I02b2a6f4d9fa7801a98df63ed21bc990e1585eb8
Reviewed-on: https://chromium-review.googlesource.com/317741
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
8a76dcc7
|
2015-12-10T20:25:12
|
|
Don't try to apply ForLoopUnroll to loops it can't handle
ForLoopUnroll should only mark loops that fit the limitations in ESSL
1.00 Appendix A.
BUG=angleproject:1253
TEST=angle_unittests, WebGL conformance tests
Change-Id: I00b0a7d29cd42efea9611d020aa1f873ac04773f
Reviewed-on: https://chromium-review.googlesource.com/317551
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
d561057f
|
2015-12-10T19:42:09
|
|
Fix ValidateLimitations for folded non-constant expressions
ANGLE recently gained the ability to constant fold some expressions that
are not constant expressions. ValidateLimitations should continue to
recognize all cases where an expression is not a constant expression.
BUG=angleproject:851
TEST=angle_unittests
Change-Id: I8ad0552a59213cdd6af9a220ffd672be9752271d
Reviewed-on: https://chromium-review.googlesource.com/317281
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
183d7e24
|
2015-11-20T15:59:09
|
|
Remove predefined precision qualifiers from ESSL3 samplers
New sampler types in ESSL3 should not have default precision qualifiers.
This is specified in ESSL 3.00.4 section 4.5.4.
BUG=angleproject:1222
TEST=angle_unittests
Change-Id: I9c8e7a5fbb4278db80de79bcaeebaf23e64242a0
Reviewed-on: https://chromium-review.googlesource.com/312048
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
0980e29d
|
2015-11-20T14:57:34
|
|
Don't accept default precision for uint
Default precision can only be specified for float, int and sampler types.
Default precision for int also applies to uint and uvec declarations.
BUG=angleproject:1221
TEST=angle_unittests
Change-Id: I31fdcde80da16e2ea8771838f7c1a6ab4e478194
Reviewed-on: https://chromium-review.googlesource.com/313314
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e1a94c67
|
2015-11-16T17:35:25
|
|
Check that texture offset is constant and valid
Offset passed to textureOffset and similar functions must be constant.
See ESSL 3.00 spec section 8.8.
It must also be in the valid range between MIN_PROGRAM_TEXEL_OFFSET and
MAX_PROGRAM_TEXEL_OFFSET. Using values outside the valid range makes
the results of the texture lookup undefined, as specified in GLES 3.0.4
section 3.8.10. We generate a compiler error if an offset is outside the
valid range.
BUG=angleproject:1215
TEST=angle_unittests
Change-Id: Ida28361444d2f4050d516160f1491674c31868a1
Reviewed-on: https://chromium-review.googlesource.com/312223
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
3e960463
|
2015-11-12T15:58:39
|
|
Detect when gl_FragData is indexed with != 0 in WebGL 2.0
WebGL 2.0 explicitly specifies it to be an error when gl_FragData is
indexed with anything else than constant zero in spec section
'GLSL ES 1.00 Fragment Shader Output'.
This doesn't apply to WebGL 1.0 or GLES.
dEQP-GLES2.functional.shaders.fragdata* test that dynamic indexing of
gl_FragData is allowed.
TEST=angle_unittests
BUG=angleproject:1210
Change-Id: Ib401242e7867f5e7943456b059dd8e24dc404098
Reviewed-on: https://chromium-review.googlesource.com/312045
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bd163f6a
|
2015-11-13T12:15:38
|
|
Fix parsing structure definitions in place of constructors
The shader parser used to accept structure definitions in place of
constructors, which is invalid GLSL. This patch fixes that.
BUG=angleproject:939
TEST=angle_unittests
Change-Id: Ibcf502160e91c19e693e9427b548a399d83e2a71
Reviewed-on: https://chromium-review.googlesource.com/312032
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
40d9edf1
|
2015-11-12T17:30:34
|
|
Fix structure comparison constant folding
objectSize() will return the size of all data in the structure, and
simply iterating over the data will work for determining whether two
structures are equal. The earlier complex and broken approach where the
structure was traversed recursively is not needed.
BUG=angleproject:1211
TEST=angle_unittests
Change-Id: I0e5c5ccbb767d44ef6acb0f1f25f27dfc42866e1
Reviewed-on: https://chromium-review.googlesource.com/312490
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
36b0514a
|
2015-11-12T13:10:42
|
|
Fix ESSL3 indexing corner cases
Indexing interface blocks or fragment outputs with a non-constant
expression is not valid even if ANGLE has been able to constant fold
the expression.
BUG=angleproject:1210
TEST=angle_unittests
Change-Id: I2ccb67871b682976a31b8de306053b9b28c06437
Reviewed-on: https://chromium-review.googlesource.com/312044
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
15c2ac30
|
2015-11-09T15:51:43
|
|
Fix constructor parsing issues
After this patch, ANGLE no longer accepts constructors where any of
multiple parameters is sampler or void.
Also, structure array constructors with just one parameter are now
accepted.
Error message for a constructor with no parameters is also more
informative than before.
BUG=angleproject:1193
TEST=angle_unittests
Change-Id: I6b897973448cf500096f612b3b95dcc23aebc716
Reviewed-on: https://chromium-review.googlesource.com/311590
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
1d122789
|
2015-11-06T15:35:17
|
|
Fix constructor constant folding
The previous solution for constant folding constructors was significantly
overengineered and partially incorrect. Switch to a much simpler
constructor folding function that does not use an AST traverser, but
simply iterates over the constant folded parameters of the constructor
and doesn't do any unnecessary checks. It also reuses some code for
constant folding other built-in functions.
This fixes issues with initializing constant matrices with only a single
parameter. Instead of copying the first component of the constructor
parameter all over the matrix, passing a vec4 or matrix argument now
assigns the values correctly.
BUG=angleproject:1193
TEST=angle_unittests, WebGL conformance tests
Change-Id: I50b10721ea30cb15843fba892c1b1a211f1d72e5
Reviewed-on: https://chromium-review.googlesource.com/311191
Tryjob-Request: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
7c3848e5
|
2015-11-04T13:19:17
|
|
Allow constant folding some non-constant expressions
This requires removing the assumption that constant folding implies
constness in the constant expression sense from various places in the
code.
This particularly benefits ternary operators, which can now be simplified
if just the condition is a compile-time constant.
In the future, the groundwork that is laid here could be used to implement
more aggressive constant folding of user-defined functions for example.
TEST=angle_unittests
BUG=angleproject:851
Change-Id: I0eede806570d56746c3dad1e01aa89a91d66013d
Reviewed-on: https://chromium-review.googlesource.com/310750
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
b1edc4f5
|
2015-11-02T17:20:03
|
|
Accept const array initialization in shader parsing
Array constructors are not folded, unlike all other constant expressions.
Change initializer parsing path so that it accepts constant initializers
whether they are folded or not.
Some parts need to be adapted to work with expressions that are qualified
as constant but that are not necessarily folded:
1. Identifier parsing
2. Indexing parsing
3. Field selection parsing
4. HLSL output for variable declarations
5. Determining unary operator result type
6. Determining binary operator result type
7. Determining built-in function call result type
8. Determining ternary operator result type
Corner cases that are not supported yet:
1. Using array constructors inside case labels
2. Using array constructors inside array size expressions
3. Detecting when a negative constant expression containing an array
constructor is used to index an array
In these cases being able to constant fold the expression is essential to
validating that the code is correct, so they require a more sophisticated
solution. For now we keep the old code that rejects the shader if ANGLE
hasn't been able to constant fold the case label or array size. In case of
indexing an array with a negative constant expression containing an array
constructor, ANGLE will simply treat it as a non-constant expression.
BUG=541551
BUG=angleproject:1094
TEST=dEQP-GLES3.functional.shaders.constant_expressions.* (all pass),
angle_unittests
Change-Id: I0cbc47afd1651a4dece3d68acf7ec72a01fdf047
Reviewed-on: https://chromium-review.googlesource.com/310231
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
f541f529
|
2015-10-13T12:21:01
|
|
Fix parsing integers larger than 0x7FFFFFFF
Parsing should accept all values between 0 and 0xFFFFFFFF as specified in
ESSL 3.00 section 4.1.3.
When a signed literal is parsed, it's interpreted as if it specifies the
bit pattern of a two's complement integer. For example, parsing
"0xFFFFFFFF" results in -1. Decimal literals behave the same way, so for
example parsing "3000000000" results in -1294967296.
This change affects parsing of literals in ESSL 1.00 as well. In ESSL
3.00, an out-of-range integer literal now generates a compiler error.
Unit tests are added based on examples in the ESSL 3.00 spec and one
example in GLSL 4.5 spec that ESSL should match.
BUG=541550
TEST=angle_unittests
Change-Id: I82f8ef5cfa2881019a3f80d77ff99707d61c000d
Reviewed-on: https://chromium-review.googlesource.com/305420
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@google.com>
|
|
b3fbd867
|
2015-09-30T17:55:02
|
|
Fix setting const qualifier on indexing expression
Resubmitting now that separate fix for updating mangled names of types
has been merged. A unit test is added to make sure that the same
regression doesn't happen again.
Previously, constness of indexing expressions did not take the index
expression into account. Now constness correctly takes into account both
the base expression and the index expression.
Setting the type of expressions that index arrays is also simplified.
BUG=angleproject:1170
TEST=angle_unittests
Change-Id: Ie9b6aaee8185b945c03657b13d9513cc55cd2a9f
Reviewed-on: https://chromium-review.googlesource.com/303601
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
e623bd46
|
2015-10-02T19:14:15
|
|
Revert "Fix setting const qualifier on indexing expression"
Failing to compile shaders which are used in some layout_tests,
see http://crbug.com/538692 for logs and bad shaders.
We should diagnose if the shaders are faulty or if there's a
bug in this CL and take appropriate action, but first priority
is to get the tests running again.
BUG=538692
BUG=angleproject:1170
This reverts commit 16a79cd169420cdf0254964b1bac9dd9964a8119.
Change-Id: Iea14c58d87041bcf5ba645b7076ba0936dea6b9d
Reviewed-on: https://chromium-review.googlesource.com/303794
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
16a79cd1
|
2015-09-30T17:55:02
|
|
Fix setting const qualifier on indexing expression
Previously, constness of indexing expressions did not take the index
expression into account. Now constness correctly takes into account both
the base expression and the index expression.
Setting the type of expressions that index arrays is also simplified.
BUG=angleproject:1170
TEST=angle_unittests
Change-Id: Ie2d122020cc252655ab0eea96886b9f85931b80a
Reviewed-on: https://chromium-review.googlesource.com/303350
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
5f0246ca
|
2015-07-22T10:30:35
|
|
Implement gl_FragDepth for GLES SL 3.0
Makes it an error to access gl_FragDepthEXT in #version 300 es shader.
TODO:
Lacks the feature to make "#extension GL_EXT_frag_depth : require" an
error for #version 300 es.
Reland of: https://chromium-review.googlesource.com/#/c/287570
BUG=angleproject:1102
TEST=angle_unittest
Change-Id: I064d918d65f37539cb1e14f12173ca5591a4ea3f
Reviewed-on: https://chromium-review.googlesource.com/301711
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|
|
0304d2fe
|
2015-09-07T16:28:19
|
|
Don't split the file into two chunks in shader_translator
Splitting the file into two strings in shader_translator complicated
testing line/file numbering related functionality with it, since each
chunk passed to ShCompile has its own file number and line numbering.
These are exposed to the preprocessor in __FILE__ and __LINE__ predefined
macros.
Just supply the file to ShCompile in a single string. Also, since the
original motivation for splitting the string seems to have been to
exercise ShCompile with multiple strings, add a new unit test that
ensures that ShCompile handles multiple strings as expected.
BUG=angleproject:989
TEST=angle_unittests
Change-Id: I31d24925ec85ca3411e537df25a985f09737403e
Reviewed-on: https://chromium-review.googlesource.com/297251
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
|
|
a0a9e12d
|
2015-09-02T15:54:30
|
|
translator: Add sh::OutputVariable type.
This replaces the dual-use of sh::Attribute, which can be a bit
confusing to people expecting a literal output variable.
Currently not used in Chromium, so should be safe to land.
BUG=angleproject:1146
Change-Id: I436f2bc9dc4ddc3709369cb2baa344c6b13a21a2
Reviewed-on: https://chromium-review.googlesource.com/296683
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
|
|
477b243b
|
2015-08-31T10:41:16
|
|
Change the FLATTEN heuristic to "ifs with a loop with a gradient"
This heuristic makes more sense than the previous "ifs with a
discontinuous loop" as the reason we need to flatten is that we need
gradients to be in branchless code.
Change the UnrollFlatten test accordingly.
Tested with:
- the WebGL CTS
- dev.miaumiau.cat/rayTracer "Skull Demo"
- THe turbulenz engine GPU particle demo
- Lots of ShaderToy Samples (inc. Volcanic, Metropolis and Hierarchical
Voronoi)
- Google Maps Earth mode
- Lots of Chrome experiments
- madebyevan.com/webgl-water
BUG=524297
Change-Id: Iaa727036fffcfde3952716a1ef33b6ee0546b69d
Reviewed-on: https://chromium-review.googlesource.com/296442
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
2a592150
|
2015-08-31T10:10:33
|
|
Fix Chromium compilation error in VariablePack_test.cpp
BUG=
Change-Id: I59c9716774df4615da6dd412795639e055f45034
Reviewed-on: https://chromium-review.googlesource.com/295732
Tested-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a9bee1b8
|
2015-08-27T16:10:53
|
|
Add row-sharing packing tests for VariablePacker_test.cpp
Recent test failures leads to suspicion that our variable packing algorithm is
buggy - turns out to be an underlying driver bug.
With the added test cases, such suspicion shouldn't even arise.
BUG=angleproject:1142
TEST=angle_unittests
Change-Id: I1fb3c5c7798d9ad17668a3d633286e031da79cab
Reviewed-on: https://chromium-review.googlesource.com/295901
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Zhenyao Mo <zmo@chromium.org>
|
|
11865105
|
2015-08-27T17:55:17
|
|
angle_unittests add forgotten VariablePacker test.
Also add a warning on top of the UnrollFlatten test that it works only
when HLSL is enabled.
BUG=angleproject:1140
Change-Id: Ide961bbed70dc9ed2a604f13273e4209b1dec29b
Reviewed-on: https://chromium-review.googlesource.com/295125
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
76037953
|
2015-08-20T13:18:44
|
|
Fix compilation on Mac, adding a newline in IntermNode_test.cpp
BUG=
Change-Id: Ie935486bf44bacb89660419c0dabd0ff38838c90
Reviewed-on: https://chromium-review.googlesource.com/294800
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tested-by: Corentin Wallez <cwallez@chromium.org>
|
|
d0d59aa4
|
2015-08-18T13:49:45
|
|
Add deep copying support for typed AST nodes
Removing dynamic indexing of vectors and matrices will require copying
the indexed nodes in case they are written. Any type of l-value node that
doesn't have side effects may need to be copied. Add a copying function
for all typed node classes so that this copying can be performed.
Private copy constructors are used to implement the deepCopy function in
order to make maintenance easier. With copy constructors, each subclass
only needs to take care of copying its own members, and not the base
class members, which reduces the possibility of errors. Copy constructors
are disabled for all node classes that don't support deep copying by
inheriting TIntermNode from angle::NonCopyable.
Assignment operator is disabled for all node classes through inheriting
angle::NonCopyable. This applies also to classes that now get the private
copy constructor.
Explicit copy constructor and assignment operator declarations are added
to some classes which show up in node member variables to make code
clearer.
BUG=angleproject:1116
TEST=angle_unittests
Change-Id: Ia757b69397837f8309f0e7511c0cd24ca2c7a721
Reviewed-on: https://chromium-review.googlesource.com/293931
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
217fe6ec
|
2015-08-05T13:25:08
|
|
Detect when built-in modf requires an l-value in AST traversal
This fixes an omission that out parameter tracking had inherited from
EmulatePrecision. Accurate tracking of when values are written is
required for converting dynamic indexing of vectors and matrices to
function calls.
A new test covering this is added to angle_unittests.
TEST=angle_unittests
BUG=angleproject:1116
Change-Id: I05c5fd60355117d0053b84110748ae221375a790
Reviewed-on: https://chromium-review.googlesource.com/290562
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
4d61f7ed
|
2015-08-12T10:56:50
|
|
Reland Fixed compiler warning C4267 'conversion from 'size_t' to 'type', possible loss of data'
Additional warnings found with more testing and added C4267 warning disable only for angle_libpng
BUG=angleproject:1120
Change-Id: Ic403dcff5a8018056fa51a8c408e64207f3362eb
Reviewed-on: https://chromium-review.googlesource.com/293028
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
|