|
7e48c9eb
|
2019-08-06T17:17:19
|
|
Add explicit integer casts
WebKit uses the -Wshorten-64-to-32 flag which warns on these cases.
Bug: 3439
Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866
Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Reviewed-by: Kenneth Russell <kbr@chromium.org>
|
|
0e2c39f2
|
2019-03-20T15:17:28
|
|
Fix that uniform can't be used as the index of buffer variable
ssbo.a[uniformBlock.index] should be a valid usage. So in this change,
we forward EOpIndexDirectInterfaceBlock to OutputHLSL to process when
the left node is not a SSBO.
Bug: angleproject:3280
Change-Id: I2696d5b1cf420db133a8ba0728116261dd9e9f1e
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531980
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
225f08bf
|
2019-01-03T15:59:29
|
|
Cleanups to StripArrayIndices.
Not picked up in prior review.
Bug: angleproject:3024
Change-Id: I9dd1ea146996c8ac3569070af0cb12df65f0d815
Reviewed-on: https://chromium-review.googlesource.com/c/1394570
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: 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>
|
|
904bb918
|
2019-01-02T16:00:02
|
|
Rename constants in blocklayout.h.
This adds the "k" prefix.
Bug: angleproject:3024
Change-Id: I3771a8a9d90cd5edc7173f2b3817a5f1f053bdd4
Reviewed-on: https://chromium-review.googlesource.com/c/1392399
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@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>
|
|
6494c415
|
2018-11-05T15:46:04
|
|
ES31: Add swizzle support in SSBO (Part 1)
This patch adds the swizzle process if the swizzle node is the last node in
ssbo access chain.
Bug: angleproject:1951
Change-Id: Iecc95baa45e8cc40be9111a15398c7e858bfb99e
Reviewed-on: https://chromium-review.googlesource.com/c/1341234
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
b81ff9e6
|
2018-10-26T17:20:50
|
|
ES31: Add std430 encoder.
Bug: angleproject:1951
Change-Id: I5e469ee5f13604102b0ee268d5bf9f5ac4809ecd
Reviewed-on: https://chromium-review.googlesource.com/c/1278098
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
48f63f90
|
2018-10-26T17:20:50
|
|
ES31: add row major matrix support (part 2)
This patch implements read/write vector data in matrix or matrix data directly
in a shader storage block with row_major qualifier.
Bug: angleproject:1951
Change-Id: Id7847e2245b09414709361412a95c4dd84b9ee97
Reviewed-on: https://chromium-review.googlesource.com/c/1304019
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
5d2dfa46
|
2018-11-03T09:28:17
|
|
ES31: Add array of arrays support in SSBO
Bug: angleproject:1951
Change-Id: I5e92b75a59a3ab24a34b827ae6f968961b8bea49
Reviewed-on: https://chromium-review.googlesource.com/c/1317376
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
5ca3e5a0
|
2018-10-31T11:13:29
|
|
Fix ShaderStorageBlockOutputHLSL::writeEOpIndexDirectOrIndirectOutput
https://chromium-review.googlesource.com/c/1304017 removed str()
wrapping values passed to TInfoSinkBase::operator<<().
This broke ANGLE roll
https://chromium-review.googlesource.com/c/chromium/src/+/1309331
failing compile on linux-libfuzzer-asan-rel bot.
Looks like libfuzzer compiler has a bug, not being able to find
sh::BlockLayoutEncoder::BytesPerComponent.
Wrapping it in str() works around this.
Bug: angleproject:1951
Change-Id: I2deb573667dc1e88d352bad1933c269ec36cf398
Reviewed-on: https://chromium-review.googlesource.com/c/1309975
Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
|
|
d60e42f8
|
2018-10-25T16:33:16
|
|
ES31: add row major matrix support (part 1)
This is the first patch to enable row major matrix suppot in series. This patch
ensures that we can get correct location when we load/store data from matrix.
Currently, only scalar data load/store works well.
mat2x3 data
The location of data[x][y] will be:
data.offset + x * scalarStride + y * matrixStride //row_major
data.offset + x * matrixStride + y * scalarStride //column_major
Bug: angleproject:1951
Change-Id: I5bd7bad7d293219ba610f18eeafc56e70e36de43
Reviewed-on: https://chromium-review.googlesource.com/c/1304017
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
df73a8e5
|
2018-10-25T16:11:20
|
|
ES31: Use std::map<const TField *, BlockMemberInfo> to save ssbo info
Bug: angleproject:1951
Change-Id: I9d6a19c0d63065db69985845a1cd68cfd4b99d1f
Reviewed-on: https://chromium-review.googlesource.com/c/1298913
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
|
|
8edb7188
|
2018-10-10T15:54:23
|
|
ES31: Add structure field member support in SSBO
This patch adds the structure field member support in SSBO. To support it,
below things are done:
1. Calculate the offset and arrayStride in SSBO structure.
2. Support array of arrays translation.
Bug: angleproject:1951
Change-Id: If8f233e6388d5bb905e78c39a85112d394298138
Reviewed-on: https://chromium-review.googlesource.com/c/1278097
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|
|
19603b9e
|
2018-10-18T17:25:33
|
|
ES31: Allow function call, unary, ternary operators in SSBO
When we meet function call, unary or ternary operator in SSBO access chain,
we should transfer the process of them to OutputHLSL.
Bug: angleproject:1951
Change-Id: I740940ac4eee4c5ed52239f14b1d32b1f9cf9385
Reviewed-on: https://chromium-review.googlesource.com/c/1290470
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
6d765b07
|
2018-09-28T14:16:06
|
|
ES31: Fix some bugs in ShaderStorageBlockOutputHLSL
When EOpIndexDirect/EOpIndexIndirect/EOpIndexDirectStruct/TIntermSwizzle
appear in [] in ssbo access chain, we should transfer the process of them to
OutputHLSL.
For example:
instance.v[gl_GlobalInvocationID.x] = data;
// becomes
float_Store(dx_instance, 0 + 16 * gl_GlobalInvocationID.x, _data);
instance.v[s.index[0].x] = data;
// becomes
float_Store(dx_instance, 0 + 16 * _s.index[0].x, _data);
Bug: angleproject:1951
Change-Id: I333e238400a10a799a6294f8759cf9c4ef2451c8
Reviewed-on: https://chromium-review.googlesource.com/c/1250661
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
|
|
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>
|