|
f3405af0
|
2025-09-25T13:45:08
|
|
Translator: Fix gl_in redeclaration
This was seemingly untested, and had multiple issues:
* GLSL generation would output `gl_in gl_PerVertex { ... } gl_in;`
* SPIR-V generation would redeclare `gl_in` despite one already
existing.
* If sized after declaration, the redeclared `gl_in` was referencing a
different variable than the resized one.
Bug: angleproject:42264111
Bug: angleproject:349994211
Bug: angleproject:447556589
Change-Id: Id63912b68625bafcc64197807b1c8a86e6f952b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6985323
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
|
|
eefcdafd
|
2025-08-29T00:13:27
|
|
Fix some old clang-tidy warnings about move constructors
-- Remove move of copy-only ImmutableString
-- Fix rule-of-five issues with StringPart.
Bug: b/364788123
Change-Id: Ief9c2a83df15d2e8856e8f729c1908df65004bfc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6896659
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
|
|
25390156
|
2025-08-21T00:13:19
|
|
Suppress unsafe buffers on a file-by-file basis in src/ [1 of N]
In this CL, we suppress many files but stop short of actually
enabling the warning by not removing the line from the
unsafe_buffers_paths.txt file. That will happen in a follow-on
CL, along with resolving any stragglers missed here.
This is mostly a manual change so as to familiarize myself with
the kinds of issues faced by the Angle codebase when applying buffer
safety warnings.
-- Re-generate affected hashes.
-- Clang-format applied to all changed files.
-- Add a few missing .reserve() calls to vectors as noticed.
-- Fix some mismatches between file names and header comments.
-- Be more consistent with header comment format (blank lines and
trailing //-only lines when a filename comment adjoins license
boilerplate).
Bug: b/436880895
Change-Id: I3bde5cc2059acbe8345057289214f1a26f1c34aa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6869022
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
362161fa
|
2025-03-28T11:22:46
|
|
Translator: Use unsized int for swizzle components
Bug: angleproject:349994211
Change-Id: Ibee2c664f159960cf9bf860496038bbb32ae355a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6408391
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Reviewed-by: Roman Lavrov <romanl@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
dba77589
|
2025-03-21T14:02:29
|
|
Translator: Fix output-variable-init vs after-main declarations
Bug: chromium:400504716
Change-Id: I105180cd10dda5238c228d16c9f4e15f1bf49e77
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6383079
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
53ec86ab
|
2024-12-17T14:40:31
|
|
WGSL: support small stride arrays in uniforms
WGSL requires arrays in the uniform address space to have a stride
a multiple of 16.
This CL makes WGSL translator emit wrapper structs for array element
types used in the uniform address space, when the array stride is
not a multiple of 16. The exception is for structs that aren't
an aligned size of 16n, and for any types matCx2, since they are
(or will be) handled in different ways that ensure alignment to 16.
This should leave only f32, i32, u32, and vec2.
See https://www.w3.org/TR/WGSL/#example-67da5de6 for an example
of using a wrapper struct.
This requires converting arrays with a wrapper struct element type
to arrays with an unwrapped element type when they are first used;
this can be "optimized" later for the common case of accessing a
single array element, which can then be unwrapped immediately. This
CL generates WGSL conversion functions when necessary.
After this, the only types that can't yet be used in a uniform
are matCx2 and bools.
This is #2 in
https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rt3slgehd4te
Bug: angleproject:376553328
Change-Id: I1edfa7f481a6cbf5b595643aae8728e67bc4b770
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6092038
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Liza Burakova <liza@chromium.org>
Reviewed-by: Matt Denton <mpdenton@google.com>
Commit-Queue: Matt Denton <mpdenton@google.com>
|
|
b16d105f
|
2024-10-03T10:25:32
|
|
Remove Desktop GL front-end support
For Desktop GL applications, please use Zink!
Bug: angleproject:370937467
Change-Id: Ie734634bb62a2e98c80e1b32d8b3d34624da3c04
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5905428
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
d263945a
|
2024-08-20T16:32:36
|
|
Translator: make replaceChildNode() a little more type-safe
If we know the type the child node should be, instead of
static_cast<>ing to the expected type, use getAs{ExpectedType}() and
crash if nullptr.
This would have saved me when the ReplaceVariables() AST transformaton
replaced a TIntermSymbol in a TIntermGlobalQualifierDeclaration with a
TIntermTyped that was not a TIntermSymbol. But
TIntermGlobalQualifierDeclaration can only have a TIntermSymbol as a
child, so this caused confusing crashes.
Other node types have similar expectations of the types of their
children. This doesn't enforce any type safety on TIntermAggregate
children as those are a little more flexible and complicated. This
CL also doesn't enforce non-nullptr children when the parent can't
handle nullptr children.
Bug: angleproject:42267100
Change-Id: Ic7fb41039705aa4f6daec052940d9bfc4974d955
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5800264
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Matthew Denton <mpdenton@chromium.org>
|
|
db00dee5
|
2024-07-05T21:11:53
|
|
Vulkan: Fix SPIR-V gen for literally indexed swizzles
Translation did not take into account the fact that a swizzled vector
can be indexed by a literal (like `vec.zzxy[2]`, which should translate
to `vec.x`). Since this issue affects MSL generation too, such
expressions are folded before they reach the output generators.
Bug: b/351102615
Change-Id: I048aca165cdf22ef8cd7ccd9a8e503ccf636a55f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5680354
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
|
|
40dfb3a8
|
2024-02-12T00:00:00
|
|
Fix length() translation for clip/cull distance arrays
* Fixed a failing assertion when
the arrays are resized.
* Added a compile error for length()
when the arrays are unsized.
Fixed: angleproject:8527
Change-Id: I6379336c546b008095f0875e5b5b4e8e0e5ba3e6
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5293914
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
197beb4d
|
2024-02-13T15:47:32
|
|
Metal: Crash if for loop body is optimized away
Loops might have their bodies optimized away.
For case like `for(;;) if(false);` the constant pruning happens at
parse phase. The else branch (e.e. no else branch, nullptr) would be
selected as the body.
Some code treated the body as optional, some code treated it as
required. Define it as required, and remove all conditional code
related to the loop body.
Bug: angleproject:8532
Change-Id: Ic35f1bf78e63ceb2cee7b96ba99e788efc282e6f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5291554
Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com>
Commit-Queue: Kimmo Kinnunen <kkinnunen@apple.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
d37c97d1
|
2023-04-17T00:00:00
|
|
Metal: Implement OES_shader_multisample_interpolation
* Added support for sample qualifier
and shader interpolation functions
* Added MSL-specific AST transformations
* Adjusted minimum fragment interpolation offset state
query test so that accurate limits could be reported
* Drive-by: Y-flip gl_SamplePosition adjustment
* Renamed ANGLESampleMaskEnabled function constant to
ANGLEMultisampledRendering to correctly reflect its
usage
Bug: angleproject:8097
Bug: angleproject:8131
Change-Id: I25c9f36487e29f05bb9fe874e146d06378fef975
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4440827
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
|
|
bec220f6
|
2022-11-01T22:05:30
|
|
Translator: Fix operand component specifications
Before this change, TIntermConstantUnion::foldUnaryComponentWise always
used the first operand component for some operators. Use the operand
component corresponding to the result component.
Bug: angleproject:7801
Change-Id: I99a941a9eee0c10a4bcb3f515aa5cbf5accc0d52
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3996520
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Auto-Submit: 小田喜陽彦 <akihiko.odaki@gmail.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
58392791
|
2022-04-07T16:14:12
|
|
Translator: Fix crashes with monomorphizing loops
Monomorphize functions crashes when trying to deep-copy a while loop,
and a continue statement. Null check these values before performing
a copy, as this is still valid AST syntax.
Bug: angleproject:7190
Change-Id: I822c0aa062ed844f86aa2b603899d73cbd48255e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3573079
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
861149c7
|
2022-08-03T15:43:29
|
|
Make PLS coherent on desktop OpenGL
Implements ANGLE_shader_pixel_local_storage_coherent using fragment
shader synchronization extensions:
NV_fragment_shader_interlock
INTEL_fragment_shader_ordering
ARB_fragment_shader_interlock
With these extensions combined, we get coherency all 3 big desktop
vendors: NVIDIA, Intel, and AMD.
Bug: angleproject:7279
Change-Id: Ie20b251fb772898e89994b799640f1f2806581eb
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3773990
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
4e046256
|
2022-07-25T17:17:28
|
|
Translator: Fix deep copy of loops and branches
Fixed nullptr dereference when the loop or branch doesn't have an
expression.
Bug: angleproject:7518
Change-Id: Ib888634e409dcbc27ef060bb46017e8911097eef
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3785294
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
c5271e8e
|
2022-04-04T23:28:35
|
|
Vulkan: Emulate GL_KHR_blend_equation_advanced
Based on a change by Brandon Schade <b.schade@samsung.com>
In the translator, when advanced blend is enabled, an input attachment
is added. Based on the listed advanced blend equations, emulation code
is added that performs those equations' functions. The blend equation
itself is passed through a driver uniform.
Note that the advanced blend extension only allows a single output to
use advanced blend, and that should be at location 0.
In the Vulkan backend, when advanced blend is used, the driver uniform
to select the equation is updated and normal blending is disabled.
Bug: angleproject:3586
Change-Id: Icc42e8be238d34fca149087eb9cfe616a7643a6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3575738
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
0f00fbae
|
2022-01-21T00:28:48
|
|
Translator: Make vec/matrix size getters unsigned
TType stored type's primary and secondary sizes as `unsigned char`, but
the getters returned `int`. This caused unnecessary casts when the size
was passed from one TType to another, as well as comparisons with other
unsigned numbers.
This change specifies the type of these members as `uint8_t` and makes
the getters return the same type. The call sites are accordingly
adjusted to remove unnecessary casts, use the correct type in local
variables, and add casts when passed to ostream::operator<<.
Bug: angleproject:6755
Change-Id: Ia4d86bd4ccb5c1a2ae1e10a0085a5166c3a6bcf7
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402850
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
0ab15998
|
2022-01-07T09:59:23
|
|
Translator: Don't promote precision for assignment operation lvalues
Assignment operations should use the precision of their
lvalue-expression, even if their rvalue-expression has
higher precision.
Bug: angleproject:6889
Change-Id: I9a105631defb6c1e27870c96517aa66fbd95543e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3381906
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Brandon Schade <b.schade@samsung.com>
|
|
fefbc3fb
|
2021-09-01T16:26:20
|
|
Vulkan: SPIR-V Gen: Re-fix precision of constructors
In f3aea7447eae7f5a4a5ad1425ab375b66048ba3f, the precision of
constructors was changed such that it would be derived from its
operands, but also be able to be promoted based on neighboring operands.
Based on https://gitlab.khronos.org/opengl/GLSL/-/issues/58 this is
incorrect, and indeed the precision of the constructor (when possible)
solely depends on its own operands.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Ic2560d17973f56d4d836e3c7112d6649197a306c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3138534
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
f3aea744
|
2021-08-25T22:09:58
|
|
Vulkan: SPIR-V Gen: Fix precision of constructors
According to the spec, constructors don't have a precision (and thus
their precision is derived from the operands they are used in.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: I557386764abf5493fbe59803dc8e260312c04b48
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3119352
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
fbdd0516
|
2021-08-27T00:04:11
|
|
Vulkan: SPIR-V Gen: Fix precision of imageLoad
According to the spec, imageLoad should return highp. However, glslang
produces the same precision as the image (which makes more sense). This
seems to be a spec bug per the discussion in this issue:
https://gitlab.khronos.org/opengl/GLSL/-/issues/57
This change aligns ANGLE with glslang w.r.t to the precision of
imageLoad.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Ia0ce493a0deab21810458da6b48fdf51dfbd41a2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3122317
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
800e82c6
|
2021-08-23T11:05:23
|
|
Translator: Validate precisions
When declaring a variable, a struct field, function parameter etc,
there's a precision necessarily applied to the entity being declared.
AST Validation is added to enforce this. Intermediate nodes derive
their precision from these entities automatically.
Consistency of intermediate nodes is not validated. This is because AST
transformations replace a node with a transformed one, and that may not
have the same precision. Take the following code:
mediump float x = ...;
mediump float y = ...;
... x + y ...
and assume is transformed as such:
highp float driver_uniform;
... (x * driver_uniform) + y ...
The addition was originally done in mediump, but would seemingly need to
be done in highp after transformation. There are a number of options
here:
- Make sure that when nodes are replaced, the precision is unaffected.
This can be intrusive, requiring temp variables.
- Bubble up the new precision
- Accept the discrepancy
ANGLE opts for the last option, which actually respects the original
shader's intended precision for operations, even if some transformation
needs to temporarily evaluate an expression at a higher precision.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: Ibcde3a230de159157783b1c6d5ef1cd63ceb4d8f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3114027
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
0cd99779
|
2021-08-05T10:35:10
|
|
Translator: Propagate precision to children nodes
Similarly to glslang, when the precision of a node is determined,
propagate that precision to any of its children that doesn't already
have a precision. Ultimately these should only include
TIntermConstantUnion nodes.
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: I121231d04c7cf92fc3f07716019ffe88eca48b88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3075126
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
2e8a2d3c
|
2021-08-04T11:04:44
|
|
Translator: Helpers to derive precision
Bug: angleproject:4889
Bug: angleproject:6132
Change-Id: I75e2084c76139ccb24b266f262d5e5597d8aa4ca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3071599
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
6fe91881
|
2021-08-02T11:13:13
|
|
Translator: Simplify RecordConstantPrecision
Just before ESSL output, this transformation made some constants
specified through temp variables such that their precision can be
specified. This was done in cases where the precision actually affected
the expression being evaluated.
This transformation is simplified by declaring constants more
conservatively as variables, and not stringently attempting to identify
whether that's necessary. This is still not done in trivial cases.
This change is in preparation for another change that overhauls
precision propagation through the nodes. This change removes all
references to TIntermTyped::getPrecision() outside the precision
promotion code itself.
Bug: angleproject:4889
Change-Id: I135b2b3241aa2f76219b209241c3844f1d09ccd2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067948
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
798c5200
|
2021-07-31T22:17:48
|
|
Translator: Make precise-ness a property of AST nodes
Instead of creating a "set of precise nodes", the nodes themselves are
marked precise. This change is preparation for another change that
overhauls precision propagation through the nodes, and which would also
be storing the promoted precision in the nodes.
Bug: angleproject:4889
Change-Id: Ieec8864be5cd2e95ed6fb4d90b367946d9f33fa1
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3065569
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
f4ce6d00
|
2021-07-15T11:07:25
|
|
Vulkan: SPIR-V Gen: Support bool in interface blocks
SPIR-V doesn't allow bool in interface blocks. Another type
specialization is added for this purpose, turning those bools to uint.
Bug: angleproject:4889
Change-Id: I803bffcf5ea58c913d4df6e7aae3386c67901b25
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3032021
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
8d0eb08c
|
2021-07-05T23:22:24
|
|
Vulkan: SPIR-V Gen: Take advantage of OpConstantNull
As part of fixing GLSLTest*.MissingReturn* tests, refactoring is done
such that complex null values are declared concisely with
OpConstantNull. The tests are fixed by making the SPIR-V generator
implicitly add a `return <null-value-of-correct-type>;` if the return
statement is missing from GLSL.
Bug: angleproject:4889
Change-Id: Iffd80c5e6ce66afcdbf3813bffade6928f292007
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3010578
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
cb87d78c
|
2021-07-08T08:28:04
|
|
Enable -Wshadow with Clang.
Also fixes a few instances of variable shadowing in the code.
Bug: angleproject:6148
Change-Id: Ic51d722a3f953f246f51af6d74abb302f832cf44
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3014875
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
8b869a95
|
2021-06-13T01:09:27
|
|
Translator: Generate Ops for all built-in functions
EOpCallBuiltInFunction is removed in this change, as well as the
"op": "auto" property in builtin_function_declarations.txt. Instead,
gen_builtin_symbols.py automatically generates Ops for every built-in
function and generates the TOperator enum accordingly.
This simplifies SPIR-V code generation by allowing switches to be used
on operators instead of string comparisons.
Bug: angleproject:4589
Bug: angleproject:4889
Change-Id: Ia351524400b0e12a10a5572e27e9b88c6ec2e61c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2958869
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
18ddd131
|
2021-06-07T14:59:43
|
|
Vulkan: SPIR-V Gen: Support mediump/lowp
The mediump and lowp precisions translate to a RelaxedPrecision
decoration in SPIR-V. This change implements this decoration and
enables SPIR-V generation when emulating Bresenham lines. Prior to this
change, Bresenham line emulation resulted in a validation error due to
the vertex shader output being without RelaxedPrecision but the fragment
shader input (translated by glslang) with it.
The function that produces a new id is given a list of decorations to
apply, which itself is automatically deriven from the TType where
applicable, to minimize the risk of any id missing this decoration.
Bug: angleproject:4889
Change-Id: I30cc5a278634c5d83d63cd65b057336f9f573baa
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2946113
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
31641b8e
|
2021-06-05T02:17:47
|
|
Declare specialization constants in the AST
A new qualifier (EvqSpecConst) is added so that specialization constants
can be declared in tree.
This enables TVariable references to specialization constants to be
validated, which were in fact invalid as every reference declared a new
variable. That is fixed.
Bug: angleproject:4889
Change-Id: I1711e41cbc5a1260843d2d004d3568bdae11e963
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2941451
Reviewed-by: Tim Van Patten <timvp@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
1b680b77
|
2021-06-02T22:04:45
|
|
Reland "Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation"
This is a reland of a474fd7de769ae817db83490d410510cdbed75b2
The integer clamp used in this transformation is not available in es100
shaders, and float clamp is used instead.
Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays. Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function. The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node. This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I9397ec7e6bdfb706c2a891b33fd3b2b79e883ccc
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940902
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
|
|
10f15011
|
2021-06-03T19:22:53
|
|
Revert "Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation"
This reverts commit a474fd7de769ae817db83490d410510cdbed75b2.
Reason for revert: breaks GLES2ConformTest, see roll into Chromium:
https://chromium-review.googlesource.com/c/chromium/src/+/2935093
Original change's description:
> Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
>
> This translator flag adds a clamp to non-literal indices to arrays. Two
> strategies were provisioned, using the clamp intrinsic or a hand-written
> function. The latter is ununsed in angle, chromium, firefox and
> webkit, so this change removes this option and uses the clamp intrinsic
> unconditionally.
>
> The clamp itself was added at output generation time with special flags
> set on the index node. This is changed such that a proper AST
> transformation is done and no-special handling would be necessary.
>
> Bug: angleproject:4361
> Bug: angleproject:4889
> Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: I911cfe0199b04dbc3d6d4265775b6c2de00a9777
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2937024
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
|
|
a474fd7d
|
2021-06-02T22:04:45
|
|
Make SH_CLAMP_INDIRECT_ARRAY_BOUNDS do proper AST transformation
This translator flag adds a clamp to non-literal indices to arrays. Two
strategies were provisioned, using the clamp intrinsic or a hand-written
function. The latter is ununsed in angle, chromium, firefox and
webkit, so this change removes this option and uses the clamp intrinsic
unconditionally.
The clamp itself was added at output generation time with special flags
set on the index node. This is changed such that a proper AST
transformation is done and no-special handling would be necessary.
Bug: angleproject:4361
Bug: angleproject:4889
Change-Id: Ieccfd2c1c347563fb5282e9fa66d39304e62f2ca
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2935041
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
d7aa0130
|
2021-04-26T16:56:15
|
|
Upstream Apple's direct-to-Metal backend: compile translator.
This change is meant to merge the translator changes from Apple's
direct-to-Metal backend. Taken from Kyle Piddington's CL:
https://chromium-review.googlesource.com/c/angle/angle/+/2857366/
The goal of this CL is to merge the translator code in a state that
compiles, but not to switch the Metal backend over to use this
translator backend yet.
Bug: angleproject:5505
Change-Id: I68a6354604498cd5fd1eb96c13fc56f3b38f2bd0
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897536
Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
|
|
58eabfd7
|
2021-04-08T23:57:04
|
|
Translator: Validate consistent variable references
Some transformations change variable declarations. This validation
ensures that all references to said variables are appropriately replaced
as well.
Bug: angleproject:2733
Change-Id: I6c2873968eeed4cba66e70069f84eb69a1f77074
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818140
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
f0286e63
|
2021-01-19T12:38:46
|
|
Translator: Stop allocating TIntermSequence
The functions that take a TIntermSequence always copy out / Swap the
contents away. This change makes all TIntermSequences live on the stack
instead of being newed.
Bug: angleproject:5535
Change-Id: I942f1c5e57b00199d5308183f71bd9e18b0608bd
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2636679
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
dc99fc40
|
2021-01-13T00:21:41
|
|
Vulkan: Translator pass to monomorphize problematic functions
With array of array of samplers and images, we currently require the
shader*ArrayDynamicIndexing Vulkan features. With atomic counters, we
require the shaderStorageBufferArrayDynamicIndexing feature.
The above features are required to enable passing opaque uniforms to
functions. This change introduces a translator pass that monomorphizes
functions that receive atomic counters, or partially subscripted array
of array of samplers or images, etc by removing those arguments and
using the opaque uniform directly.
Follow up changes will include:
- Great simplification to RewriteStructSamplers, and removal of
RewriteStructSamplersOld. This will drop dependency to
shaderSampledImageArrayDynamicIndexing and
shaderStorageImageArrayDynamicIndexing.
- Great simplification to RewriteAtomicCounters. This will drop
dependency to shaderStorageBufferArrayDynamicIndexing.
- Emulation of imageAtomicExchange for r32f formats, but changing the
qualifier to r32ui.
Note that parts of RewriteStructSampler are obsolete with this change,
but will be refactored as a follow up.
Bug: angleproject:3881
Bug: angleproject:4071
Bug: angleproject:5535
Change-Id: Ifd1435b2a31ebf364815046886aeded60297da79
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628127
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
5a7356ae
|
2020-01-16T23:22:31
|
|
Add support for non-float mix
The non-float variations of the mix builtin were conditioned to desktop
GLSL, but they are present in ESSL 3.1+. This change also implements
constant folding of these builtins as exercised by dEQP.
Bug: angleproject:4300
Change-Id: Iec34de4cf370e00d67fd605148cd7848f9e122f8
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2006809
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
|
|
9af3e137
|
2019-12-05T15:35:33
|
|
Vulkan: EXT_gpu_shader5 support: fma
Add the fma() builtin function to ESSL.
Bug: angleproject:3569
Change-Id: Ic8419b4c117ecdd8b47aa733bf7aff9ee7579bbf
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954484
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
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>
|
|
1d5aaa6c
|
2019-08-06T11:20:13
|
|
Vulkan: support dynamic indices in array of arrays
Expands existing struct-sampler rewrite to flatten arrays of arrays.
This allows us to support dynamically-uniform array indexing, which is
core in ES 3.2.
Samplers inside (possibly nested) structs are broken apart as before,
and then if the type resulting from merging the array sizes of the field
and its containing structs is an array of array, the array is flattened.
Also adds an offset parameter to functions taking in arrays to account
for this translation.
As a result of outer array sizes leaking into function signatures,
functions taking arrays of different sizes are duplicated according to
how the function is invoked.
Bug: angleproject:3604
Change-Id: Ic9373fd12a38f19bd811eac92e281055a63c1901
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744177
Commit-Queue: James Dong <dongja@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@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>
|
|
73e5e9b5
|
2019-07-22T15:26:17
|
|
Clang warn implicit float to int conversion
1. add '-Wfloat-conversion' in compiler flag for clang
2. fix existed implicit float conversion
Bug: angleproject:3728
Change-Id: I0dc07eeb74c5d6dc480c6f0aa88bc75ab98e4292
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713741
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
c09ae15c
|
2019-02-01T14:16:32
|
|
Enable -Wextra-semi and -Wextra-semi-stmt.
This will prevent users from accidentally making semicolon errors in
the future.
Bug: chromium:926235
Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9
Reviewed-on: https://chromium-review.googlesource.com/c/1446493
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
2b35654d
|
2018-12-20T12:43:37
|
|
compiler: Fix const non-square matrix component mult.
It seems like there weren't any dEQP tests for constant folding of
nonsquare matrices component-wise multiplication. There were a couple
bugs in our implementation which could lead to undefined behaviour.
Fixes the code and cleans up a few style issues.
Also includes a regression test.
Bug: chromium:912505
Bug: chromium:912508
Change-Id: I7fb85d1404a32950fa9fe4c3bbba9edc9f38ddd1
Reviewed-on: https://chromium-review.googlesource.com/c/1387065
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
|
|
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>
|
|
b36a4816
|
2018-09-25T10:15:11
|
|
Vulkan: Add OpenGL line segment rasterization.
Line rasterization rules are implemented using a shader patch. The
patch does a small test and discards pixels that are outside of the
OpenGL line region.
The feature is disabled on Android until we can determine the root
cause of the test failures.
Bug: angleproject:2598
Change-Id: Ic76c5e40fa3ceff7643e735e66f5a9050240c80b
Reviewed-on: https://chromium-review.googlesource.com/1120153
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
1283ef62
|
2018-07-12T10:15:42
|
|
translator: Add TIntermPreprocessorDirective.
This new node type can be used to inject preprocessor directives into
the intermediate tree. Outputting the preprocessor directive is easy
for the GLSL back-end. This can be used to implement workarounds such
as the OpenGL line rasterization rules on Vulkan.
Also fixes the build that was broken on Win/x64 with a prior change and
makes more methods in IntermNode.h const.
Bug: angleproject:2598
Change-Id: Ifd6d0ac7912ccf2137997bb9a0187fd063023d5e
Reviewed-on: https://chromium-review.googlesource.com/1133420
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
c9c259cc
|
2018-06-13T11:03:22
|
|
Add a shared traverse() function for most node types
The traversal logic for many node types is essentially the same. Use
a single traverse() function for all simple node types instead of
having different ones for each node type. Special traversal code is
only needed for those node types where the traversal logic is
overridden in specific traversers or which do special bookkeeping.
This makes traverser behavior a bit more consistent: InVisit calls are
now done for all node types, including if/else, ternary and loop
nodes. Also false returned from visit function will always skip
traversing the next children of that node.
This reduces shader_translator binary size on Windows by 8 kilobytes.
The added helper functions will also make it easier to implement
alternative more efficient traversers.
Unfortunately this also regresses compiler perf tests by around 2-3%.
BUG=angleproject:2662
TEST=angle_unittests, angle_end2end_tests
Change-Id: I3cb1256297b66e1db4b133b8fb84a24c349a9e29
Reviewed-on: https://chromium-review.googlesource.com/1133009
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f54e93d6
|
2018-06-20T11:46:42
|
|
Vulkan: Implement nested sampler structs.
Nested structs are handled similarly as to non-nested samplers in
structs. They are extracted and named according to the same
pattern.
Also enables functional.shaders.random.all_features.fragment*
The remaining work in the samplers-in-structs implementation is to
translate function arguments.
Bug: angleproject:2494
Bug: angleproject:2595
Change-Id: If8170feb71137d4036d352b2b0078518647d48a1
Reviewed-on: https://chromium-review.googlesource.com/1101569
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
93279812
|
2018-06-13T11:22:15
|
|
Remove unnecessary checks when traversing nodes
All children of binary and ternary nodes are guaranteed to be
non-null. We don't need to check for their existence when traversing
the tree.
BUG=angleproject:2662
TEST=angle_unittests
Change-Id: I5575058e7213d0c4b4554ca616b4298e535842d6
Reviewed-on: https://chromium-review.googlesource.com/1098670
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
67d2cd07
|
2018-05-07T10:27:22
|
|
Issue a clearer warning about negative modulus operands
This also adds unit tests for negative modulus operands.
BUG=chromium:839468
TEST=angle_unittests
Change-Id: I6ab5959ba4f7045d2bde71d246695ef0983c5608
Reviewed-on: https://chromium-review.googlesource.com/1046055
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f827123d
|
2018-04-25T13:08:24
|
|
Handle negative float to uint conversion robustly
Converting a negative float to uint is undefined in the GLSL ES 3.00.6
spec.
However, it improves portability if we don't trigger undefined results
in C++ in this case. To do this, we cast negative floats first to
signed integer before casting them to unsigned integer.
We also issue a warning about an undefined conversion in case a
negative float was converted to uint.
BUG=chromium:835868
TEST=angle_unittests
Change-Id: I9835a739ec80699d420a4f91a3bfa112c9a13604
Reviewed-on: https://chromium-review.googlesource.com/1026681
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@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>
|
|
b1de5a7e
|
2018-03-28T14:07:57
|
|
Prevent stack overflow due to recursive swizzle of an l-value
Long chains of recursive swizzling could previously cause a stack
overflow in checkCanBeLValue. Fold recursive swizzling when it is
parsed to prevent this.
BUG=angleproject:2439
TEST=angle_unittests
Change-Id: I83b4c27442185709f6762d5ec23b93244010da05
Reviewed-on: https://chromium-review.googlesource.com/983593
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
|
|
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>
|
|
f7f0b8c3
|
2018-02-21T20:02:23
|
|
Rename operator enums so they can be autogenerated
Camel casing is removed from the enums where it differs from the GLSL
spec. This way it's easier to autogenerate code for built-in
functions mapped to operators.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I2490d5d0e8ffb45eba343f225f76779e63381a65
Reviewed-on: https://chromium-review.googlesource.com/929361
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
2c9cc8b6
|
2018-01-09T16:13:02
|
|
Don't duplicate symbol type information in AST nodes
Function prototype nodes and symbol nodes already refer to symbols
that have type information, so the type doesn't need to be copied to
the TInterm* AST node classes. Now type is only stored in those AST
node classes that represent other types of expressions. They use
a new TIntermExpression base class for this.
Since now we may use the TType from builtin symbols directly instead
of copying it, building the mangled names of types in the correct
memory pool is also required. The code now realizes the types of
built-in variables when they get added to the symbol table.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ic8d7fc912937cb8abb1e306e58c63bb9c146aae9
Reviewed-on: https://chromium-review.googlesource.com/857005
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
ea78d2bb
|
2018-01-09T12:55:27
|
|
Prune unreferenced variables with a constructor initializer
Treat aggregate constructors as having no side effects, which enables
pruning declarators that have a constructor initializer.
Some logic in RemoveUnreferencedVariables is fixed to make this work
correctly for structs. The bugs were previously not exposed since
constructors were treated as having side effects, but now that those
can be pruned the logic needs to be correct.
BUG=angleproject:2298
TEST=angle_unittests
Change-Id: I6fbe61a9e82065196baa29c200bf556fc21d8962
Reviewed-on: https://chromium-review.googlesource.com/856499
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@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>
|
|
2768bc8a
|
2017-12-12T11:51:48
|
|
Clean up creating constant folded nodes
It's not necessary to set the qualifier on folded nodes separately,
they always use the qualifier of the node being folded.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Id2581ef4cae42d7137fbe0caf18c3fcacbf954c6
Reviewed-on: https://chromium-review.googlesource.com/847553
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
923ecef6
|
2017-10-11T12:01:38
|
|
Fix switch statement validation corner cases
The grammar needs to generate AST nodes even for no-op statements,
since they might be the last statement in a switch statement that is
required for switch statement validity. Change the grammar to generate
nodes from empty blocks and empty declarations.
We also need to do some further processing of the AST. This is because
PruneEmptyDeclarations will still remove empty declarations, and at
least the NVIDIA driver GLSL compiler doesn't accept some types of
no-op statements as the last statement inside a switch statement. So
after parsing has finished we do rudimentary dead code elimination to
remove dead cases from the end of switch statements.
BUG=angleproject:2181
TEST=angle_unittests
Change-Id: I586f2e4a3ac2171e65f1f0ccb7a7de220e3cc225
Reviewed-on: https://chromium-review.googlesource.com/712574
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
bb2bbfbb
|
2017-08-24T15:43:33
|
|
Refactor GLSL array length method parsing
This prepares for accepting arbitrary expressions as the "this" node
of the array length method.
BUG=angleproject:2142
TEST=angle_unittests
Change-Id: I728adb6e76d2779dedbabfaeec7d096872e0d00d
Reviewed-on: https://chromium-review.googlesource.com/633945
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
96f6adfa
|
2017-08-16T11:18:54
|
|
Add support for arrays of arrays in AST processing
Data concerning arrays of arrays is added in TType.
Parsing arrays of arrays and support for arrays of arrays in
TPublicType are still left to be implemented later.
ShaderVariable interface for arrays of arrays is also left to be
implemented later.
We rely on existing test coverage to make sure that arrays of arrays
are not accidentally exposed.
BUG=angleproject:2125
TEST=angle_unittests, angle_end2end_tests, angle_deqp_gles31_tests
Change-Id: Ie17d5ac9b8d33958e9126dc0fb40bf1c81ddeec9
Reviewed-on: https://chromium-review.googlesource.com/616146
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3ec75686
|
2017-07-05T17:02:55
|
|
Collect AST transform utilities to a separate file
Collect static functions that are used to create nodes in AST
transformations into a single file.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I6f87422988fa088f2f4b48986e378a2909705cb7
|
|
eb7f90fd
|
2017-07-07T17:25:23
|
|
Remove simple Intermediate.h functions
Most of the functions were just simple wrappers around node
constructors. Dropping this extra redirection makes the code simpler.
The fold() functions of node types are simplified, so that if the node
can't be folded the pointer to the node itself is returned. This makes
the code in ParseContext more straightforward.
The few remaining functions in Intermediate are a bit more complex so
they should be handled separately, but they'll be removed eventually
as well.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I85e11919d1f62358cfba9c011b841e32bc25402f
Reviewed-on: https://chromium-review.googlesource.com/563393
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
cccf2b00
|
2017-07-05T14:50:54
|
|
Reorganize AST traversal utility code
Define TIntermTraverser and TIntermLValueTrackingTraverser in a
separate header file. hash() function is moved out from
TIntermTraverser as it is not related to the core functionality
of traversing and transforming ASTs.
Also reorganize some traversers to follow common conventions:
- Intermediate output is now in OutputTree.h/.cpp
- Max tree depth check is now in IsASTDepthBelowLimit.h/.cpp
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Id4968aa9d4e24d0c5bac90dc147fc9f310de0184
Reviewed-on: https://chromium-review.googlesource.com/559531
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
e72595b4
|
2017-06-06T15:12:26
|
|
Rename EOpFaceForward to EOpFaceforward.
This mirrors the spec naming and makes auto-gen a little easier.
BUG=chromium:697758
Change-Id: I9bcbc2c874b9a93a6d542aedf2b239f01ee708ce
Reviewed-on: https://chromium-review.googlesource.com/526393
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
a22aa4ed
|
2017-05-24T18:17:23
|
|
Mark some internal functions as not having side effects
Precision emulation rounding function calls and vector/matrix dynamic
indexing function calls now get a flag that indicates that running the
function body does not have side effects. This avoids triggering
asserts in OutputHLSL when these internal function calls end up on the
right hand side of a non-unfolded logical operator.
BUG=chromium:724870
TEST=angle_unittests
Change-Id: Id1a2b6b744f6a04c6cdb86a8f4109ccc12bc70b9
Reviewed-on: https://chromium-review.googlesource.com/516705
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
9676d1af
|
2017-05-16T11:29:24
|
|
Handle multiple AST insertions to the same parent in updateTree()
Multiple insertions to the same parent can be handled as long as the
insertions don't have the same position as well. They're sorted in
reverse order so that insertions to greater indices get processed
first.
This helps to make some AST transformations faster - they don't need
multiple tree traversals and updateTree() steps anymore. The
SimplifyLoopConditions AST transformation is changed to only use a
single traversal.
BUG=angleproject:1966
TEST=angle_unittests, angle_end2end_tests,
WebGL conformance tests,
dEQP-GLES2.functional.shaders.*select_iteration_count*
Change-Id: I3183f2644ad58b282926093c77b204fb7e4e9b71
Reviewed-on: https://chromium-review.googlesource.com/506202
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8fab320c
|
2017-05-08T18:22:22
|
|
Share a single TOperator enum among all constructor AST nodes
The code is a lot simpler when the type information is only carried
in the TType of the node, instead of being partially duplicated in the
enum value.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I956376225ec01e469c7afb7378fa48cc097c0cea
Reviewed-on: https://chromium-review.googlesource.com/498768
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a7ecec38
|
2017-05-08T17:43:55
|
|
GLSL: Simplify constructor parsing
Constructor argument checking rules are reorganized to make them
easier to understand and constructor node creation is made simpler.
This removes usage of constructor op codes from ParseContext. This
paves the way for getting rid of constructor op codes entirely, which
will remove duplicate information from the AST and simplify lots of
code.
This refactoring will make adding arrays of arrays slightly easier.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I4053afec55111b629353b4ff7cb0451c1ae3511c
Reviewed-on: https://chromium-review.googlesource.com/498767
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@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>
|
|
4f285443
|
2017-04-21T12:15:49
|
|
Refactoring: replace NULL by nullptr for pointers (2nd CL).
This CL mainly handles the pointer comparisons (== or !=).
BUG=angleproject:2001
Change-Id: I25ac3b61032e7ad91459a1c6541cadc87cf9b160
Reviewed-on: https://chromium-review.googlesource.com/483935
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
8162926b
|
2017-04-19T11:56:01
|
|
Never add declarations without children to the AST
When block nodes were being created for loop bodies that didn't have
braces in the parsed source, the code didn't check if the loop body
was a declaration node without children. Always use appendStatement()
for adding statements to a block, so that declaration nodes without
children don't end up in the AST.
Similarly make sure that loop init nodes aren't declarations without
children.
BUG=chromium:712550
TEST=angle_end2end_tests
Change-Id: I5e79b700fe6158fa2422fcf4cd13818b2bd24863
Reviewed-on: https://chromium-review.googlesource.com/481660
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
f2209f74
|
2017-04-01T12:45:55
|
|
Clean up function name mangling code
Fix a few incorrect comments about mangled names, and refactor
generating mangled names from function call nodes.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I3ee68c4c0982f1a9c28d8e87aafa19f19559bbf8
Reviewed-on: https://chromium-review.googlesource.com/465826
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ec9232bd
|
2017-03-27T17:01:37
|
|
Store unmangled function names in the AST
This makes the code simpler across the board. There are a few cases
where mangled names still need to be generated in AST traversers, but
they are outweighed by much leaner output code for all function nodes.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Id3638e0fca6019bbbe6fc5e1b7763870591da2d8
Reviewed-on: https://chromium-review.googlesource.com/461077
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
fe48632f
|
2017-03-21T09:30:54
|
|
Prefer identifying functions by using symbol ids
The shader translator code is now structured in a way that ensures
that all function definition, function prototype and function call
nodes store the integer symbol id for the function. This is guaranteed
regardless of whether the function node is added while parsing or as a
result of an AST transformation. TIntermAggregate nodes, which include
function calls and constructors can now only be created by calling one
of the TIntermAggregate::Create*() functions to ensure they have all
the necessary properties.
This makes it possible to keep track of functions using integer ids
instead of their mangled name strings when generating the call graph
and when using TLValueTrackingTraverser.
This commit includes a few other small cleanups to the CallDAG class
as well.
BUG=angleproject:1490
TEST=angle_unittests, angle_end2end_tests
Change-Id: Idd1013506cbe4c3380e20d90524a9cd09b890259
Reviewed-on: https://chromium-review.googlesource.com/459603
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|