|
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>
|
|
72b4e1e5
|
2017-08-31T15:42:56
|
|
D3D11: Add support for multiview layered rendering
A branch is added in the geometry shader to select either the
viewport, or texture layer which is being rendered to based on the
value of a uniform in the driver constant buffer. Using this approach
there is no need for separate programs for side-by-side and layered
rendering.
BUG=angleproject:2062
TEST=angle_end2end_tests
Change-Id: I66701164ff02a851c13695d5409f8ad350534e69
Reviewed-on: https://chromium-review.googlesource.com/645547
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: 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>
|
|
41ac68e7
|
2017-06-06T12:16:58
|
|
Select viewport index in GS for multi-view instanced rendering
The patch extends the OutputHLSL and DynamicHLSL translators to
select the viewport index in the geometry shader and propagate
the ViewID variable to the fragment shader.
BUG=angleproject:2062
TEST=angle_end2end_tests
Change-Id: I9e344a7521e2e1137e6eb38d0bfecea8bece778f
Reviewed-on: https://chromium-review.googlesource.com/608967
Commit-Queue: Martin Radev <mradev@nvidia.com>
Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
e86db0c1
|
2017-08-11T15:24:58
|
|
Remove unused vectorSize() from OutputHLSL
BUG=angleproject:2125
TEST=compile
Change-Id: Ideae29190bd9cd56ecdc0ea31a078d4460413540
Reviewed-on: https://chromium-review.googlesource.com/616145
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
599555b5
|
2017-08-15T11:12:42
|
|
Clean up createSamplerSymbols
The arrayOfStructsSize parameter can always be determined from the
TType object, so there's no need to pass it to
TType::createSamplerSymbols. Furthermore, it's more natural to do
the processing for arrays of structs in TType::createSamplerSymbols,
rather than in the TStructure::createSamplerSymbols helper it is
using.
Also rename some parameter names, and move createSamplerSymbols
implementation to Types.cpp.
This refactoring change prepares for implementing arrays of arrays.
BUG=angleproject:2125
TEST=angle_end2end_tests
Change-Id: I3f8bec711c0434677ebcf3741abb4f910c36dba3
Reviewed-on: https://chromium-review.googlesource.com/614883
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
28839f03
|
2017-08-15T11:38:16
|
|
Fix handling sampler arrays in structs as function arguments on HLSL
Some of the code was written under the mistaken assumption that
createSamplerSymbols would be splitting sampler arrays in structs into
individual samplers. Fix it by adding array dimensions to sampler
parameters generated by createSamplerSymbols when necessary.
BUG=angleproject:2128
TEST=angle_end2end_tests
Change-Id: Ie622c777d78ae65b5629d12e0ae574800c1b78f5
Reviewed-on: https://chromium-review.googlesource.com/614882
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
9b11ea4f
|
2017-07-11T16:50:08
|
|
Gather UniformBlock and ShaderStorageBlock separately
Refactor InterfaceBlocks since it only stands for UniformBlock before
ES31. But for ES31, uniform block and shader storage block both belong
to interface block.
This CL will add GetUniformBlocks and GetShaderStorageBlocks in
ShaderLang.h. Meanwhile, keep GetInterfaceBlocks which can return all
the interface blocks together.
BUG=angleproject:1951
Change-Id: I3036e201aadfbd490575ed03538c81bcc3793ff3
Reviewed-on: https://chromium-review.googlesource.com/582546
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
ed049ab4
|
2017-06-30T17:38:33
|
|
HLSL: Fix handling arrays of structs in interface blocks
In HLSL output, structs in interface blocks are not accessed directly.
Rather they get copied from the D3D constant buffer to static structs
in the shader header. Fix generating the copy/init code in the header
to handle arrays of structs correctly.
BUG=angleproject:2084
TEST=angle_end2end_tests
Change-Id: If66bd5be3f3570ba591b8b62c5284c06fc83dd45
Reviewed-on: https://chromium-review.googlesource.com/608448
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
3860b6c0
|
2017-07-19T16:17:24
|
|
Fix arrays of structs containing samplers as parameters on HLSL
In HLSL output, samplers are never passed to functions as arrays, but
rather sampler array arguments are expanded into single sampler and/or
texture arguments. This applies also when the samplers were inside
arrays of structs in the original source.
BUG=angleproject:2103
TEST=angle_end2end_tests
Change-Id: Ib1fcba0c0ab3da592d15272eb56a03c3e536f349
Reviewed-on: https://chromium-review.googlesource.com/576041
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
282847e9
|
2017-07-12T14:11:01
|
|
Clean up recording declarations in OutputHLSL
Relying on the AST conforming to known limitations makes the code for
recording referenced varyings easier to understand.
BUG=angleproject:2104
TEST=angle_end2end_tests
Change-Id: Icdcd7602f6ed54fa439f989bf256e261627d11f5
Reviewed-on: https://chromium-review.googlesource.com/568018
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
ff526f14
|
2017-06-30T12:26:54
|
|
Fix variable vs. function name conflict in HLSL output
GLSL ES spec accepts the case where an initializer of a variable calls
a function with the same name as the variable. The HLSL compiler
doesn't accept that. Work around this limitation in the HLSL compiler
by disambiguating user-defined functions from variables with a
different prefix.
BUG=angleproject:2095
TEST=angle_end2end_test, angle_unittests
Change-Id: I41b32a3fcc6fd4c548e8dc3aa680d1b07fcf8719
Reviewed-on: https://chromium-review.googlesource.com/557872
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>
|
|
73badc07
|
2017-03-29T19:14:53
|
|
ES31: Implement glDispatchCompute for D3D backend
BUG=angleproject:1955
TESTCASE=angle_end2end_tests
Change-Id: I69b4df83d67017d39df67753d6d17fc15ececebf
Reviewed-on: https://chromium-review.googlesource.com/462067
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
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>
|
|
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>
|
|
d7297bfb
|
2017-04-19T15:27:10
|
|
Code refactoring: replace NULL by nullptr for pointers.
This is the frist change to replace NULL by nullptr.
It handles the initialization and assignment for pointers.
BUG=angleproject:2001
Change-Id: I6d4bb198a72e38b867cd2f65a6e6f2f61339a0b5
Reviewed-on: https://chromium-review.googlesource.com/481600
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
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>
|
|
92db39e8
|
2017-02-15T12:11:04
|
|
Fix multisample texture operations crashing HLSL generation
This includes a partial implementation of multisample texture
operations on the HLSL backend. It can't be fully tested yet, since
the API side isn't implemented.
BUG=angleproject:1442
TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.*
(successfully compiles instead of crashing)
Change-Id: Ief782db28388a3f8fd8113cc86ce3c4f500f322a
Reviewed-on: https://chromium-review.googlesource.com/443264
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
74da73fe
|
2017-02-01T15:37:48
|
|
Add ESSL 3.10 ldexp/frexp builtins
This adds new built-ins found in ESSL 3.10 section 8.3 Common
Functions.
This includes constant folding support for ldexp and support for both
GLSL and HLSL output. In HLSL these functions need to be emulated.
BUG=angleproject:1730
TEST=angle_unittests
Change-Id: I1330e69978b0cf53efbc3416150194764414e96c
Reviewed-on: https://chromium-review.googlesource.com/435342
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
25aef453
|
2017-01-29T16:15:44
|
|
Add new ESSL 3.10 pack/unpack builtins
This adds new built-ins found in ESSL 3.10 section 8.4 Floating-Point
Pack and Unpack Functions.
This includes constant folding support and support for both GLSL and
HLSL output. In HLSL all of these functions need to be emulated.
BUG=angleproject:1730
TEST=angle_unittests
TEST=dEQP-GLES31.functional.shaders.*pack*norm4x8*
Change-Id: Ibed60286a366cd35c4faafd405e79af562a02a06
Reviewed-on: https://chromium-review.googlesource.com/434170
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
1ecd14b8
|
2017-01-26T13:54:15
|
|
Fold user-definedness of function nodes into TOperator
Whether a function call is user-defined is not orthogonal to TOperator
associated with the call node - other ops than function calls can't be
user-defined. Because of this it makes sense to store the user-
definedness by having different TOperator enums for different types of
calls.
This patch also tags internal helper functions that have a raw
definition outside the AST with a separate TOperator enum. This way
they can be handled with logic that is easy to understand. Before this,
function calls like this left the user-defined bit unset, despite not
really being built-ins either. The EmulatePrecision traverser uses
this. This is also something that could be used to clean up built-in
emulation in the future.
BUG=angleproject:1490
TEST=angle_unittests
Change-Id: I597fcd9789d0cc22b689ef3ce5a0cc3f621d4859
Reviewed-on: https://chromium-review.googlesource.com/433443
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
|
|
9250cb24
|
2017-01-21T10:51:27
|
|
Add ESSL 3.10 integer math built-ins
This adds built-ins found in ESSL 3.10 section 8.8 Integer functions.
This includes constant folding support for functions that may be
constant folded, and support for both GLSL and HLSL output. In HLSL
several of the functions need to be emulated.
The precision qualification for the return value of some of these
functions is determined by special rules, that are now part of type
promotion for TIntermUnary nodes and determining the type of
TIntermAggregate nodes.
BUG=angleproject:1730
TEST=angle_unittests
TEST=dEQP-GLES31.functional.shaders.builtin_functions.integer.*
Change-Id: Ib0056c17671c42b6496c2f0ef059b99f8f25c122
Reviewed-on: https://chromium-review.googlesource.com/431310
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
dfa75e87
|
2017-01-23T09:43:06
|
|
Add support for 4-parameter functions to BuiltInFunctionEmulator
New entry points are needed to support built-ins with more parameters.
Also, now that ops that are not function calls don't use the
TIntermAggregate class any more, it's easier to exclude nodes that are
not candidates for built-in emulation using a simple blacklist rather
than to use a whitelist.
Also includes function name style cleanup in BuiltInFunctionEmulator.
This will make it possible to add necessary emulation for built-ins
from ESSL 3.10.
BUG=angleproject:1730
TEST=angle_unittests
Change-Id: If267fc68f5cb9b2ee6703cbcbbe4d157da44a7e0
Reviewed-on: https://chromium-review.googlesource.com/431297
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
1d9dcc24
|
2017-01-19T11:25:32
|
|
Make AST path always include the current node being traversed
AST traversers tend to sometimes call traverse() functions manually
during PreVisit. Change TIntermTraverser so that even if this happens,
all the nodes are automatically added to the traversal path, instead
of having to add them manually in each individual AST traverser.
This also makes calling getParentNode() return the correct node during
InVisit.
This does cause the same node being added to the traversal path twice
in some cases, where nodes are repeatedly traversed, like in
OutputHLSL, but this should not have adverse side effects. The more
common case is that the traverse() function is called on the children
of the node being currently traversed.
This fixes a bug in OVR_multiview validation, which did not previously
call incrementDepth and decrementDepth when it should have.
BUG=angleproject:1725
TEST=angle_unittests, angle_end2end_tests
Change-Id: I6ae762eef760509ebe853eefa37dac28c16e7a9b
Reviewed-on: https://chromium-review.googlesource.com/430732
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|