|
51de3837
|
2022-07-28T00:05:54
|
|
Enable PLS on D3D
Bug: angleproject:7279
Change-Id: Ide498e6ebadc5cd567dc64cd1efed52e777aa32e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3790473
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Chris Dalton <chris@rive.app>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
6f80f0f0
|
2022-08-06T02:29:19
|
|
Translator: Clean up the compile flag passing interface
Historically, compile flags were sent to the translator as a bitmask.
Recently, we were getting close to running out of bits. Additionally,
direct-to-metal work had started to introduce constants to be passed to
the translator, which were misplaced in ShBuiltInResources and Caps.
Recent work on Pixel Local Storage adds even more constants, aggravating
the situation.
In this change, the interface to passing compile flags is reworked. A
struct is passed (instead of a bitmask) that has one bit for each flag.
This can be indefinitely extended. Additionally, the constants needed
by metal and PLS are also placed in this struct. In turn, the backends
can set these options directly, and don't have to hack them into Caps to
further get hacked into ShBuiltInResources.
Bug: angleproject:7559
Change-Id: If93f1e1b8818ad3a0ac708ab04ab93b4b397d114
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812562
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
ccf53e3d
|
2022-06-03T10:40:17
|
|
Translator/HLSL: fix image load/store handling.
Don't output the image load/store string unless we're outputting
HLSL 4.1 (D3D11). Also do some preventative initialization.
Bug: chromium:1327872
Change-Id: Ic757fd6c0c92637f565dc39469ee60dfae145353
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3687335
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
|
|
d3eb61d4
|
2022-05-18T11:00:34
|
|
D3D11: fix SSBO load in a return statement.
Add a special case to load from an SSBO in a return statement.
Add tests that exercise reading from an SSBO in a function, in both
a fragment shader and a compute shader.
Bug: angleproject:7226
Change-Id: I08e6c695bf080eb23661ef4df047f0f1a787b06e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645442
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
|
|
b4ec8eac
|
2022-04-12T12:16:40
|
|
D3D11: implement image load/store for non-compute shaders.
Output image metadata and image2d replacement string in
other shader types.
Implement the actual HLSL transform for fragment shaders.
Re-enable problematic test.
Bug: angleproject:7121
Change-Id: I49b815695757e822e6fdfe599e07ceb5b1d6a75c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3550544
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
6803a2d0
|
2022-04-01T16:52:49
|
|
D3D11: implement SSBOs in pixel and vertex shaders.
Since the 'u' register space for UAVs in pixel shaders is shared
with render targets, and the number of render targets may vary
depending on GL state, this required deferring register allocation
until draw-time output in DynamicHLSL.
Since non-compute shaders aren't able to immediately output the
SSBO declaration, initial register allocation was broken out from
ResourcesHLSL::shaderStorageBlocksHeader()
into ResourcesHLSL::allocateShaderStorageBlockRegisters() with
the former only called for compute shaders. These initial allocations
are offset by the number of RTs at draw time.
Since Raw UAVs may now be created at draw time for non-compute
shaders, call markRawBufferUsage() from the Renderer11::draw*()
entry points as it is from dispatchCompute*().
Bug: angleproject:7156
Change-Id: I6ab65af1ff36df0313e3c1f8f79661b1547ab9a2
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3565562
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
|
|
01341f94
|
2021-10-11T19:26:07
|
|
D3D11: implement EXT_clip_control
This implements EXT_clip_control for the D3D11 renderer, so that I can
use a reversed-Z depth buffer with ANGLE.
Tested with
angle_deqp_gles2_tests.exe --deqp-egl-display-type=angle-d3d11 --deqp-case=dEQP-GLES2.functional.clip_control.*
and
angle_end2end_tests.exe --gtest_filter=*D3D11*
Bug: angleproject:6554
Change-Id: I1d11cd04a6654c28530b11104470f0cad0009abe
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3218659
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
|
|
e1a9af6a
|
2021-09-20T10:42:03
|
|
Translator: Fix HLSL vs for loop's init not having initializer
The handleExcessiveLoop code expected that if a for loop has an init
expression that it must necessarily have an initializer as well. That
is not true in (fuzzer-produced) code such as following:
for (int i; ...; ...)
Bug: chromium:1238182
Change-Id: Id761e937a34a6b2feac1266e22207350a3bd616c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3170114
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
1ce78397
|
2021-07-30T16:51:45
|
|
Remove support for WEBGL_debug_shader_precision
This extension was rejected, and the implementation was hacky. This
clean up is part of an ongoing work to improve precision handling.
Bug: angleproject:6059
Change-Id: If08581ec6f19cf1698ffa3dd6d248dc5e68a1d31
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3064303
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
0e1c90cf
|
2021-07-21T10:24:26
|
|
Translator: Validate function parameter qualifiers
This change cleans up a confusion in EvqConst and EvqConstReadOnly,
where the former was frequently used instead of the latter for function
parameters.
The change makes the following renames to make the intent of the
relevant qualifiers clearer:
EvqIn -> EvqParamIn
EvqOut -> EvqParamOut
EvqInOut -> EvqParamInOut
EvqConstReadOnly -> EvqParamConst
Bug: angleproject:4889
Change-Id: Idedd32c08a91de069b91b1657d6b783dddece04a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3041622
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Shahbaz Youssefi <syoussefi@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>
|
|
ac8e1196
|
2021-03-20T11:29:50
|
|
SSBO handling rewrite.
The basic idea is to replace the current SSBO output traversal by build
a new AST for the Load and Store subtrees, then traverse that AST with
the regular OutputHLSL traversal.
This way, all the paren balancing and state management can go away.
BUG: angleproject:5734
Change-Id: I14d2fecd724d7419fbc9315fad4e9202a741b03f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2773401
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
bd2954a9
|
2021-01-16T11:33:12
|
|
Reland "Cleanup translator option checks"
This reverts commit 9173e01730923823846348e513bb8cbe7eddbbe5.
Reason for revert: This was in a chain of reverts, but is unrelated to the issue.
Original change's description:
> Revert "Cleanup translator option checks"
>
> This reverts commit 9710c4e473c88a38f11eb10c600717181d6e24df.
>
> Reason for revert:
> Earlier CL breaks pre-rotation:
> https://chromium-review.googlesource.com/c/angle/angle/+/2598584
>
> Original change's description:
> > Cleanup translator option checks
> >
> > Use comparison with 0 for explicit conversion to bool.
> >
> > Bug: angleproject:3606
> > Change-Id: Ie0a76d7df829227c1376894535813b54e13491b4
> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2631689
> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> > Reviewed-by: Charlie Lao <cclao@google.com>
> > Reviewed-by: Jamie Madill <jmadill@chromium.org>
>
> TBR=syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com
>
> Change-Id: Ib597a62f3c7078d28f7f5b79d1cc9f8d9e469c31
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: angleproject:3606
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2634047
> Reviewed-by: Tim Van Patten <timvp@google.com>
> Commit-Queue: Tim Van Patten <timvp@google.com>
TBR=timvp@google.com,syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com
Bug: angleproject:3606
Change-Id: I10ecca63a3db6dbc3ddedf5bb7e5319a82a80a30
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2633712
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
9173e017
|
2021-01-16T00:10:34
|
|
Revert "Cleanup translator option checks"
This reverts commit 9710c4e473c88a38f11eb10c600717181d6e24df.
Reason for revert:
Earlier CL breaks pre-rotation:
https://chromium-review.googlesource.com/c/angle/angle/+/2598584
Original change's description:
> Cleanup translator option checks
>
> Use comparison with 0 for explicit conversion to bool.
>
> Bug: angleproject:3606
> Change-Id: Ie0a76d7df829227c1376894535813b54e13491b4
> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2631689
> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
> Reviewed-by: Charlie Lao <cclao@google.com>
> Reviewed-by: Jamie Madill <jmadill@chromium.org>
TBR=syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com
Change-Id: Ib597a62f3c7078d28f7f5b79d1cc9f8d9e469c31
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: angleproject:3606
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2634047
Reviewed-by: Tim Van Patten <timvp@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
|
|
9710c4e4
|
2021-01-14T22:41:48
|
|
Cleanup translator option checks
Use comparison with 0 for explicit conversion to bool.
Bug: angleproject:3606
Change-Id: Ie0a76d7df829227c1376894535813b54e13491b4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2631689
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
382bf288
|
2020-12-24T23:56:39
|
|
Organize AST transforms per backend
Most of the AST transforms are written as a workaround to an issue that
affects a single backend. This change identifies such transforms and
organizes them by backend. They are then only built if the respective
backend is.
Additionally, about half of the GL transforms are due to mac
workarounds, including the large RewriteRowMajorMatrices transform.
Mac-specific workarounds are additionally only built on said platform.
This change reduces the ANGLE binary size:
- 106KB in a Vulkan-only build on Linux
- 27KB in a GL-only build on Android (60KB on Linux)
Bug: chromium:1084580
Bug: chromium:1161513
Change-Id: I64b334332c0d4f848756c6538af0d8d96864c7e9
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2601346
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Tim Van Patten <timvp@google.com>
|
|
378653f8
|
2020-11-20T12:24:41
|
|
D3D: throw a perf warning for uniform block
We had translated an uniform block only containing a large array member
into StructuredBuffer instead of cbuffer on D3D backend for slow fxc
compile performance issue with dynamic uniform indexing.
This patch throw a warning if a uniform block containing a large array
member fails to hit the optimization.
Bug: angleproject:3682
Change-Id: I33459b559923f16a8dfb70c6f46ec52f68d96e06
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552365
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
|
|
dc1c1cb5
|
2020-08-12T13:30:26
|
|
Restrict to translate uniform block to StructuredBuffer
We had translated an uniform block only containing a large array member
into StructuredBuffer instead of cbuffer on D3D backend for slow fxc
compile performance issue with dynamic uniform indexing.
Now we add more conditions to restrict the translation. Only indexing
operator is allowed to operate on this uniform block variable. And we
also restrict the types of uniform block's member.
Bug: angleproject:3682
Change-Id: I992b7890d84fcaa6169722af6d7e14785526d48a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2351728
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
|
|
25e21f9f
|
2020-05-07T16:57:37
|
|
Suppress HLSL warnings 3556 and 3571
These are both fairly common, and rarely actionable.
Bug: chromium:765576
Change-Id: Ib067fcbb1d4ffe7fcd47b69dbe5defac81430a70
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2188952
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
|
|
d93b9559
|
2020-04-16T16:16:27
|
|
Translate uniform block with large matrix array to StructuredBuffer
There is a slow compiling issue if translate a uniform block with
a large matrix array member to cbuffer, so translate the uniform
block to StructuredBuffer. But pack_matrix pragma directive is
invalid for matrix element of StructuredBuffer, so pack the matrix
into a structure firstly, and then specifies packing alignment for
the matrix in this structure, last the structure is used as
StructuredBuffer element.
Bug: angleproject:4206
Change-Id: I5a2a512e57b37dcdb88c3060d0d078b46f72eb5e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2154525
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
2caf7ffd
|
2020-03-23T12:12:42
|
|
Address a TODO for instance uniform block
This patch resolves one TODO that Support to translate instance uniform
block containing only a large array member to Structured buffer on D3D
backend when necessary.
Bug: angleproject:4205
Change-Id: If2cd6cf633080820ea33e52269d7d86cd587c9ee
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2114912
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@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>
|
|
0af8b596
|
2019-09-03T16:24:45
|
|
D3D11: Translate uniform blocks to StructuredBuffer when necessary
fxc exhibits slow compile performance with dynamic cbuffer indexing.
So when a uniform block contains only one large array member, which is
an array of structures, translate this uniform block to
a StructuredBuffer instead.
Bug: angleproject:3682
TEST=angle_end2end_tests.UniformBufferTest.*
Change-Id: Ife80dba8aae65b761737e095895e00a570230f88
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1782046
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
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>
|
|
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>
|
|
90a58622
|
2019-09-04T15:39:58
|
|
Refactor ShaderVariable to Remove Specializations
The following structs are being refactored and moved into the parent
struct ShaderVariable:
VariableWithLocation
Uniform
Attribute
OutputVariable
InterfaceBlockField
Varying
Bug: angleproject:3899
Test: CQ
Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Commit-Queue: Tim Van Patten <timvp@google.com>
|
|
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>
|
|
0730e630
|
2019-05-31T14:25:37
|
|
Fix needStructMapping
In previous logic, we didn't check the structure field member type. So
when passing the non-struct member of a structure to a function, it
would think that struct mapping was needed.
In this patch, we add more checking so that struct mapping only happens
when there are structure copy or passing a structure to a function.
BUG=angleproject:2967
Change-Id: Ic98e884c8f8540e180cdf40a0e036ffef18c1689
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1638227
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
3fe06eb3
|
2019-05-21T17:37:25
|
|
D3D: Make sure Lod0 functions are never referenced in non-fragment shaders.
The lod0 functions would not be declared but could still be referenced by
vertex shaders.
BUG=angleproject:3471
Change-Id: I635a8465ce68dc22a6f7387b30bf7e93b14dd67d
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1622741
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
|
|
311e8086
|
2019-05-15T13:25:56
|
|
Do struct mapping under conditions
Struct mapping consumes lots of time when the array lengh is very large.
And it's done unconditionally. This CL does struct mapping only if it's
a struct assignment or passing the struct to a function.
In the next step, we can use a function to do struct mapping instead of
struct array initialization.
Bug: angleproject:2967
Change-Id: Ie5a74fa05dbc0255ad664d6265dbb880a624f01e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1612978
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
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>
|
|
8ba78da0
|
2019-04-30T23:42:31
|
|
add support for EXT_blend_func_extended to D3D11
Change-Id: Id66868851a490d0a68a7e76280720825c4844a45
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1591192
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
|
|
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>
|
|
eaf56133
|
2019-03-13T12:56:49
|
|
gl_VertexID is incorrect if offset argument to glDrawArrays is non-zero
On D3D the vertex ID is always indexed from 0, unlike GL. The D3D
backend had assumed the wrong behavior. This forwards the true offset to
D3D by using the ConstantsBuffer.
Bug: angleproject:3090
Change-Id: Ia19e3490503c97541af14979b75af0c94c67ab6b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520988
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
c9bc33cf
|
2019-03-04T17:31:05
|
|
Disable the initialization of shared memory
This patch disables the initialization of shared memory for d3d backend.
The initialization of shared memory is very slow and may produce
incorrect behavior for some compute shaders on d3d backend.
Bug: angleproject:3226
Change-Id: I41f0f061a5611c52af7667f23938fa48819906b5
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1498385
Reviewed-by: Jamie Madill (use @chromium please) <jmadill@google.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
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>
|
|
f3179a6a
|
2018-07-12T16:22:06
|
|
ES31: Implement bindImageTexture binds a single layer on D3D backend
Dynamically generate image2D variables' declaration and function
definition in libANGLE.
Bug: angleproject:1987
TEST=angle_end2end_tests.ComputeShaderTest.*
Change-Id: Idacc756f7bd15f22eccb1d689e18e997f3e74159
Reviewed-on: https://chromium-review.googlesource.com/c/1142885
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4e712be2
|
2019-01-03T13:53:59
|
|
Refactor BlockLayoutEncoder APIs for std430.
This splits HLSL SSBO access into two steps.
First we compute a mapping from the collected SSBO variable names to
TField pointers. Then during tree traversal we use a block encoding
visitor class that uses the shader names to store BlockMemberInfo
structures for the structures and variables. Each nested structure
is traversed separately so that the BlockMemberInfo offsets are
relative to the structure start rather than the enclosing block. The
array stride for a structure is the size of the struct after all the
alignment is included.
This gives the correct results for the SSBO access chain in the HLSL
code. It also will allow us to use the same encoding and visiting logic
for SSBOs on the API side.
Bug: angleproject:3024
Change-Id: I42b1db0e7547782ae77fe5f64a797f803f203f45
Reviewed-on: https://chromium-review.googlesource.com/c/1352731
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
|
|
4622905b
|
2018-12-10T13:31:00
|
|
ES31: Add atomic memory functions for SSBO
Due to SSBO is translated to RWByteAddressBuffer in HLSL, the corresponding
atomic memory functions atomic* will be translated to
RWByteAddressBuffer.Interlocked*. The translation is like below:
atomicAdd(instanceName.data[0], 5u);
// becomes
uint _ssbo_atomicAdd_uint(RWByteAddressBuffer buffer, uint loc, uint value)
{
uint original_value;
buffer.InterlockedAdd(loc, value, original_value);
return original_value;
}
_ssbo_atomicAdd_uint(_instanceName, 0 + 16 * 0, 5);
Bug: angleproject:1951
Change-Id: If2af8bedb67a4135b443d2512d43c6058a78888d
Reviewed-on: https://chromium-review.googlesource.com/c/1370676
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
88faa696
|
2018-12-03T16:22:24
|
|
ES31: Add unsized array length support in SSBO
Bug: angleproject:1951
Change-Id: I10c798c62a741b156f5b614e0df0795c0e845108
Reviewed-on: https://chromium-review.googlesource.com/c/1365154
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@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>
|
|
efe061bd
|
2018-11-13T16:44:40
|
|
Optimize HLSL zero initializer
Currently we initialize a variable using zero initializer. Take the
below variable for example:
uint var[4];
We translate it to:
uint var[4] = { 0, 0, 0, 0};
If the array size is large, we have to use very long zero initializer.
The problem is that it's very slow for D3D drivers to compile.
This CL uses the 'static' trick below to solve the problem:
static uint _ANGLE_ZEROS_[256];
...
uint var[516] = {_ANGLE_ZEROS_, _ANGLE_ZEROS_, 0, 0, 0, 0};
For 'static', if the declaration does not include an initializer, the
value is set to zero.
https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-syntax
Bug: chromium:898030
Change-Id: Ia3f6574b5ddaffa94bf971140eba95835ee105ee
Reviewed-on: https://chromium-review.googlesource.com/c/1332805
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
|
|
cd47a379
|
2018-11-11T11:08:16
|
|
Add SH_INIT_SHARED_VARIABLES flag
This option is used to initialize shared variables to zero at the
beginning of shader execution to avoid compute shaders being able to
read undefined values that could be coming from another webpage or
application.
It's implemented by declaring variables with initial value for HLSL.
For GLSL, it's not allowed to use declaraction initializer for shared
variables, so we need to explicitly assign them to zero at the
beginning of main(). This implementation is only for HLSL.
Bug: chromium:898030
Change-Id: Ic5906500bf4a35cd9a071923f82f32c5e2991be3
Reviewed-on: https://chromium-review.googlesource.com/c/1330310
Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4a22f4b0
|
2018-10-23T14:36:47
|
|
ES31: Add atomic_uint support to HLSL translator
This is the first commit in a series to enable atomic counter buffers.
Adds support for atomic counters to the GLSL->HLSL translator using
RWByteAddressBuffer.
Bug: angleproject:1729
Test: angle_end2end_tests
Change-Id: I3b7e08f9256dc9bdbcc02ad8910040f2bc14aeac
Reviewed-on: https://chromium-review.googlesource.com/c/1291329
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
a602f906
|
2018-09-11T14:40:24
|
|
ES31: Support shader storage buffer in D3D-API side.
Bug: angleproject:1951
Test: angle_end2end_tests
Change-Id: I0d8a4f8cf00fc7fd2d85315138e2b7457fd0b90c
Reviewed-on: https://chromium-review.googlesource.com/1242846
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a735ee2f
|
2018-05-18T13:29:09
|
|
ES31: Support shader storage block in D3D11 compiler - Part1
This patch is the first step to implement a basic skeleton to translate
shader storage block to HLSL RWByteAddressBuffer.
In GLSL each shader storage block is just one structured block and in API side
it corresponds to a buffer range where stores the whole structure.
RWStructuredBuffer is an array-like object and can have many structured
elements. The structured element doesn't support unsized array and also have
a small limitation on the element size. So we choose RWByteAddressBuffer as
the counterpart of shader storage block in HLSL.
Due to RWByteAddressBuffer does not support using an index to reference a
specific location, we must use Load and Store to process the read/write
operation of a buffer variable. Moreover, in the compiler tree, since we
can't use variable name to get the resource value in RWByteAddressBuffer,
we have to calculate the offset of buffer variable in a shader storage block,
then call the corresponding wrapper function to get the right value.
In this patch, we only process below situations:
assign_to_ssbo := ssbo_access_chain = expr_no_ssbo;
assign_from_ssbo := lvalue_no_ssbo = ssbo_access_chain;
The translation is like below:
// GLSL
#version 310 es
layout(local_size_x=8) in;
layout(std140, binding = 0) buffer blockA {
float f[8];
} instanceA;
layout(std140, binding = 1) buffer blockB {
float f[8];
};
void main()
{
float data = instanceA.f[gl_LocalInvocationIndex];
f[gl_LocalInvocationIndex] = data;
}
// HLSL
RWByteAddressBuffer _instanceA: register(u0);
RWByteAddressBuffer _blockB: register(u1);
float float_Load(RWByteAddressBuffer buffer, uint loc)
{
float result = asfloat(buffer.Load(loc));
return result;
}
void float_Store(RWByteAddressBuffer buffer, uint loc, float value)
{
buffer.Store(loc, asuint(value));
}
void gl_main()
{
float _data = float_Load(_instanceA, 0 + 16 * gl_LocalInvocationIndex);
float_Store(_blockB, 0 + 16 * gl_LocalInvocationIndex, _data);
}
We will do below things in the following patches:
1. Modify the intermediate tree to flatten all ssbo usages to:
assign_to_ssbo := ssbo_access_chain = expr_no_ssbo;
assign_from_ssbo := lvalue_no_ssbo = ssbo_access_chain;
e.g.
intanceA.a +=1;
->tmp = intanceA.a;
intanceA.a = tmp + 1;
while(++instanceA.a < 16) {
}
->
int PreIncrement(out int a)
{
a += 1;
return a;
}
tmp = instanceA.a;
while(PreIncrement(tmp) < 16) {
instanceA.a = tmp
}
2. Add offset calculation for structure and array of arrays.
TODOs have been marked in the corresponding places in this patch.
3. Improve helper functions so that they can process all possible types.
TODOs have been marked in the corresponding places in this patch.
4. Process the swizzle situation.
TODOs have been marked in the corresponding places in this patch.
A possible method is to extend current helper functions like below:
*_Load(RWByteAddressBuffer buffer, uint loc, bool isSwizzle, uint4 swizzleOffset)
Bug: angleproject:1951
Test: angle_end2end_tests
Change-Id: I68ae68d5bb77d0d5627c8272627a7f689b8dc38b
Reviewed-on: https://chromium-review.googlesource.com/848215
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
3e217f65
|
2018-08-28T16:55:20
|
|
Rename UniformHLSL to ResourcesHLSL
In future, atomic counter and shader storage block will be added into UniformHLSL since
they all need the UAV register. So this change renames UniformHLSL to ResourcesHLSL.
Bug: angleproject:1951
Change-Id: Ie9eda090763fbb516468c138e65e111eb12fe514
Reviewed-on: https://chromium-review.googlesource.com/1193322
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
203b26f2
|
2018-07-25T10:30:43
|
|
ES31: Translate compute shader HLSL system variables in compile time
This patch moves the implementation of translating compute shader
builtin variables from link time to compile time.
Unlike graphics shaders that require the information from other
shader stages, we actually have enough information to translate
compute shader builtin variables in compile time.
Many redundant codes in DynamicHLSL have been removed after this
refactor.
BUG=angleproject:1442
Change-Id: I7458006785ff966a00a3825610adc5566652c75e
Reviewed-on: https://chromium-review.googlesource.com/1149609
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
|
|
06235df9
|
2018-07-20T14:26:07
|
|
Make HLSL shaders use only one main function
Instead of having separate main() and gl_main() functions in HLSL
shaders, add initializing outputs and inputs directly to the main
function that's in the AST.
This works around some HLSL bugs and should not introduce name
conflicts inside main() since all the user-defined variables are
prefixed.
BUG=angleproject:2325
TEST=angle_end2end_tests
Change-Id: I5b000c96aac8f321cefe50b6a893008498eac0d5
Reviewed-on: https://chromium-review.googlesource.com/1146647
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
da41ac69
|
2018-07-19T16:45:32
|
|
Fix decorating ViewID_OVR in HLSL output
ViewID_OVR should not be decorated in HLSL output since it is an
internal variable. Make sure that DecorateVariableIfNeeded() is used
for varyings instead of just Decorate() so that the internalness is
checked correctly and ViewID_OVR doesn't get decorated.
This avoids possible name conflicts between the internal ViewID_OVR
and any user-defined variables named ViewID_OVR.
BUG=angleproject:2062
TEST=angle_end2end_tests, angle_unittests
Change-Id: I9ed9876d4b2c760e7a11b0b270a2190993e840e5
Reviewed-on: https://chromium-review.googlesource.com/1143398
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
d8b1c5c5
|
2018-06-20T12:08:46
|
|
Return ImmutableString from ArrayString()
This makes the compiler a few kilobytes smaller, and prepares getting
rid of TString altogether.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I93a003fe27b99bef72f872fa1066e2e108f934c5
Reviewed-on: https://chromium-review.googlesource.com/1107713
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8fbd9d96
|
2018-06-21T15:27:44
|
|
Use ImmutableString in ImageFunctionHLSL
This code is analoguous to the code in TextureFunctionHLSL and is now
implemented in a similar manner.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: Ie3503766217dad4f3848f2d4b2fc3f62b3edce0c
Reviewed-on: https://chromium-review.googlesource.com/1110366
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: 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>
|
|
a75aa3b2
|
2018-06-21T10:38:28
|
|
ES31: Support compute shader shared variables in HLSL
This patch implements 'shared' variables in compute shader on D3D11
back-ends. GLSL shared variables are translated into 'groupshared'
ones in HLSL.
Note that although HLSL allows initializing the variables with
'groupshared' qualifier, currently we do not initialize them because:
1. It is very slow to for d3d11 drivers to compile the compute shader if
we add the code to initialize a shared variable with large array size.
2. It seems unnecessary to do so and in GLSL it is not allowed to
initialize a shared variable in the declaration. (ESSL 3.1, Chapter
4.3.8)
BUG=angleproject:2682
TEST=angle_end2end_tests
Change-Id: Ica8247e1b98059968612a36e369718ef113a598c
Reviewed-on: https://chromium-review.googlesource.com/1109587
Reviewed-by: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
|
|
06a22620
|
2018-05-18T16:48:41
|
|
ES31: Use indices to access image variables in built-in image functions
In order to implement glBindImageTexture to bind a layer of 3D/2DArray/Cube
texture, use indices to access image variables when translating built-in
image functions.
There is a conflict when transferring image2D/iimage2D/uimage2D variables to
an user defined function. For example,
layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1;
layout(r32ui, binding = 1) readonly uniform highp uimage2D uImage_2;
uvec4 lod_fun(uimage2D img, ivec2 p)
{
return imageLoad(img, p);
}
void main()
{
uvec4 value_1 = lod_fun(uImage_1, ivec2(gl_LocalInvocationID.xy));
uvec4 value_2 = lod_fun(uImage_2, ivec2(gl_LocalInvocationID.xy));
}
If uImage_1 binds to a 2D texture, and uImage_2 binds to a layer of 3D texture,
uImage_1 will be translated to Texture2D type, and uImage_2 will be translated to
Texture3D type, "img" type of lod_fun will be translated Texture2D, so uImage_2
cannot be transferred to lod_fun as a parameter.
Indices without Texture/RWTexture information could handle this situation easily.
BUG=angleproject:1987
TEST=angle_end2end_tests.ComputeShaderTest.*
Change-Id: I7647395f0042f613c5d6e9eeb49392ab6252e21e
Reviewed-on: https://chromium-review.googlesource.com/1065797
Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
|
|
f462ac1b
|
2018-06-13T10:22:43
|
|
Remove TIntermRaw
It's not used anywhere and removing it will make changing traversal
code a bit simpler.
BUG=angleproject:2662
TEST=angle_unittests
Change-Id: I4a430a09ceb538c8b0e5d1bb0a95f3fd7657c276
Reviewed-on: https://chromium-review.googlesource.com/1098671
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2a12b3d5
|
2018-05-23T13:42:13
|
|
ES31: Add struct uniform block support in compute shader for D3D
BUG=angleproject:2577
TEST=angle_end2end_tests
Change-Id: I4d84a10508458444d559013e658ae88cd2923f91
Reviewed-on: https://chromium-review.googlesource.com/1069989
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
4733585d
|
2018-02-12T15:41:55
|
|
ES31_GLSL: support invocation and memory control functions
Implement shader invocation control functions and shader memory
control functions on D3D backend.
BUG=angleproject:2280
TEST=angle_end2end_tests.ComputeShaderTest.ShaderInvocationAndMemoryControl
Change-Id: I836c3abde35f19dd40a68cf82ae7c5417c551ab4
Reviewed-on: https://chromium-review.googlesource.com/911986
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
a07b4213
|
2018-03-22T16:13:13
|
|
Move AST transformations to a subdirectory
Move AST transformations to compiler/translator/tree_ops.
BUG=angleproject:2409
TEST=angle_unittests
Change-Id: I9c620e98707d22d005da6192fe7d1b4e8030aadd
Reviewed-on: https://chromium-review.googlesource.com/975550
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
2f7c04a3
|
2018-01-25T14:50:37
|
|
Clean up unnecessary use of TString
TString was being used in some places where it was not really needed.
Clean these up.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ib7fd26f9c6b6b885433c840a9520393908f1f902
Reviewed-on: https://chromium-review.googlesource.com/887068
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
b4cc49fb
|
2018-01-25T14:37:06
|
|
Use only ImmutableString in TextureFunctionHLSL
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: I344ca0098762fcf665365c79d1f8fb04cb1b03f6
Reviewed-on: https://chromium-review.googlesource.com/887067
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
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>
|
|
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>
|
|
c71862aa
|
2017-12-21T12:58:29
|
|
Store referenced interface blocks in a cleaner data structure
The previous code was hard to read since the referenced interface
blocks stored a different type of node depending on if the interface
block was instanced or not.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: Ie8fdb61a17280ca0875159702f819b884d08706b
Reviewed-on: https://chromium-review.googlesource.com/839443
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
bbd9d4c6
|
2017-12-21T12:02:00
|
|
Use TVariable instead of TIntermSymbol for variables
This removes unnecessary indirection. It's easier to just create
TVariables in createSamplerSymbols, and to track referenced variables
using TVariable pointers instead of TIntermSymbol pointers.
BUG=angleproject:2267
TEST=angle_unittests, angle_end2end_tests
Change-Id: Id1e75e04da084eb9026f581f22070b27a45615ba
Reviewed-on: https://chromium-review.googlesource.com/839442
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
93b059db
|
2017-12-20T12:46:58
|
|
Index symbols by id in OutputHLSL
This is cleaner than indexing them by their name string.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I0d0ef5e3f6a3f26c94f096b086cdf3da40d495e4
Reviewed-on: https://chromium-review.googlesource.com/845559
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
d8724a94
|
2017-12-29T18:40:36
|
|
Start D3D constant register allocations from 1 on NVIDIA
Recent NVIDIA drivers have a bug where a specific optimized path
inside the driver doesn't handle constant register 0 correctly. Work
around this by starting constant register allocations from 1. This
should make sure that the bug doesn't trigger if the ordering of
uniforms is changed on the D3D backend.
The repro case seems to require some specific driver state to be set
that's used inside Chromium. Because of this we have not been able to
develop a standalone test case so far.
The maximum number of available uniform slots is reduced accordingly.
This should not take them below required minimums in the spec.
BUG=angleproject:2294
TEST=WebGL tests on passthrough command buffer,
angle_end2end_tests --gtest_filter=*GLSLTest*Uniform*
Change-Id: I92fff71efe5432ea7f15a7e90d497492514c65dc
Reviewed-on: https://chromium-review.googlesource.com/847481
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
4728bdc8
|
2017-12-20T17:51:08
|
|
Unify looking for symbols with a specific name in the AST
Keep only one traverser for looking up symbol nodes by name instead
of having two largely identical ones.
BUG=angleproject:2267
TEST=angle_unittests
Change-Id: I36e906258180e22b7b1353cab79d90266d99fa0e
Reviewed-on: https://chromium-review.googlesource.com/836895
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
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>
|
|
b8cb939f
|
2017-12-20T14:23:19
|
|
Fix tracking variables in folded ternary operators
The result of folding a ternary operator may be a TIntermSymbol node
where the qualifier doesn't match the qualifier of the variable that
the node is referring to.
Get the qualifier from the variable instead of directly from
TIntermSymbol when collecting variables in CollectVariables or when
tracking referenced variables in OutputHLSL.
BUG=angleproject:2288
TEST=angle_unittests, angle_end2end_tests
Change-Id: If294a7fe9dca50f2ebcea3feff887e72a521d395
Reviewed-on: https://chromium-review.googlesource.com/836893
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>
|
|
37385e11
|
2017-12-19T11:50:30
|
|
Emulate tanh on HLSL
This ensures mathematically correct results on large inputs.
BUG=chromium:795269
BUG=angleproject:1093
TEST=dEQP-GLES3.functional.shaders.builtin_functions.precision.tanh*
Change-Id: Id5ba05a3284e51a34f196b419abef0f4a41551e0
Reviewed-on: https://chromium-review.googlesource.com/832463
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>
|
|
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>
|
|
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>
|
|
bd3cd506
|
2017-11-03T15:48:52
|
|
Clean up HLSL constructor output
Split generating HLSL struct constructors from generating built-in
type constructors, as these didn't have much in common. Struct
constructors are now only generated when they are needed, as opposed
to before, when they were generated on any use of a struct.
This changes built-in constructor naming to include "_ctor" and gets
rid of having special built-in type names just for constructors.
This will make it easier to do changes to constructor output, for
example to add constructors for structs in std140 layout. This might
be needed to implement SSBOs efficiently.
This includes one bug fix for writing out struct declarations for
varyings.
Also improves const-correctness of accessing structs through TType
in general.
BUG=angleproject:2218
TEST=angle_unittests, angle_end2end_tests
Change-Id: If865fb56f86486b9c4a2c31e016ea16427f4a5fa
Reviewed-on: https://chromium-review.googlesource.com/753883
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2ef23e2d
|
2017-11-01T16:39:11
|
|
Fix writing uniform block maps to HLSL output
HLSL output maps structs in std140 uniform blocks to a different
layout in order to eliminate padding. The padding may have been
inserted to comply with std140 packing rules.
There used to be two issues in writing the maps: Sometimes the same
map could be written multiple times, and the maps were not being
written for uniform blocks with instance names.
Rewrite how the uniform buffer struct maps get generated so that
the code works correctly. Instead of flagging accesses, structs inside
uniform blocks are gathered from uniform block declarations. When
accesses to structs in uniform blocks are written out in OutputHLSL,
it's checked whether a mapped struct needs to be used instead of the
original one.
This code could still be optimized further by limiting mapped structs
generation to those ones that really need to be used. This is left to
be done later.
BUG=angleproject:2084
TEST=angle_end2end_tests
Change-Id: Iee24b3ef15847d2af64554ac74b8e4be5060d18c
Reviewed-on: https://chromium-review.googlesource.com/751506
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
89a69a03
|
2017-10-23T12:20:45
|
|
Generate performance warnings in HLSL translation
Generate performance warnings for some code that undergoes heavy
emulation when translated to HLSL:
1. Dynamic indexing of vectors and matrices.
2. Non-empty fall-through cases in switch/case.
The warnings are generated only when code is translated to HLSL.
Generating them in the parsing stage would add too much maintenance
burden.
Improves switch statement fall-through handling in cases where an
empty fall-through case follows a non-empty one so that extra
performance warnings are not generated.
BUG=angleproject:1116
Change-Id: I7c85d78fe7c4f8e6042bda72ceaaf6e37dadfe6c
Reviewed-on: https://chromium-review.googlesource.com/732986
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
711b7a12
|
2017-10-09T13:38:12
|
|
ES31: Support images in the compiler on D3D backend.
BUG=angleproject:1987
TEST=angle_end2end_tests
Change-Id: I83f5f9ffda7e676a8f98b963d1f1c50e9463faf4
Reviewed-on: https://chromium-review.googlesource.com/706247
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
2d88e9bc
|
2017-07-21T16:52:03
|
|
Guarantee that symbol nodes get unique ids
The code is refactored so that symbol nodes can only be initialized
with an unique id object. This prevents accidentally forgetting to
create an id for a symbol node.
This opens up possibilities for future optimization: For example the
names and types of symbols could be stored in a central location
inside the SymbolTable, and TIntermSymbol nodes would only need to
store the symbol id. The symbol id could be used to look up the name
and type of the node.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: Ib8c8675d31493037a5a28c7b36bb9d1113cc10f6
Reviewed-on: https://chromium-review.googlesource.com/580955
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
40dbdd6c
|
2017-10-13T13:34:19
|
|
Clean up remaining extra semicolons from HLSL output
There are many types of statements after which a semicolon is not
needed. Skip writing the semicolon in HLSL output in these cases to
make the output code more readable.
BUG=angleproject:1013
TEST=angle_end2end_tests
Change-Id: I8f6a5e4ecfe5def456fdf19cca5ca451c13d7f35
Reviewed-on: https://chromium-review.googlesource.com/718420
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@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>
|
|
852fe873
|
2017-10-10T15:13:59
|
|
Fix HLSL for switch statements that don't end in a branch
In case the last case inside a switch statement is not terminated in
a branch statement, RemoveSwitchFallThrough needs to add it before
calling handlePreviousCase. This ensures that all preceding
fall-through cases will get a copy of the branch statement and so will
not fall through.
This also fixes running RemoveSwitchFallThrough so that it's only
executed once per each switch statement.
The error was not caught by the dEQP tests, so a new ANGLE test is
added.
BUG=angleproject:2178
TEST=angle_end2end_tests
Change-Id: I26b6989aa4d32de2d74cde56d72ee24f61195445
Reviewed-on: https://chromium-review.googlesource.com/709196
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
af5070f7
|
2017-10-10T13:53:25
|
|
Hide RemoveSwitchFallThrough implementation in the .cpp file
This cleans up the API provided by RemoveSwitchFallThrough.h, and adds
documentation about caveats of RemoveSwitchFallThrough. This change is
pure refactoring without any functional changes.
BUG=angleproject:2177
TEST=angle_end2end_tests
Change-Id: I2646e4fe3b53130b07977823cb1344e5096f67e4
Reviewed-on: https://chromium-review.googlesource.com/709194
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
8886f0fc
|
2017-10-10T11:59:45
|
|
Clean redundant semicolons from HLSL branch statements
Branch statements can only exist inside block nodes. The block node
that contains a branch will take care of writing a semicolon after
each statement.
BUG=angleproject:1013
TEST=angle_end2end_tests
Change-Id: Ie5d9077c5d2e090c704282dba39b4d46845cbf1e
Reviewed-on: https://chromium-review.googlesource.com/708894
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
2a1e8f95
|
2017-07-14T11:49:36
|
|
Refer to GLSL extensions through TExtension enum
Extensions are now referred to by enum values instead of strings most
of the time. This gets rid of unnecessary copying of strings. The code
is easier to work with than before as typoing the extension enum names
will be caught by the compiler.
BUG=angleproject:2147
TEST=angle_unittests
Change-Id: Ifa61b9f86ef03211188fc23bc23a5ce4e4d8c390
Reviewed-on: https://chromium-review.googlesource.com/571002
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
ec3a9cbb
|
2017-09-07T12:18:01
|
|
Only support GL_OVR_multiview extension variant
The WebGL spec proposal was changed so that only GL_OVR_multiview
extension name is supported, instead of having two variants
OVR_multiview and OVR_multiview2. We're only supporting the WebGL
version of the shader extension, so we drop compiler support for
GL_OVR_multiview2. Shader restrictions were also removed from the
WebGL spec, so no special validation for how ViewID_OVR gets used is
needed.
Tests that were testing for the shader restrictions are either removed
or changed from negative tests to positive tests.
BUG=angleproject:1669
TEST=angle_unittests
Change-Id: I83f92b879376d41b727b5aca419fd75fb6f53477
Reviewed-on: https://chromium-review.googlesource.com/654608
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|