|
4cc89e2b
|
2017-08-31T14:25:54
|
|
ES31: Enable 'location' layout qualifier on shader interfaces in compiler
This patch enables 'location' layout qualifier for vertex outputs and
fragment shader inputs when the shader version is 3.1 in ANGLE GLSL
compiler and adds the check on location conflicts for these varyings.
According to GLSL ES 3.1 SPEC (Chapter 4.4.1 and Chapter 4.4.2),
'location' layout qualifier is allowed on both inputs and outputs of
vertex and fragment shaders.
'location' layout qualifier on shader interfaces is only valid on shaders
whose version is 3.1 and above. According to GLSL ES 3.0 SPEC, vertex shader
cannot have output layout qualifiers (Chapter 4.3.8.2) and fragment shader
cannot have input layout qualifiers (Chapter 4.3.8.1).
The 'location' qualifier on varyings is used in the shader interface
matching defined in OpenGL ES 3.1. (OpenGL ES 3.1 SPEC Chapter 7.4.1). This
new link rule will be added to Program.cpp in another patch.
For the OpenGL ES 3.1 extension GL_OES_geometry_shader, according to
GL_OES_shader_io_blocks SPEC (Chapter 4.4.1 and Chapter 4.4.2), 'location'
layout qualifier is both valid on geometry shader inputs and outputs. This
feature will be implemented together with other rules on geometry shader
inputs and outputs.
BUG=angleproject:2144
TEST=angle_unittests
Change-Id: I62d85f7144c177448321c2db36ed7aaeaa1fb205
Reviewed-on: https://chromium-review.googlesource.com/645366
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
84aa2dcf
|
2017-09-11T15:51:02
|
|
Add textureGather and textureGatherOffset
The patch adds new built-ins and extends the semantic parser to add
support for textureGather and textureGatherOffset.
BUG=angleproject:1442
TEST=angle_unittests
TEST=angle_deqp_gles31_tests.exe
--deqp-case=dEQP-GLES31.functional.texture.gather*
--deqp-egl-display-type=angle-gl
Change-Id: Iaf98c3420fbd61193072fdec8f5a61ac4c574101
Reviewed-on: https://chromium-review.googlesource.com/660124
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
e8ef2bc4
|
2017-08-29T13:38:57
|
|
Add compile error on using inputs with interpolation qualifier as l-value
This patch intends to fix a compile error in ANGLE GLSL compiler when
parsing an expression with inputs which has interpolation qualifiers
('flat', 'smooth' and 'centroid').
The compiler should report a compile error when a shader input with
interpolation qualifier is used as a l-value.
BUG=angleproject:2140
TEST=angle_unittests
Change-Id: I7c059d53bf001ac31d34519a98e5289797833ce7
Reviewed-on: https://chromium-review.googlesource.com/640075
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
7e1197e0
|
2017-08-24T15:48:38
|
|
Fix crash when indexing unsupported interface blocks by variable
This patch intends to fix a compiler crash when indexing an
unsupported interface blocks. We should not use UNREACHABLE() here
because the compiler will continue parsing when this kind of error
is generated. Instead, we use an ASSERT to ensure the compile error
must have been reported before when the parsing reaches here.
BUG=chromium:758159
Change-Id: I4bc63316d156d51f721123fe963106d1e81d8d32
Reviewed-on: https://chromium-review.googlesource.com/631797
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
d27f5c8d
|
2017-08-23T09:38:08
|
|
ES31: Implement GL_OES_geometry_shader built-ins in GLSL compiler
This patch intends to implement all built-in constants, variables and
functions defined in OpenGL ES 3.1 extension GL_OES_geometry_shader
in ANGLE GLSL compiler.
1. Add all built-in constants defined in GL_OES_geometry_shader.
2. Add built-in functions EmitVertex() and EndPrimitive() required
in Geometry Shader.
3. Add built-in variables gl_PrimitiveIDIn and gl_InvocationID to
Geometry Shader.
4. Add built-in variables gl_PrimitiveID and gl_Layer to both
Geometry Shader and Fragment Shader when GL_OES_geometry_shader
is enabled.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: I92821553ed0efee2ccb77fead6e065e7799819d0
Reviewed-on: https://chromium-review.googlesource.com/627670
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
977ee7eb
|
2017-07-21T11:38:27
|
|
Add gl_ViewportIndex to the symbol table
gl_ViewportIndex is a GLSL built-in that's needed to implement
instanced multiview. It is a bit of a special case: it only exists in
desktop GLSL and not ESSL, and it shouldn't be exposed to the parser.
We add a new level to the symbol table that's hidden from the parser
to make adding this kind of builtins in AST transforms consistent with
the way ESSL builtins are supported.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I51b2d983950b38c8e85e4b6ed00c6b39f9b3cb03
Reviewed-on: https://chromium-review.googlesource.com/580953
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
0ce8ef33
|
2017-08-18T12:00:28
|
|
Add arrays of arrays negative test coverage
Arrays of arrays have not been implemented yet, but these tests can
already be enabled. This is useful to make sure that we don't
accidentally enable arrays of arrays where they shouldn't be enabled
and that the initial implementation generates errors correctly and
doesn't crash on malformed inputs.
BUG=angleproject:2125
TEST=angle_unittests, angle_deqp_gles31_tests
Change-Id: I538e5ae1f0903c42e06cfce352124130f160649d
Reviewed-on: https://chromium-review.googlesource.com/620706
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
85d624a5
|
2017-08-07T13:42:33
|
|
Fix null pointer dereference in redeclaration error message
When a function parameter name conflicts with another, the pointer
returned to ParseContext will be null.
BUG=chromium:745242
TEST=angle_unittests
Change-Id: Ie53bb06b0c6660e382d85aeda41f3a1b7df5a917
Reviewed-on: https://chromium-review.googlesource.com/603368
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
b5cc1198
|
2017-07-06T10:47:20
|
|
ES31: Add Geometry Shader layout qualifiers in GLSL compiler
This patch intends to implement Geometry Shader layout qualifiers
required in OpenGL ES 3.1 extension GL_OES_geometry_shader in ANGLE
GLSL compiler.
1. Add support to the shader type GL_GEOMETRY_SHADER_OES.
2. Implement Geometry Shader layout qualifiers in the GLSL compiler:
(1) Add support to OpenGL ES 3.1 extension "GL_OES_geometry_shader".
(2) Add validations of the input and output primitive declarations
in the Geometry Shader layout declarations.
(3) Add 'invocations' and 'max_vertices' support in the Geometry
Shader layout declarations
3. Add unit tests to cover all the new features added in this patch.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Ie693e11f8a00dab3552626ed63e9336c7fbd3cb8
Reviewed-on: https://chromium-review.googlesource.com/560647
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bc58515e
|
2017-06-23T15:42:17
|
|
ES31: Add 'buffer' qualifier support in shader
This change added 'buffer' qualifier support in shader which
corresponds to ESSL 3.1 spec, session 4.3.7 'Buffer Variables'.
BUG=angleproject:1951
TEST=angle_unittests:BufferVariablesTest
Change-Id: I2ecb5317d5ea9d378a60b03f86bdae04dbd89e9f
Reviewed-on: https://chromium-review.googlesource.com/534960
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
37d96cce
|
2017-07-11T14:14:03
|
|
Fix accepting arrays as array indices
Previously, arrays were being incorrectly accepted as array indices.
This was because the isScalar() check only checked that the type was
not a vector or matrix, but still returned true for scalar arrays.
This patch changes the isScalar() check so that it returns false for
arrays. This makes usage of the term "scalar" more consistent in the
shader translator. Most of the code using isScalar() was compatible
with this change. Code in util.cpp that used to assume that isScalar()
doesn't care about arrayness is refactored to work with the new
behavior.
BUG=angleproject:2102
TEST=angle_unittests
Change-Id: I2a7f4c30fca7917d1099d0400efe3de859338b2a
|
|
56229f1b
|
2017-07-10T14:16:33
|
|
Remove TIntermediate::addConstantUnion
This includes asserts in TConstantUnion to reveal incorrect usage of
union - reading a different field of an union that has last been set
is undefined behavior in C++.
Existing issues with accessing incorrect fields of constant unions
are fixed.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Idd6b7a871d73e2928f117a9348c92043612fab82
|
|
d7cd4ae5
|
2017-07-06T15:52:49
|
|
Check that function declarations don't use a reserved name
Reserved function names are now caught if the function is just
declared without being called in the shader source. Actually, function
calls don't need to be checked for reserved names, since that just
generates a redundant error message if function declarations are being
checked.
Includes some cleanup of ParseContext::checkIsNotReserved. It doesn't
need special handling of built-in symbols, as they are never passed to
the function.
BUG=chromium:739448
TEST=angle_unittests
Change-Id: I7115e1a7509626b5109b5c054c0704b0c3c19c58
Reviewed-on: https://chromium-review.googlesource.com/561457
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
77891c0a
|
2017-06-23T16:30:17
|
|
Fix wrong assignment of maxUniformVectors in GLSL compiler
This patch intends to fix a bug in ANGLE GLSL compiler.
In TCompiler::Init(resources), we should initialize maxUniformVectors by
resource.maxComputeUniformComponents / 4 when we attempt to initialize a
compiler for compute shader instead of resource.maxFragmentUniformVectors.
BUG=angleproject:2083
Change-Id: I4901f71ef5ac4f5770e2d5f8ee21786fcf19fbca
Reviewed-on: https://chromium-review.googlesource.com/545190
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
487b63ab
|
2017-05-23T15:55:09
|
|
Disallow structs as scalar/vector constructor arguments
The spec isn't very explicit about disallowing this, but conversions
from structs are not among the conversion constructors or specified
in any other way either.
BUG=angleproject:2036
TEST=angle_unittests
Change-Id: I23f2ceda1d1348cec0d3bba38a7a013275ff84eb
Reviewed-on: https://chromium-review.googlesource.com/514002
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
9405005f
|
2017-05-08T14:17:44
|
|
Disallow interface blocks in arithmetic expressions
Interface blocks were mistakenly being allowed in some types of unary,
binary and ternary expressions, when they should not have been.
BUG=angleproject:2030
TEST=angle_unittests
Change-Id: Ie75833ee208e1b7fef8f77fa91b90da278bc6498
Reviewed-on: https://chromium-review.googlesource.com/500269
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b4cf5656
|
2017-05-05T18:51:17
|
|
Validate opaque operands against binary operators
Add checks that opaque operands can only be used with array indexing
and field section, as mentioned in ESSL 3.10 section 4.1.7.
BUG=angleproject:2028
Change-Id: I41b7f10785bf712dfc999f85ebff925341c51911
Reviewed-on: https://chromium-review.googlesource.com/497767
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
cc2a10e9
|
2017-05-03T14:05:12
|
|
Unify opaque type validation in GLSL parsing
Refactor separate sampler and image validations into unified opaque
type handling. This paves way for adding atomic counter, another
new opaque type.
BUG=angleproject:1729
Change-Id: I201d28e31c84534db43e656d518650e378bab76c
Reviewed-on: https://chromium-review.googlesource.com/493618
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
bb7e5a7c
|
2017-04-24T10:16:44
|
|
GLSL parser: Fix empty declaration qualifier checks
The shader validation now does the same checks for qualifier
combinations regardless of if a declaration is empty, as is specified.
Some of these checks used to be in singleDeclarationErrorCheck, and
have now been moved to a new function declarationQualifierErrorCheck.
The other parts of singleDeclarationErrorCheck are under a renamed
nonEmptyDeclarationErrorCheck.
The patch also contains another related cleanup: Unnecessary symbol
nodes won't be created for empty declarations any more.
BUG=angleproject:2020
TEST=angle_unittests
Change-Id: I1c864a5e151c52703926d8c550450b2561bfcbb2
Reviewed-on: https://chromium-review.googlesource.com/493227
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
193c0950
|
2017-05-02T15:51:47
|
|
Fix assert when attempting to create a void array node
TIntermTyped::CreateZero can be reached with a void array type in an
error case. Handle this gracefully instead of asserting.
Also remove an assert that wasn't really checking anything in
CreateZero. type.isScalar() || type.isVector() || type.isMatrix() can
only be false in case of a struct, and struct type was being checked
in the condition on the line above.
BUG=chromium:717385
TEST=angle_unittests
Change-Id: Iff0811d18d399d7b32b2b46deea5df172412eb8c
Reviewed-on: https://chromium-review.googlesource.com/492887
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4336489f
|
2017-02-13T16:00:12
|
|
Parse binding layout qualifier for opaque types
This patch adds binding layout qualifier support for opaque types.
Binding layout qualifier on blocks is not yet supported.
This includes support for GLSL output and some minor simplification of
related functionality in ParseContext.
TEST=angle_unittests, dEQP-GLES31.functional.layout_binding.*
BUG=angleproject:1442
Change-Id: I53fb505b5a539bccee70613f3969fba81965ae84
Reviewed-on: https://chromium-review.googlesource.com/441586
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
485eefdd
|
2017-02-14T17:40:06
|
|
Fix checking image memory access
Checks for image memory access used to assume that image nodes are
symbol nodes, but they can also be array indexing nodes. In invalid
shaders struct indexing nodes of an image type may also appear after
error recovery.
TEST=angle_unittests, dEQP-GLES31.functional.layout_binding.*
BUG=angleproject:1442
Change-Id: Ib45728d38485cb78c594e080f3decec1233a0046
Reviewed-on: https://chromium-review.googlesource.com/442764
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
34bf2d93
|
2017-02-06T13:40:59
|
|
translator: Fix ASSERT in array init corner case.
This ASSERT was benign and can be turned into an error check. The
pattern in question is to initialize an array with another array
as the first argument, but dereferencing the array with "." instead
of "[]". This would trip up our error handling.
BUG=chromium:662702
Change-Id: Ie0e44af7b9d1a66cad03cefae9bf931f8e216cd9
Reviewed-on: https://chromium-review.googlesource.com/437599
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
17a5c062
|
2017-01-22T15:20:53
|
|
IntermTyped::CreateZero: handle non-basictypes
CreateZero is called in ParseContext so it should handle types which
don't necessarily make sense to call it with.
BUG=chromium:680961
Change-Id: I8627850e49eb9a4f4ecde61ca2d68371ea6a8dd6
Reviewed-on: https://chromium-review.googlesource.com/431001
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
78d13744
|
2017-01-18T13:06:10
|
|
Validate main() prototype declarations with incorrect parameters
Instead of just validating definitions of main(), do the validation
for all function headers for functions named "main", including headers
in prototype declarations.
BUG=angleproject:1712
TEST=angle_unittests
Change-Id: Ia34a2a756e1cc27b241b27e8c01c6ef09bffba71
Reviewed-on: https://chromium-review.googlesource.com/430010
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
7e735e48
|
2017-01-12T15:42:01
|
|
Change remaining compile-time folding errors to warnings
The GLES working group has decided to amend the spec so that
implementations are not allowed to generate compile errors on
undefined values detected at compile time. Change the remaining
folding errors to warnings to follow the newly clarified rules.
The end2end_tests covering this are removed, since they're
redundant with the more efficient unit test.
BUG=angleproject:1703
TEST=angle_unittests
Change-Id: I97d2fd532dbe5733581bdc4aa40a5d7d3734fc0d
Reviewed-on: https://chromium-review.googlesource.com/427799
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
4021932f
|
2016-12-09T09:50:51
|
|
translator: Add ES3.1 multisample texture support.
Implement shader objects, [iu]sampler2DMS, textureSize(gsampler2DMS).
as well as texelFetch(gsampler2DMS,P,sample) for the glsl.
BUG=angleproject:1590
TEST=angle_unittests
TEST=angle_end2end_tests
Change-Id: I781023f7bec34ad0264af69f34bb182b50bd1fbd
Reviewed-on: https://chromium-review.googlesource.com/423175
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d7c5b0aa
|
2016-07-27T14:04:43
|
|
Add support for barriers in the compiler
The patch adds support for barriers in vertex, fragment and compute
shaders.
BUG:angleproject:1442
TEST:angle_unittests
Change-Id: Ic85c3337911851a93a3f56bd935774181600eddd
Reviewed-on: https://chromium-review.googlesource.com/380641
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
09b04a2f
|
2016-12-15T13:30:26
|
|
Add shader translator support for OVR_multiview
The OVR_multiview and OVR_multiview2 extensions add gl_ViewID_OVR to
shaders. gl_ViewID_OVR can be translated either as is in GLSL output
or as a uniform by setting the SH_TRANSLATE_VIEWID_OVR_AS_UNIFORM
compiler flag.
If WebGL output is selected, the shaders will be validated according
to proposed rules in the WEBGL_multiview spec.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I19ea3a6c8b4edb78be03f1a50a96bfef018870d0
Reviewed-on: https://chromium-review.googlesource.com/422848
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
842f23f8
|
2016-12-19T22:37:36
|
|
Rename MalformedShaderTest to ShaderValidationTest
Lots of these tests aren't actually testing malformed shaders, so the
name was misleading. ShaderValidationTest reflects the content of the
tests better.
Some test classes that needlessly used different API spec versions are
also merged.
BUG=angleproject:1673
TEST=angle_unittests
Change-Id: Ib842af153a09d3887f9bb857709fd0cd29bcc9c4
Reviewed-on: https://chromium-review.googlesource.com/422368
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|