|
dadd1986
|
2020-04-21T01:50:00
|
|
Implement GL_APPLE_clip_distance
- Built-in variable gl_ClipDistance has been added to compiler.
- Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable
each gl_ClipDistances[i] works out of the box via glEnable().
- Vulkan/Metal: Use uniform variable to control writing to each
gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance
array. The writing to the disabled element in vertex shader will be
ignored, and turned into zero assignment instead.
- Direct3D/Mobile GL: Not implemented yet.
- Added ClipDistanceTest to gl_tests and compiler unittests.
- GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so
GL_EXT_clip_cull_distance could be implemented in future if needed.
Bug: angleproject:4452
Change-Id: I571ac8b56826989808a680226a04bec4cf59988e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
96c26c68
|
2020-04-03T07:52:52
|
|
Add support for NV_shader_noperspective_interpolation
Added support for GL_NV_shader_noperspective_interpolation on
the Vulkan and Desktop OpenGL backends
Bug: angleproject:4388
Test: angle_end2end_tests --gtest_filter=ShaderInterpTest.NoPerspective/*
Change-Id: I12473830c0ea8b4fffeae9c4a8ec92d979c8e18c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2107234
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ca2b6e1f
|
2020-03-19T16:30:21
|
|
Vulkan: Implement EXT_shader_non_constant_global_initializers
Enables the translator to handle non-constant global initializers in
all essl versions iff the shader enables the extension to do so.
Bug: angleproject:4468
Test: angle_end2end_tests --gtest_filter=ShaderNonConstGlobalInitializerTest.*
Change-Id: I8f138c12fc83d2f38ff8f45ca9133222b01e4087
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102959
Reviewed-by: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
|
|
3797fc85
|
2020-03-05T11:44:28
|
|
Generate new compiler errors for array-of-arrays
The GLES GLSL 3.1 spec states that it is an error to use array-of-arrays
in the following cases:
- Vertex shader outputs
- Fragment shader inputs
- Fragment shader outputs
ANGLE currently generates errors in the case of vertex shader inputs.
It needs to add the above cases.
Reproduce by running "angle_deqp_khr_gles31_tests" with:
--gtest_filter=dEQP.KHR_GLES31/core_arrays_of_arrays_InteractionInterfaceArrays2* --use-angle=swiftshader
Bug: angleproject:4148
Change-Id: I1147fc7d4755e5b6c07d2ab5d14566d919dec530
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2087647
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Ian Elliott <ianelliott@google.com>
|
|
2d1d9d35
|
2020-01-27T12:09:41
|
|
Fix atomicAdd validation w.r.t to swizzles
Bug: angleproject:4150
Change-Id: I22c0c0382a2b208dd983fa1981ffc75f1b1945e9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2022359
Reviewed-by: Ian Elliott <ianelliott@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
230e14dd
|
2020-01-21T23:32:06
|
|
Add support for layout(early_fragment_tests) in;
Bug: angleproject:4314
Change-Id: I37b228f37201cc4188834e68459cd7294727c3ac
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2014240
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
a35aa03a
|
2019-12-20T16:15:53
|
|
Vulkan: EXT_gpu_shader5: textureGatherOffsets
The validation of the offsets parameter is added in this change.
Bug: angleproject:3569
Change-Id: Ide2ea4b9e88b28ca5ef34d5f3f5203f6e48d5f74
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1979133
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
86d9c93a
|
2019-12-16T16:07:04
|
|
Use TSpan for TType's array sizes
Until C++20, std::vector doesn't have a constexpr constructor, which
means TType cannot use a `TVector` for `mArraySizes` if an arrayed type
needs to be created constexpr. This is needed for the upcoming
textureGatherOffsets implementation.
A new TSpan class is introduced, based on std::span (from C++20) that
holds the pointer/size allocated from a TVector without owning it.
Since TVector's allocation are made from a pool, the allocated memory
will live beyond the vector's destruction. `TType::mArraySizes` is
changed to this type.
This change will allow a new constexpr constructor to be added to TType
that takes a TSpan as array directly, a value which is constexpr
initialized from a static array (instead of TVector).
Bug: angleproject:3569
Change-Id: I78793b0f4c64519e0ebe30cf6e0de995ba70035d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1968260
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
d674e1e5
|
2019-12-12T14:47:24
|
|
Vulkan: EXT_gpu_shader5: non-const offset in textureGatherOffset
This change includes preparatory work for textureGatherOffsets as well,
though that requires special handling which is addressed in a follow-up
change. This special handling is due to the fact that this family of
functions is the only built-in with an array parameter, and our built-in
table generation doesn't handle it correctly.
Bug: angleproject:3569
Change-Id: Ic1c8dd03878a184be00f578ab9fc42af8f6e47ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965435
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
e181f2f7
|
2019-12-10T22:57:42
|
|
Validate that image array indices are constant
Also adds compiler tests for dynamic indexing of SSBOs and images.
Bug: angleproject:3569
Change-Id: I84b90813840ffad5a9a3cd8e7f12bd637a57b327
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1961095
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
e4eb75da
|
2019-12-06T11:10:47
|
|
Vulkan: EXT_gpu_shader5 support: dynamically uniform indexing
Bug: angleproject:3569
Change-Id: I5abb7f2889fa5173457497d4156a3dadbcf77640
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954613
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
|
|
4ad8b55e
|
2019-12-03T10:07:41
|
|
Return valid qualifier after error
Using EvqLast for the variable causes us to hit an assert in
sh::getQualifierString when we try to print a later error message.
Just use the appropriate qualifier regardless that it's not valid
for a compute shader, we've output the error.
Bug: angleproject:4187
Change-Id: If6fa5dea07d7b6e0d3307485f41d59c5ea7f1c4c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948525
Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
|
|
795a3559
|
2019-12-03T11:31:18
|
|
Vulkan: EXT_gpu_shader5 support: precise
The precise keyword is used in tessellation shaders but introduced in
this extension.
EXT_gpu_shader5 introduces a handful of features to shaders. This
change only implements the `precise` keyword.
Bug: angleproject:3569
Change-Id: I2252b79098eb8ba2d2faa040d7eaed7548b7051e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939851
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
249cb200
|
2019-12-03T11:10:06
|
|
Translator: Rename TIntermInvariantDeclaration to ..GlobalQualifier..
This is to support the upcoming `precise` keyword.
Bug: angleproject:3569
Change-Id: Idbcc8fd6f261757dbbf81b381e7a2dae938d8101
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1947451
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
240befe5
|
2019-11-15T14:40:31
|
|
Add support for gl_HelperInvocation
Added HelperInvocation to builtin_variables.json, regenerate the codegen
portions of compiler, and plumb support for HelperInvocation through the
rest of the compiler.
Skipping some fails on Android and Swiftshader for this initial change and
will debug/fix those issues in a follow-on.
Bug: angleproject:4110
Change-Id: I781a2782ace84200bc615a2cc26b908a62e2aa26
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1922061
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a2f89c00
|
2019-10-12T13:40:03
|
|
Add sampler array index validation for ESSL 3.00 onwards
In Section 12.30 of the ESSL 3.00 spec on p143-144:
Indexing of arrays of samplers by constant-index-expressions is
supported in GLSL ES 1.00. A constant-index-expression is an
expression formed from constant-expressions and certain loop indices,
defined for a subset of loop constructs. Should this functionality be
included in GLSL ES 3.00?
RESOLUTION: No. Arrays of samplers may only be indexed by constant-
integral-expressions.
Bug: chromium:985032
Change-Id: Iad9e4b8000b442a6631e1d2295c2670c4a79d486
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1849452
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
1d02157e
|
2019-09-24T10:54:40
|
|
Only enable shader array size restrictions for HLSL
Shader arrays are currently restricted to 64K entries for all translator
back ends. This is being changed to just HLSL, since the other back
ends appear to have support for larger sizes.
Bug: angleproject:3865
Test: dEQP-GLES31.functional.compute.basic.copy_image_to_ssbo_large
Test: dEQP-GLES31.functional.compute.basic.copy_ssbo_to_image_large
Test: ComputeShaderTest.VeryLargeArrayInsideFunction/*
Change-Id: I9a9d1322e24b3206debdea6a3fd517b4d6869ed9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821943
Commit-Queue: Tim Van Patten <timvp@google.com>
Reviewed-by: Tobin Ehlis <tobine@google.com>
|
|
a905cbcd
|
2019-09-19T23:05:39
|
|
Compact built-in symbol table.
Should reduce the binary size bloat from the perfect hashing. Local
testing on Windows shows a significant size reduction.
Bug: chromium:998535
Change-Id: I411cc5a917036d2239d15353d760f44e40faa26c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1814725
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
d7d42540
|
2019-08-21T15:22:49
|
|
Don't build symbol table for GLSL built-ins if on Android
The GLSL + ESSL autogenerated symbol table is too large for
android, and android also doesn't need desktop GL functionality
If on android, compile the ESSL only symbol table
Bug: chromium:996286
Change-Id: I14dfc7748dae389e78c35f82a390c67962665356
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1757372
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
9d737966
|
2019-08-14T12:25:12
|
|
Standardize copyright notices to project style
For all "ANGLE Project" copyrights, standardize to the format specified
by the style guide. Changes:
- "Copyright (c)" and "Copyright(c)" changed to just "Copyright".
- Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1").
- Fixed a small number of files that had no copyright date using the
initial commit year from the version control history.
- Fixed one instance of copyright being "The ANGLE Project" rather than
"The ANGLE Project Authors"
These changes are applied both to the copyright of source file, and
where applicable to copyright statements that are generated by
templates.
BUG=angleproject:3811
Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
f2412bca
|
2019-07-16T15:47:34
|
|
Get rendering to texture working
Other small fixes for desktop compatibility
Bug: angleproject:3620
Change-Id: I8e75bce1f850fb891c8bb6e16f79302a6d59276c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707932
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
fab397e5
|
2019-07-25T10:18:50
|
|
Vulkan: Enforce an error when initializing a global with a non-const
The ESSL 1.0 spec is clear that "initializers must be a constant expression."
Yet, because of "legacy" applications (apparently just WebGL applications), the
code was only issuing a warning and not an error. The
"KHR-GLES2.shaders.negative.initialize" test requires an error be generated.
This change splits the semantics, allowing GLES applications to get an error,
and WebGL applications to get a warning.
Note: This change is related to https://chromium-review.googlesource.com/829138
(for angleproject:2285).
Bug: angleproject:3381
Change-Id: Ie243b7dd72102aeb52df506d121d1d2a8f6974d3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1716617
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Ian Elliott <ianelliott@google.com>
|
|
592539fd
|
2019-07-10T13:15:59
|
|
Implicit conversions for Desktop GL shaders
Need to support implicit conversions between types for GL shaders
Other small fixes to support GL shaders
Bug: angleproject:3673
Change-Id: I5341cb7195054ccc4cd36aad5dc8c801c7e1a14f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1698649
Commit-Queue: Clemen Deng <clemendeng@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
b7418a17
|
2019-07-03T13:53:11
|
|
Restore flatten invariant behavior
This was removed with a previous commit to fix behavior of invariant
pragma overall, however, the flattening is still needed for the initial
translation step of webGL VSs.
This change restores the flattening as it previously existed, however it
is now only applied to VS outputs. FS inputs are no longer flattened as
the previous fixes preclude the need for that workaround any longer.
Bug: 980675
Change-Id: Ia3c0471e24cae2905eb0d7bde153091e4d3829b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1687788
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Tobin Ehlis <tobine@google.com>
|
|
38ff3c70
|
2019-05-15T10:07:09
|
|
Vulkan:Allow same-named var in nested scope
ESSL 1.00 spec allows for variable with same name to override outer variable
inside of a nested scope. This change adds new scope to symbol table inside
of a function defintion, but after function parameters for ESSL 1.00
shaders (but not webGL). This prevents an error while parsing.
This also includes some new code in translator to rename any vars that are
redefined between the function body and the function parameters. This
prevents an error later on when the translated shader is then parsed as
a desktop GLSL version.
Bug: angleproject:3287
Change-Id: I3f025805cf8d65bf912283bb15e6dad6e5e9b967
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601553
Commit-Queue: Tobin Ehlis <tobine@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
ebab670c
|
2019-04-19T14:36:45
|
|
Adding new extension GL_OVR_multiview
GL_OVR_multiview functions exactly the same as GL_OVR_multiview2.
All GL_OVR_multiview2 tests now also repeat the same test using GL_OVR_multiview
Bug: angleproject:3341
Change-Id: I7e5294fb6bbf7692535174a15da6a42e1b5fc4e2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575904
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
e9421b2c
|
2019-04-08T15:16:56
|
|
Vulkan:Only apply invariant pragma to output vars
The "#pragma STDGL invariant(all)" directive should only be applied to
shader output vars. This change also removes the workaround
SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT which is no longer needed.
This change fixes two tests that were incorrectly assuming that the
pragma would be applied to inputs: GLSLTest.InvariantAll[Both|In].
Bug: angleproject:1293
Bug: angleproject:3285
Change-Id: I4eb03fa89fbc7c560150ee0cc32382024b0cb3e3
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558678
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tobin Ehlis <tobine@google.com>
Commit-Queue: Tobin Ehlis <tobine@google.com>
|
|
7d64c486
|
2019-03-12T14:27:40
|
|
GL_ANGLE_multiview has been renamed to GL_OVR_multiview2.
changes include:
1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change
2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported
3) WebGL 2 (ES3) is required for multiview
Bug: angleproject:3341
Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023
Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ee7ffd9e
|
2018-12-13T14:07:52
|
|
ES31: Enabling skipped deqp atomic counter tests on D3D11
Enabling deqp tests previously skipped due to lack of atomic counters. Fixing
bug found in translator found by new tests.
* Switching atomicCounterDecrement from pre to post decrement
* Added 4 byte alignment check to atomic_uint offset
* Added workaround for NVIDIA D3D bug
* Added globallycoherent to atomic counters
Bug: angleproject:1729
Change-Id: If62ea003826fbe2df0834b905ff3ad7b76328399
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1480867
Commit-Queue: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
f563fdc9
|
2019-01-31T13:53:59
|
|
Reland "Fix unit test for setting locale creating malformed HLSL shader code
Fix malformed HLSL shader code in other locales than classic"
This is a reland of 5f662c0042703344eb0eef6d1c123e902e3aefbf
Original change's description:
> Fix unit test for setting locale creating malformed HLSL shader code
> Fix malformed HLSL shader code in other locales than classic
>
> Bug: angleproject:1433
> Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26
> Reviewed-on: https://chromium-review.googlesource.com/c/1447862
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Bug: angleproject:1433
Change-Id: I94caf7b4c7179119e5a5567c3014d7232df45a13
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516192
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
1d35d511
|
2019-02-15T15:39:27
|
|
Revert "Fix unit test for setting locale creating malformed HLSL shader code"
This reverts commit 5f662c0042703344eb0eef6d1c123e902e3aefbf.
Reason for revert: Some recent crashes related to streams, could be
related to this change.
https://bugs.chromium.org/p/chromium/issues/detail?id=932359
Original change's description:
> Fix unit test for setting locale creating malformed HLSL shader code
> Fix malformed HLSL shader code in other locales than classic
>
> Bug: angleproject:1433
> Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26
> Reviewed-on: https://chromium-review.googlesource.com/c/1447862
> Reviewed-by: Geoff Lang <geofflang@chromium.org>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
TBR=geofflang@chromium.org,jmadill@chromium.org,jonahr@google.com
Bug: angleproject:1433
Change-Id: I28caa073b3996a95f3f233bed9dc91dc44263835
Reviewed-on: https://chromium-review.googlesource.com/c/1474624
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
5f662c00
|
2019-01-31T13:53:59
|
|
Fix unit test for setting locale creating malformed HLSL shader code
Fix malformed HLSL shader code in other locales than classic
Bug: angleproject:1433
Change-Id: I30bad0bd0cfda465ec7200e48e12800d7d8efd26
Reviewed-on: https://chromium-review.googlesource.com/c/1447862
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
19f2f9eb
|
2018-12-07T15:10:48
|
|
Mark variable to call 'length()' as statically used
Bug: angleproject:3008
Change-Id: I8779706c667f49fddb0a741f5bf31c4af54db3e7
Reviewed-on: https://chromium-review.googlesource.com/c/1367404
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
b980c563
|
2018-11-27T11:34:27
|
|
Reformat all cpp and h files.
This applies git cl format --full to all ANGLE sources.
Bug: angleproject:2986
Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f
Reviewed-on: https://chromium-review.googlesource.com/c/1351367
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
6aab06e0
|
2018-11-20T14:04:11
|
|
Don't allow unary operators on void types.
BUG=900058
Change-Id: Ice8976ddd9cbc9c90162cf7fae2b8f91ddcfcef3
Reviewed-on: https://chromium-review.googlesource.com/c/1344590
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
c3bef3e7
|
2018-10-03T07:35:09
|
|
Allow 'defined' in define in non-WebGL.
This is needed to pass dEQP conformance. Several of the harder dEQP
tests around this behaviour are excluded from the mustpass list. This
is presumably because the behaviours weren't implemented portably.
Nevertheless we need to support conformant behaviour for GLES 2.0
Contexts for the most simple uses.
This also leaves the error behaviour intact for WebGL specs.
Bug: angleproject:1335
Change-Id: Ia80b4f71475efa928488ee6c2ee35c566d4602d4
Reviewed-on: https://chromium-review.googlesource.com/c/1242013
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
1dfd8ae2
|
2018-10-01T15:59:59
|
|
Improve test coverage of constant folding
Clean up some TODOs in the code as well as add tests to make sure that
ANGLE treats expressions indexing into constant arrays as constant
expressions in different contexts. This complements the existing tests
in ConstantFoldingTest.
BUG=angleproject:2298
TEST=angle_unittests
Change-Id: I779bf03891f7d06f14d293e69101c05d7dbf57b6
Reviewed-on: https://chromium-review.googlesource.com/1254067
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
a78092cb
|
2018-09-26T14:16:13
|
|
Support ESSL 3.00 EXT_blend_func_extended shaders
This adds support for the index layout qualifier that's used in
EXT_blend_func_extended to set whether a fragment output should be
bound to the primary or secondary blend source color.
Output locations are now validated correctly so that two outputs can
have the same location as long as they have a different index. Some
tests are fixed to allow this.
BUG=angleproject:1085
TEST=angle_unittests
Change-Id: I1de3ad1406398952287791eca367562bed59d380
Reviewed-on: https://chromium-review.googlesource.com/1245982
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
a6a7842f
|
2018-06-28T08:32:54
|
|
ES31: Support atomic functions on D3D11 - Part I
This patch is the first one of the implementation of atomic
functions in D3D11.
There are mainly two differences in the usage of GLSL and HLSL
atomic functions:
1. All GLSL atomic functions have return values, which all
represent the original value of the shared or ssbo variable;
while all HLSL atomic functions don't, and the original value
can be stored in the last parameter of the function call.
2. For HLSL atomic functions, the last parameter that stores the
original value is optional except for InterlockedExchange and
InterlockedCompareExchange. Missing original_value in the call
of InterlockedExchange and InterlockedCompareExchange results
in a compile error from HLSL compiler.
To handle these differences, we plan to implement the translation
in two steps:
1. Support direct translations from GLSL atomic functions to HLSL
ones.
Direct translation can only handle the following two situations:
(1) The sentence is a GLSL atomic function call without requesting
a return value and it is not atomicExchange or atomicCompSwap:
e.g.
GLSL: atomicAdd(mem, value);
-> HLSL: InterlockedAdd(mem, value);
(2) The sentence is a simple assignment expression: its right is
a GLSL atomic function call and its left is a declared variable.
e.g.
GLSL: oldValue = atomicAdd(mem, value);
-> HLSL: InterlockedAdd(mem, value, oldValue);
2. Support atomic functions in the situations that don't support
direct translations.
We will modify the intermediate tree to make direct translation work
on all these situations.
e.g.
atomicExchange(mem, value);
-> int oldValue;
oldValue = atomicExchange(mem, value);
int oldValue = atomicAdd(mem, value);
-> int oldValue;
oldValue = atomicAdd(mem, value);
return atomicAdd(mem, value);
-> int temp;
temp = atomicAdd(mem, value);
return temp;
for (i = 0; i < atomicAdd(mem, value); ++i)
-> int temp;
temp = atomicAdd(mem, value);
for (i = 0; i < temp; ++i)
{
...
temp = atomicAdd(mem, value);
}
int result = isTrue ? atomicAdd(mem, value) : 0;
-> int result;
if (isTrue)
{
result = atomicAdd(mem, value);
}
else
{
result = 0;
}
This patch completes Step 1 which mainly focus on the translation
from GLSL atomic functions to HLSL ones.
BUG=angleproject:2682
TEST=angle_end2end_tests
Change-Id: I3b655b6e286dad4fd97f255f7fe87521c94db30c
Reviewed-on: https://chromium-review.googlesource.com/1121835
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
b779b12c
|
2018-06-20T11:46:43
|
|
Add kEmptyImmutableString.
We can use this instead of ImmutableString("").
Bug: angleproject:2665
Change-Id: I8b3d5d3075838b9f2caa1627071202e48a5fdc83
Reviewed-on: https://chromium-review.googlesource.com/1108085
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
|
|
1a3bbaa8
|
2018-01-25T11:41:31
|
|
Use ImmutableString instead of TString in QualifierTypes
This avoids unnecessary pool allocations when generating errors. Most
of the returned strings are static.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ia9b26898d499985d61e629fddde7aded4714eddf
Reviewed-on: https://chromium-review.googlesource.com/885818
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
72e3589c
|
2018-06-20T11:43:08
|
|
Refactor debug output of types
Instead of passing around strings from TType::getCompleteString(),
add a stream operator to InfoSinkBase that takes a TType. This makes
the compiler executable a few kilobytes smaller and will help with
getting rid of TString altogether.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I31a6693b40a28824b3959e19ad3c0a2ce0f0a35f
Reviewed-on: https://chromium-review.googlesource.com/1107712
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f5557acc
|
2018-06-15T09:46:58
|
|
translator: Store symbol type in TField.
This allows us to keep a separate symbol type for each field in a
struct. This can allow us to assign internal names to struct types.
It could also allow us to add internal fields to user defined stucts.
Bug: angleproject:2665
Change-Id: I6a129107d9db66c54b98b07684c3ead5801712ba
Reviewed-on: https://chromium-review.googlesource.com/1101565
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
50cf2be0
|
2018-06-15T09:46:57
|
|
Reformat some style in touched files.
This was triggered by running the code generation script.
Bug: angleproject:2665
Change-Id: Id639c78eb618182ee1859678590cf0f559b572c2
Reviewed-on: https://chromium-review.googlesource.com/1101564
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
197d5294
|
2018-04-25T14:29:00
|
|
Wrap all preprocessor code in the angle namespace.
BUG=836820
BUG=801364
Change-Id: I08b6a2f9f12b689e09df6efd916c313e71e8a051
Reviewed-on: https://chromium-review.googlesource.com/1028581
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
|
|
76b2c385
|
2018-03-19T15:51:29
|
|
Store invariant declarations in variable metadata
This is simpler than storing the information in symbol table levels.
Invariant declarations can only be present at the global scope, so
storing the information per level is not required.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Idb07d734950c8a0a8bda5b2380e181902f9eb633
Reviewed-on: https://chromium-review.googlesource.com/1007060
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
5fec7ab2
|
2018-04-04T11:58:33
|
|
Identify functions by unique id in BuiltInFunctionEmulator
Now that unique ids of all builtins are compile-time constants, we can
use them to look up functions in BuiltInFunctionEmulator. This is
simpler than using a custom struct with the name and parameters for
identifying functions.
This requires that we store a reference to a TFunction in those
TIntermUnary nodes that were created based on a function.
This decreases shader_translator binary size by about 6 KB on Windows.
BUG=angleproject:2267
BUG=chromium:823856
TEST=angle_unittests
Change-Id: Idd5a00c772c6f26dd36fdbbfbe161d22ab27c2fe
Reviewed-on: https://chromium-review.googlesource.com/995372
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
59c5b897
|
2018-04-03T11:44:50
|
|
Validate gl_FragData and gl_FragColor access after parsing
After this simply declaring both variables invariant is not treated as
static use.
This simplifies ParseContext a bit, but the effect on compiler
performance tests seems marginal.
BUG=angleproject:2450
TEST=angle_unittests
Change-Id: Ib90cb1d2bd1331542d1cd37732f24efb7833036a
Reviewed-on: https://chromium-review.googlesource.com/992112
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
94bbed1e
|
2018-03-20T14:44:53
|
|
Collect static use information during parsing
We now collect metadata for variables in the symbol table. The
metadata is stored in a map using the variable unique id as a key, so
we can store the variables themselves as constexpr while still having
dynamic metadata.
For now we collect whether a variable is statically read or written.
This can be used to more accurately determine whether a variable is
statically used, but can also enable more optimizations in the future,
such as pruning variables that are never read or folding variables
that are never written after initialization. The collection is done
during parsing, so that nothing is pruned from the AST before the
static use is recorded.
Static writes are flagged in ParseContext::checkCanBeLValue, as that
function is already called for all variables that are written.
Static reads are flagged whenever there's an operation that requires
a variable to be read. This includes:
* Unary and binary math ops
* Comma ops
* Ternary ops
* Assignments
* Returning the variable
* Passing the variable as an in or inout argument to a function
* Using the variable as a constructor argument
* Using the variable as an if statement condition
* Using the variable as a loop condition or expression
* Using the variable as an index
* Using the variable as a switch statement init expression
In case there are statements that simply refer to a variable without
doing operations on it, the variable is being treated as statically
read. Examples of such statements:
my_var;
my_arr[2];
These are a bit of a corner case, but it makes sense to treat them as
static use for validation purposes.
Collecting correct static use information costs us a bit of compiler
performance, but the regression is on the order of just a few percent
in the compiler perf tests.
BUG=angleproject:2262
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ib0d7add7e4a7d11bffeb2a4861eeea982c562234
Reviewed-on: https://chromium-review.googlesource.com/977964
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
7b7d2e6a
|
2018-03-23T16:37:36
|
|
Remove createAssign: only called once
This will make it easier to add tracking of static reads.
BUG=angleproject:2262
TEST=angle_unittests
Change-Id: I23e0587c022c45ac62434a2a0d8170e8978d1c24
Reviewed-on: https://chromium-review.googlesource.com/983916
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
daf120b4
|
2018-03-20T14:21:10
|
|
Clean up checkCanBeLValue
Clarify the code so that it will be easier to add marking statically
written variables here.
BUG=angleproject:2262
TEST=angle_unittests
Change-Id: I821bde29beb89e0f3b0f99dc187d2840f8cd0f9b
Reviewed-on: https://chromium-review.googlesource.com/977963
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
c26214de
|
2018-03-16T10:43:11
|
|
Move AST utilities to a subdirectory
Move AST related utilities to compiler/translator/tree_util.
BUG=angleproject:2409
TEST=angle_unittests
Change-Id: I7567c2f6f2710292029263257c7ac26e2a144ac8
Reviewed-on: https://chromium-review.googlesource.com/966032
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
d4bd963f
|
2018-03-08T16:32:44
|
|
Don't use TIntermSymbol nodes for function parameters
Parameter nodes are not needed - it's simpler to just create a
TVariable object for each parameter when the TFunction is initialized.
With this change we also store only one object per each parameter type
used in built-in functions, instead of one array of TConstParameter
entries for each unique parameter sequence.
This simplifies code and reduces binary size and compiler memory use.
Compiler perf does not seem to be significantly affected.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2b82400dd594731074309f92a705e75135a4c82c
Reviewed-on: https://chromium-review.googlesource.com/955589
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
2bfe9f6b
|
2018-03-02T16:53:29
|
|
Use function id to group functions in ParseContext
This way we can do numeric comparisons instead of string comparisons.
The effect on compiler perf test scores is fairly marginal, but
this reduces binary size by a few kilobytes, and there may be a larger
effect on shaders calling a lot of texture functions.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I077db97b16b16b70b7e18ee037e06d7450d08dc9
Reviewed-on: https://chromium-review.googlesource.com/947952
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d05f964b
|
2018-03-05T12:13:26
|
|
Last case in switch statement can't be empty in ESSL 3.10
This is based on recent discussion in Khronos, though public specs
have not yet been updated to reflect this.
BUG=angleproject:2388
TEST=angle_unittests
Change-Id: I66a0d03b3c2bb9740772a813b543f8f6c6bb2a28
Reviewed-on: https://chromium-review.googlesource.com/947977
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
28cf920e
|
2018-03-02T15:54:56
|
|
Fix checking texture function offset
There was a mistake in one of the texture offset function names being
checked. Fix it and add a test making sure that a similar mistake
cannot slip in again.
BUG=angleproject:2387
TEST=angle_unittests
Change-Id: I2dddfbdc2836f9e7e94ca6573a8f3689eecf7eb2
Reviewed-on: https://chromium-review.googlesource.com/946254
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
437664b4
|
2018-02-28T15:38:14
|
|
Clean up TSymbolTable entry points
TSymbolTable API can be cleaned up further now that we have separate
logic for inserting builtins and user-defined symbols.
BUG=angleprojec:2267
TEST=angle_unittests
Change-Id: I7a228891ecdf4696e50868b9e7dfc2a50b5d8e92
Reviewed-on: https://chromium-review.googlesource.com/941301
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
76bf01d7
|
2018-02-22T14:11:34
|
|
Fix that readonly buffer variable can be assigned
This change will add memory qualifier checking for binaryNode in case the
memory qualifier information is lost.
BUG=angleproject:1951
TEST=angle_unittests
Change-Id: I3f0cfd7d8a059753cf3c982ee0a977b4b0fd0128
Reviewed-on: https://chromium-review.googlesource.com/929877
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
7c8567a3
|
2018-02-20T15:44:07
|
|
Always add most extension symbols to symbol table
An error will be generated either way if the extension symbols are
used incorrectly since each use of an extension function or variable
checks whether the extension is enabled.
We now also track extension in unmangled built-in names, so that
redefining built-ins of extensions that are not enabled can be
supported.
This includes refactoring the shader extension tests to share a common
helper class ShaderExtensionTest.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I9cc5e9bd62fa07796e69256a6a9a493531a62446
Reviewed-on: https://chromium-review.googlesource.com/926526
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
029e8ca7
|
2018-02-16T14:06:49
|
|
Add a constexpr constructor for TFunction
Access to TFunction parameters is now handled through two new members:
a pointer to a parameter array and a parameter count.
There's still also a vector pointer in TFunction for adding function
parameters one by one. This is used when parsing user-defined
functions.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I86987ae56b7cf37f010d0651e9861789050aec2b
Reviewed-on: https://chromium-review.googlesource.com/923987
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
697bf65c
|
2018-02-16T11:50:54
|
|
Avoid redundant symbol lookup when parsing functions
The lexical phase looks up symbols when it encounters an identifier.
Instead of duplicating this work when parsing non-constructor
functions, we now store the symbol looked up in the lexical phase in
TFunctionLookup.
This improves scores of the real world shader compiler perf test by
1-2%.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Idc99776571313d8b654910f9daaf9bf34a048228
Reviewed-on: https://chromium-review.googlesource.com/923725
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
e80825ef
|
2018-02-16T10:24:53
|
|
Simplify built-in function node initialization
Built-ins with no math op associated with them now have the op code
EOpCallBuiltInFunction set. This makes initializing built-in function
nodes simpler, since they can always get the op code from the function
symbol.
We also no longer look for functions in inner scopes, only from the
global scope and from built-in functions.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I55a2642f34bb3c8b8f13183c95fa509ec3b9cfdb
Reviewed-on: https://chromium-review.googlesource.com/923724
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b5db2b49
|
2018-02-12T15:31:56
|
|
Enable -Wimplicit-fallthrough for ANGLE.
Also teach MSVC that ANGLE_CRASH() can't return.
Also fix instances of the warning in build configurations where
UNREACHABLE() can return (e.g. release without dcheck_always_on
or debug).
If the UNREACHABLE()s are truly unreachable, this change has
no behavior change.
Bug: chromium:810767
Change-Id: I68f3587cf3e268c3ef634dce7ae3d70399859d0f
Reviewed-on: https://chromium-review.googlesource.com/914842
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
|
|
defe3937
|
2018-02-13T11:56:09
|
|
Store invariant varying names as ImmutableString
This gets rid of a few extra ImmutableString to std::string
conversions which makes the code clearer. There doesn't seem to be any
significant effect on performance.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I36ebbc8a4130ab8f9d6194feca83ec5dcbc95f78
Reviewed-on: https://chromium-review.googlesource.com/916141
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
41b072b6
|
2018-02-09T10:01:32
|
|
Prepare for -Wimplicit-fallthrough in ANGLE.
Disable the warning for flex-generated output, which contains
lots of intentional fallthrough.
Fixes a bug where GL_SAMPLE_ALPHA_TO_ONE_EXT would fall through
to GL_COVERAGE_MODULATION_CHROMIUM and hence behave like that.
Fixes a bug in the D3D9 state management where invalidating
DIRTY_BIT_POLYGON_OFFSET would also invalidate the stencil bits.
One somewhat common incorrect pattern in ANGLE is nested switch
statements that look like so:
switch (a) {
case a1:
switch (b) {
case b1:
...
break;
}
case a2:
...
}
The assumption here seems to be that the breakk exits the outer
case (here a1), while it in fact only exits the inner switch,
so that we fall through to a2. In most places, I fixed this
by adding an explicit `break` after the inner switch.
This fixes a bug wher GL_PATH_JOIN_STYLE_CHROMIUM would fall through to
GL_PATH_MITER_LIMIT_CHROMIUM in validation (but since the join style
enum is always > 0, this happened to not have an effect in practice).
This also fixes 87 bugs in GetLoadFunctionsMap() where invalid
values would previously return an unrelated function map instead
of the empty load function map.
Bug: chromium:810767
Change-Id: Ib51388c73fbfc229160e2c10f8fb9364cc7c996c
Reviewed-on: https://chromium-review.googlesource.com/911529
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
fbb1c792
|
2018-01-19T16:26:59
|
|
Store symbol names as a ImmutableString
This will enable compile-time initialization of built-in symbols as
well as reducing copying strings.
Most of the code that deals with names is changed to use
ImmutableString where it makes sense to avoid conversions.
The lexer/parser now allocate const char pointers into pool memory
instead of allocating TStrings. These are then converted to
ImmutableString upon entering TParseContext.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: I244d6271ea1ecf7150d4f89dfa388a7745a1150c
Reviewed-on: https://chromium-review.googlesource.com/881561
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
95ed1947
|
2018-02-01T14:01:19
|
|
Add a class for function lookups
Using a purpose-built class for function lookups instead of using
a combination of TFunction and a struct container for the this node
and arguments makes the code clearer.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I3f345d836abeaa7f84cc46b4b840fd06c7e2e1a7
Reviewed-on: https://chromium-review.googlesource.com/897363
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
37b697ed
|
2018-01-29T12:19:27
|
|
Only return symbol from TSymbolTable::find
Whether the symbol is built-in can be easily determined from the
SymbolType stored in the symbol, it doesn't need to be returned
separately. The sameScope value that could be returned from
TSymbolTable::find was never used, so that can be removed as well.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I06958741ebec67d496f830a83b4f6f1359632f45
Reviewed-on: https://chromium-review.googlesource.com/891021
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
68981eb5
|
2018-01-23T17:46:12
|
|
Track parameter qualifiers of functions in call nodes
We now add a reference to TFunction to all TIntermAggregate nodes
where it is possible, including built-in ops. We also make sure
that internal TFunctions added in traversers have correct parameter
qualifiers.
This makes TLValueTrackingTraverser much simpler. Instead of storing
traversed functions or looking up builtin functions from the symbol
table, determining which function parameters are out parameters can
now be done simply by looking it up from the function symbol
associated with the aggregate node.
Symbol instances are no longer deleted when a symbol table level goes
out of scope, and TFunction destructor no longer clears the
parameters. They're all either statically allocated or pool allocated,
so this does not result in leaks.
TEST=angle_unittests
BUG=angleproject:2267
Change-Id: I57e5570da5b5a69a98a8778da3c2dc82b6284738
Reviewed-on: https://chromium-review.googlesource.com/881324
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
dd21ecf8
|
2018-01-10T12:42:09
|
|
Add const qualification to symbol accesses
All accesses to built-in symbols now happen through const-qualified
pointers.
This also encapsulates TSymbolTableLevel inside TSymbolTable.
This prepares for statically allocating built-in symbols.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I473014d978daa765b4a733d761d6c08b28288776
Reviewed-on: https://chromium-review.googlesource.com/859959
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
0e99b7a3
|
2018-01-12T12:05:48
|
|
Prevent changing AST expression type from outside
TIntermNode classes now contain all the logic for setting node types.
Changing the constant values of constant union nodes from outside is
also not necessary anymore.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ic10d41b1e5f93152df440a655057591dc1b783b0
Reviewed-on: https://chromium-review.googlesource.com/863626
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
b60d30f7
|
2018-01-16T12:31:06
|
|
Make TVariable type immutable
This enables using constexpr types for built-in variables and some of
the variables created in AST transformations.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ie85b3c9872a071a7c023ced013b14ad91cff7cee
Reviewed-on: https://chromium-review.googlesource.com/868134
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ea22b7a5
|
2018-01-04T17:09:11
|
|
Constant fold array indexing and comparison
A virtual function to get the constant value of an AST node is added
to TIntermTyped. This way a constant value can be retrieved
conveniently from multiple different types of nodes. TIntermSymbol
nodes pointing to a const variable can return the value associated
with the variable, constructor nodes can build a constant value from
their arguments, and indexing nodes can index into a constant array.
This enables constant folding operations on constant arrays, while
making sure that large amounts of data are not duplicated in the
output shader. When folding an operation makes sense, the values of
the arguments can be retrieved by using the new
TIntermTyped::getConstantValue(). When folding an operation would
result in duplicating data, the AST can just be left to be written out
as is.
For example, if the code contains a constant array of arrays, indexing
into individual elements of the inner arrays can be folded, but
indexing the top level array is left in place and not replaced with
duplicated array literals.
Constant folding is supported for indexing and comparisons of arrays.
In case constant arrays are only referenced through foldable
operations, the variable declarations will be pruned from the AST by
the RemoveUnreferencedVariables step.
BUG=angleproject:2298
TEST=angle_unittests
Change-Id: I5b3be237b7e9fdba56aa9bf0a41b691f4d8f01eb
Reviewed-on: https://chromium-review.googlesource.com/850973
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
c74ec1a5
|
2018-01-09T15:23:28
|
|
Record gl_in array size in a symbol in ParseContext
Instead of referring to the gl_in symbol in the symbol table, create
a gl_in symbol with the right array size once the array size is known.
This makes the type of TIntermSymbol nodes pointing to gl_in
consistent with the variable type.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I31673d33526a91f8d069ee8d7d2f181a49665fd0
Reviewed-on: https://chromium-review.googlesource.com/857004
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
765924f0
|
2018-01-04T12:48:36
|
|
Fold ternary and comma ops only after parsing is done
In case folding a ternary op or a comma op would change the qualifier
of the expression, the folding is deferred to a separate traversal
step.
After this there are no more cases where the type of a TIntermSymbol
node needs to differ from the type of the variable it is referring to.
There are still some cases where some parts of TIntermSymbol type are
changed while keeping the TVariable type the same though, like when
assigning array size to gl_PerVertex nodes or sanitizing qualifiers of
struct declarations.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: I1501c8d361f5f765f43ca810d1b7248d9e2c5986
Reviewed-on: https://chromium-review.googlesource.com/850672
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
8b5e8fdb
|
2017-12-15T14:59:15
|
|
Replace remaining usage of TName with TSymbol
TName used to contain just a subset of the information stored in
TSymbol. It makes more sense to use TSymbol directly instead of
converting it to TName.
This also improves type safety a bit by making some functions only
take in TVariable or TFunction instead of the more generic TName.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Icb46923c25d33ebbbbc06ddc487da25957dda771
Reviewed-on: https://chromium-review.googlesource.com/829143
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
492b5f51
|
2017-12-13T09:39:27
|
|
ES31: Support struct arrays as Geometry Shader inputs
This patch adds the support of struct arrays as valid
geometry shader user-defined inputs.
Struct arrays are accepted as geometry shader inputs to
match the vertex shader outputs that are also declared
as structs.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: I0b5d545b10e9dda576a1c96d7c93ec2450611e9e
Reviewed-on: https://chromium-review.googlesource.com/823622
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bed35d76
|
2017-12-20T16:36:26
|
|
Don't query names of empty symbols
This makes it possible to return a reference from TSymbol::name()
instead of a pointer. This is safer since it completely avoids the
possibility of a nullptr dereference. An assert is making sure that
the function is not being called for empty symbols.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I44279f65989dbb828322843fc0216ba84d91dedf
Reviewed-on: https://chromium-review.googlesource.com/836894
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f095799b
|
2017-12-22T11:10:04
|
|
Fix accessing the name of a nested struct definition
When generating an error message about the struct nesting limit, the
code should make sure that the struct definitions are not nested.
While nested struct definitions by themselves are also an error,
they're not a syntax error so parsing will continue after encountering
them.
This fixes a regression from commit: Don't allocate name strings for
empty symbols.
BUG=chromium:797156
TEST=angle_unittests
Change-Id: I4149fbe874c0e7ec90e690aec078ccaf7313eab0
Reviewed-on: https://chromium-review.googlesource.com/842643
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
b6af22b5
|
2017-12-15T14:05:44
|
|
Store TVariable* in TIntermSymbol instead of storing id
This is an intermediate step to only storing a TVariable * in
TIntermSymbol instead of copying the name.
This makes it possible to get a constant value out of a TIntermSymbol
without doing a symbol table lookup.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ibff588241a4ad4ac330063296273288b20a072c9
Reviewed-on: https://chromium-review.googlesource.com/829142
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
beb6dc74
|
2017-12-14T16:03:03
|
|
Always use TFunction instead of TFunctionSymbolInfo
This reduces unnecessary memory allocations and conversions between
different objects containing the same data.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I87316509ab1cd6d36756ff6af7fa2b5c5a76a8ea
Reviewed-on: https://chromium-review.googlesource.com/827134
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
1bb8528c
|
2017-12-14T13:39:53
|
|
Remove TFunctionSymbolInfo from TIntermAggregate
All the information stored in TFunctionSymbolInfo was duplicated from
the TFunction that the aggregate node pointed to.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I1f5574ab0416e5cae00c3dae6fc11d2fe1fa128c
Reviewed-on: https://chromium-review.googlesource.com/827065
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
0c37100d
|
2017-12-13T17:00:25
|
|
Always create TFunctions for function call nodes
This simplifies code and ensures that nodes get consistent data.
In the future function call nodes could have a pointer to the
TFunction instead of converting the same information into a different
data structure.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ic0c24bb86b44b9bcc4a5da7f6b03701081a3af5c
Reviewed-on: https://chromium-review.googlesource.com/824606
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ae4dbf32
|
2017-12-08T20:49:00
|
|
Don't allocate name strings for empty symbols
This removes unnecessary memory allocations.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ide575ea19ab2f8e9fc93092490f1352efa6024a3
Reviewed-on: https://chromium-review.googlesource.com/817415
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
a2d98141
|
2017-12-15T14:18:55
|
|
Fix allowing non-constant ternary global initializer
Check the qualifier of a node resulting from the folding of a ternary
node correctly. The folded node might even be a TIntermConstantUnion
with a non-constant qualifier.
BUG=angleproject:2285
TEST=angle_unittests
Change-Id: I74516e44ce9d78bc54093a5b58d14cf33a57e6e5
Reviewed-on: https://chromium-review.googlesource.com/829138
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
195be942
|
2017-12-04T23:40:14
|
|
Always create TVariables for TIntermSymbol nodes
TIntermSymbol nodes are now constructed based on a specific TVariable.
This makes sure that all TIntermSymbol nodes that are created to refer
to a specific temporary in an AST transform will have consistent data.
The TVariable objects are not necessarily added to the symbol table
levels - just those variables that can be referred to by their name
during parsing need to be reachable through there.
In the future this can be taken a step further so that TIntermSymbol
nodes just to point to a TVariable instead of duplicating the
information.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I4e7bcdb0637cd3b588d3c202ef02f4b7bd7954a1
Reviewed-on: https://chromium-review.googlesource.com/811925
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bd924af1
|
2017-11-16T15:28:04
|
|
ES31: Remove support of GL_OES_geometry_shader in compiler
This patch intends to remove the support of GL_OES_geometry_shader
in ANGLE compiler.
To make the implementation simpler, currently we decide to only
support "GL_EXT_geometry_shader" as the extension string of geometry
shader in ANGLE.
This patch also updates all the related shaders in angle_unittests
into R"()" format.
BUG=angleproject:1941
TEST=angle_unittests
Change-Id: Ife9858abeedfb46b02c5c2fb1cda16fa27198511
Reviewed-on: https://chromium-review.googlesource.com/773451
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
9d4d7f06
|
2017-12-07T17:11:41
|
|
Classify TSymbols using an enum
Symbols can be either built-ins, user-defined, nameless, or for
ANGLE's internal use. In addition we currently use TFunction symbols
that are not yet resolved - they might later resolve to either a
built-in or a user-defined function. Record this information in each
TSymbol so that TSymbol contains sufficient information for deciding
how to format symbol names in output.
The goal is to eventually replace current uses of TName with pointers
to different TSymbol objects. So far only built-ins and user-defined
symbols have associated TSymbol objects, but that will be expanded to
cover ANGLE's internal symbols as well.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I927ce023fe257cc236da82c127700f3bd72bfe96
Reviewed-on: https://chromium-review.googlesource.com/816952
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
378c3a51
|
2017-12-04T11:32:13
|
|
Clean up storing interface blocks in the symbol table
Merge TInterfaceBlock with TInterfaceBlockName, so that there are no
duplicate data structures for interface blocks. This is similar to the
refactoring that was already done to structs.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I67d2af6ccbe5344bddf9c99030d118fe532fbbd8
Reviewed-on: https://chromium-review.googlesource.com/805819
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
12a18ad3
|
2017-12-01T16:59:47
|
|
Simplify interface block instance recording
Instead of storing instance names as part of TInterfaceBlock, store
instance names only in interface block instance symbols. Wherever the
instance name is needed it can be fetched from the instance symbol.
BUG=angleproject:2267
TEST=angle_end2end_tests
Change-Id: Ia265e4db7901eebec57c9c3769d84c17651a35ba
Reviewed-on: https://chromium-review.googlesource.com/803221
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
614dd0f5
|
2017-11-22T14:04:48
|
|
Replace TCache with static TType instances
Replaces TCache with (static generation + static/dynamic lookups) of
TType instances, using compile-time template and constexpr magic.
Work started by jmadill here: https://crrev.com/c/776280
With more contributions from jmadill here: https://crrev.com/c/801494
Bug: angleproject:1432
Change-Id: I07181543f8fee4b2606cdd2d0738351e83d4ce57
Reviewed-on: https://chromium-review.googlesource.com/786317
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
d5f44c98
|
2017-11-29T17:15:40
|
|
Simplify parsing struct field declarators
This removes the dummy type that was attached to struct declarators
while parsing. This makes TParseContext::addStructDeclaratorList in
particular simpler to understand.
The new TDeclarator data type is the parsed representation of the
struct_declarator grammar rule. It is completely immutable. The name
and location stored in TField can also be qualified as constant now.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2834f87fc0eee0bdb7673ef495a55fb463023c55
Reviewed-on: https://chromium-review.googlesource.com/797033
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
54a29ffd
|
2017-11-28T17:35:20
|
|
Refactor TSymbol to follow naming conventions
This will make it easier to make TStructure inherit from TSymbol.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I73a5a25234c7f965b6970891821ee9d6f0a23aca
Reviewed-on: https://chromium-review.googlesource.com/793812
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f13cadd8
|
2017-11-28T10:53:09
|
|
Fix checking negative index when indexing matrix/vector
It's important that the test against the maximum of the valid range
is only done if the index is positive, so the sanitized index value
is guaranteed to end up in the valid range.
This fixes a regression from commit "Add GLSL support for
runtime-sized arrays in SSBOs".
BUG=chromium:789029
TEST=angle_unittests
Change-Id: Ic7125e383a64e46994b072df6d7e642432c521af
Reviewed-on: https://chromium-review.googlesource.com/792935
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
57ea533f
|
2017-11-22T14:04:48
|
|
TType: Store array sizes vector as a pointer.
This makes TType a literal type, and thus is something that could be
constexpr.
Work started by jmadill here: https://crrev.com/c/776278
Bug: angleproject:1432
Change-Id: I707ddf81eaf029f49d62d2836b7166d265cbdfa1
Reviewed-on: https://chromium-review.googlesource.com/786316
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ebee5b3b
|
2017-11-23T12:56:32
|
|
Add GLSL support for runtime-sized arrays in SSBOs
The GLSL parser now allows a runtime-sized array as the last member in
a shader storage block. Clamping indexing against the memory bounds is
done by determining the array length at runtime.
Runtime-sized arrays are used in dEQP tests for many compute shader
tests, so these now work on the OpenGL backend.
BUG=angleproject:1951
TEST=angle_unittests,
dEQP-GLES31.functional.shaders.linkage.shader_storage_block.*
dEQP-GLES31.functional.shaders.builtin_functions.*compute*
Change-Id: Ibecca24623ca8e4723af6f0e0421fe9711ea828d
Reviewed-on: https://chromium-review.googlesource.com/787976
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
7881cfdf
|
2017-08-23T18:00:21
|
|
Add parsing of arrays of arrays
This changes the grammar so that multiple array sizes can be chained
together, and adds arrays of arrays support to TPublicType. In
TPublicType the array sizes are stored using a pointer to a vector, a
plain vector won't work due to bison restrictions.
A larger subset of program interface query tests now pass. Some are
still failing due to unrelated bugs.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests,
dEQP-GLES31.functional.shaders.arrays_of_arrays.*
dEQP-GLES31.functional.uniform_location.nested_array.*
dEQP-GLES31.functional.program_interface_query.*
dEQP-GLES31.functional.ubo.*level*array.*
Change-Id: Iee16477a3752b953f5068c0473a2ed62fead8155
Reviewed-on: https://chromium-review.googlesource.com/633944
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
2f294c9a
|
2017-11-20T14:47:26
|
|
Add constructors for TMemoryQualifier and TLayoutQualifier.
These replace the ::create methods, to facilitate constexpr versions.
Also adds a constructor of WorkGroupSize that can be made to be
constexpr.
Bug: angleproject:1432
Change-Id: I413d1a56102c94d6a383775110a2b850a7532ea0
Reviewed-on: https://chromium-review.googlesource.com/776279
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
|
|
a3106c58
|
2017-11-03T09:39:39
|
|
ES31: Add atomic memory functions
BUG=angleproject:1442
TEST=angle_unittests, angle_end2end_tests
dEQP-GLES31.functional.compute.shared_var.atomic*
dEQP-GLES31.functional.compute.basic.shared_atomic_op*
dEQP-GLES31.functional.ssbo.atomic.*
Change-Id: I82b54fde3a852d3bd917b1e19680baa1c28fce4d
Reviewed-on: https://chromium-review.googlesource.com/765061
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
1d33c219
|
2017-11-13T10:21:39
|
|
Fix standalone mac compilation
BUG=
Change-Id: I225bd1693f595a64179b8e500cb1e7101fd2e197
Reviewed-on: https://chromium-review.googlesource.com/766472
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|