src/tests/gl_tests/ComputeShaderTest.cpp


Log

Author Commit Date CI Message
Qin Jiajia 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>
Xinghua Cao 1b0acbb5 2019-04-23T15:17:56 Add cases with multiple draws and dispatches D3D11 cannot allow the same (sub)-resource bound as both a SRV and an UAV at the same time. If render pipline and compute pipeline access the same texture, must unset conflicting SRVs and UAVs before drawing and dispatching on D3D backend. Currently, these cases could not pass on D3D11 backend. Bug: angleproject:3152 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I3ed19d7586625aac7fe9f46f86341d136d148019 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1578131 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
jchen10 82bcffa7 2019-04-17T10:45:25 Disable parallel compile for d3d11 compute To observe whether the flaky issues still show up with the feature disabled. Bug: angleproject:3349 Change-Id: I0eae861ad76212fb4a65b57c1e1b5e8c583d6a3b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1571027 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Corentin Wallez e02ad4d3 2019-04-16T14:12:37 Suppress tests crashing on teardown on Win Intel D3D11 BUG=angleproject:3349 Change-Id: Ib86f8b87d719919c980240d3220521a3c7f8a942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1569466 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Qin Jiajia 9b050f84 2019-03-01T13:31:14 Fix that 0 is a valid memory barrier Bug: angleproject:2280 Change-Id: Iad82d5838a7efdb6f6287aafb9ab980e9e86468d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1496017 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>
Qin Jiajia 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>
Qin Jiajia 49c9dfe3 2018-12-29T16:48:20 Fix the SSBO sync bug in two dispatch calls We should make sure that the raw buffer is the latest buffer before each dispatch call since the dispatch itself can update the raw buffer content. Bug: angleproject:3037 Change-Id: I75dddfd3e57b3c9cbcc58c02ed057c66cc8e1785 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1392379 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Xinghua Cao 794364eb 2019-01-17T17:54:29 Add test cases of image built-in functions Add test cases that image accesses a mipmap level of texture, meanwhile exposes two driver bugs. Bug: angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I4c43cdb97de8223d5e9af3757f41eb01eac81d0a Reviewed-on: https://chromium-review.googlesource.com/c/1415727 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 94d8a9a4 2019-01-17T08:47:57 ES31: Enable several SSBO end2end tests on D3D11 This patch enables several SSBO tests on D3D11 in ANGLE end2end tests. Bug: angleproject:1951 Change-Id: I1ba78133e5bbe581e8330c1c43755c174e28bf39 Reviewed-on: https://chromium-review.googlesource.com/c/1415721 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Xinghua Cao 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>
Xinghua Cao c5117571 2018-12-28T15:56:41 Add test case for storage buffer When storage buffer bound is unchanged and shader writes it, buffer content should also be updated. Currently, this case cannot work normally on D3D backend. Bug: angleproject:2814 TEST=angle_end2end_tests.ComputeShaderTest.StorageBufferBoundUnchanged Change-Id: I6f25b7eac84c44392befaca61a33bdf2457f29f9 Reviewed-on: https://chromium-review.googlesource.com/c/1391880 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 84412860 2018-12-21T17:41:24 Set dirty for uniform on D3D backend When uniform's value had been updated, set dirty and update its content on D3D backend. Bug: angleproject:2814 TEST=angle_end2end_tests.ComputeShaderTest .UniformDirty/ES3_1_D3D11 dEQP.GLES31/functional_image_load_store_cube* dEQP.GLES31/functional_image_load_store_3d* dEQP.GLES31/functional_image_load_store_2d_array* Change-Id: Ic135c140559925fe33790475d03dc608afa92384 Reviewed-on: https://chromium-review.googlesource.com/c/1387967 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Xinghua Cao 0d218da4 2018-12-17T11:53:52 Specify texture LOD in compute shader on D3D backend D3D does not define LOD in compute shader, so Sample() is not supported, try to use SampleLevel(). Bug: angleproject:2756 TEST=angle_end2end_tests.ComputeShaderTest .TextureFunction/ES3_1_D3D11 dEQP.GLES31/functional_image_load_store_2d_store* Change-Id: I63e707d2b56e807cfe766cc21bc6b0819982ce80 Reviewed-on: https://chromium-review.googlesource.com/c/1379672 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 35cd7332 2018-12-02T12:03:33 Refactor test shader style. This change enforces a lot more consistency. We pass const char * to the Compile functions instead of std::string. Also fixes the indentation of C++11 block comments to be more consistent. Bug: angleproject:2995 Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78 Reviewed-on: https://chromium-review.googlesource.com/c/1357103 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
jchen10 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>
Qin Jiajia 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>
Bryan Bernhart c55aefe3 2018-08-28T19:59:00 ES31: Support atomic functions on D3D11 - Part III This patch is the third one to support atomic functions on D3D11. In this patch we enable support for atomic function returns outside of assignments (e.g. part of arithmetic operations or to index into arrays) and when used directly initialize a variable. Note that we are still missing the functionality to be tag loops with [allow_uav_condition] as required by InterlockedCompareExchange. BUG=angleproject:2682 TEST=angle_end2end_tests Change-Id: Ia409ebb10621fd5c514cf6c76f366a320a9d9fc1 Reviewed-on: https://chromium-review.googlesource.com/1208317 Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
jchen10 95277a30 2018-09-06T20:12:56 ES31: Add DispatchComputeIndirect support for D3D11 BUG=angleproject:2270 TEST=angle_end2end_tests.ComputeShaderTest.DispatchComputeIndirect/ES3_1_D3D11 Change-Id: I29bd888ce1e7e3e09b5635699a36164cd97cd7de Reviewed-on: https://chromium-review.googlesource.com/1209563 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Qin Jiajia 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>
Qin Jiajia 155bfd11 2018-08-31T17:27:10 Fix that same resource is bound on SRV and UAV simultaneously This change makes sure that resource being set to UnorderedAccessView slot is not bound on ShaderResourceView and resource being set to shader resource slot is not bound on UnorderedAccessView. Bug: angleproject:2768 Change-Id: I52fc5bf5e76ccf8be61c59b2195459728f95e536 Reviewed-on: https://chromium-review.googlesource.com/1201324 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Xinghua Cao 913ff54d 2018-08-07T15:14:05 ES31: support compute shader uniform buffer on D3D backend BUG=angleproject:2759 TEST=angle_end2end_tests.ComputeShaderTest.UniformBuffer/ES3_1_D3D11 Change-Id: I92326c3a84f13b364aed0daf567b68f8a411ed2b Reviewed-on: https://chromium-review.googlesource.com/1164843 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Xinghua Cao 6dfdca83 2018-08-03T17:10:55 ES31: support compute shader sampling on D3D backend BUG=angleproject:2756 TEST=angle_end2end_tests.ComputeShaderTest.SamplingAndImageReadWrite/ES3_1_D3D11 Change-Id: I8f112227c5703fcaafffbd2262e6a039f869c483 Reviewed-on: https://chromium-review.googlesource.com/1161754 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 35bc74d6 2018-08-03T14:07:59 ES31: Support atomic functions on D3D11 - Part II This patch adds the support of translating atomicExchange and atomicCompSwap without return value on D3D11 back-ends. As the last parameter of the HLSL intrinsic functions InterlockedExchange and InterlockedCompareExchange is not optional, when there is a call of either atomicExchange or atomicCompSwap without return value, we add a temporary variable for it, so that we can directly translate all of such calls in outputHLSL.cpp. BUG=angleproject:2682 TEST=angle_end2end_tests Change-Id: I7e9c6d3c7d1846c865909b2f5a26592846c82582 Reviewed-on: https://chromium-review.googlesource.com/1161744 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jiawei Shao 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>
Jiawei Shao 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>
Qin Jiajia 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>
Jiawei Shao 7a8fe156 2018-04-28T12:59:58 ES31: Add link validation on MAX_COMBINED_SHADER_OUTPUT_RESOURCES This patch adds the link validation on the maximum combined shader output resources required in OpenGL ES 3.1 SPEC. OpenGL ES 3.1 SPEC has restrictions on the sum of the number of all active images, shader storage blocks and fragment shader outputs. A link error will be generated if this sum exceeds the implementation- dependent value of MAX_COMBINED_SHADER_OUTPUT_RESOURCES. In order not to affect the existing image tests, this patch also sets a temporary value for maxCombinedShaderOutputResources on D3D11 back-ends. We will set more accurate values for all the UAV related resource limits in the next patch. BUG=angleproject:2345 TEST=dEQP-GLES31.functional.state_query.integer.max_combined_shader_output_resources_* Change-Id: Ib83a19ef0ae0b9af3422b5c970c7c07d96b2359d Reviewed-on: https://chromium-review.googlesource.com/1039155 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov beafe1a8 2018-03-29T18:23:50 Skip ComputeShaderTest.groupMemoryBarrierAndBarrierTest on NVIDIA D3D11 BUG=angleproject:2280 Change-Id: If2469e037b197b5e54f8fadce7a5094c5d3159a2 Reviewed-on: https://chromium-review.googlesource.com/987015 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Xinghua Cao 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>
Jiajia Qin 5ae6ee45 2018-03-06T17:39:42 ES31: Sync dirty objects for compute shader BUG=angleproject:2395 TEST=angle_end2end_tests Change-Id: Ife833a6573c49fc453c120ebc66765064d807b16 Reviewed-on: https://chromium-review.googlesource.com/954991 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 27f4321e 2018-02-26T11:05:53 ES31: Implement memoryBarrier on D3D backend Because D3D11 makes a coherent write, so memoryBarrier is not needed on D3D backend. This patch also simples some test cases and modifies some cases errors when accessing memory after an incoherent write, but does not use memoryBarrier. BUG=angleproject:2280 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: Iee5d105a0b6d8534aded03fdaaefc909864d33a4 Reviewed-on: https://chromium-review.googlesource.com/937023 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiawei Shao 6ae51611 2018-02-23T14:03:25 ES31: Add missing checks for querying GL_COMPUTE_WORK_GROUP_SIZE This patch adds missing checks for querying GL_COMPUTE_WORK_GROUP_SIZE by glGetProgramiv. When querying GL_COMPUTE_WORK_GROUP_SIZE, an INVALID_OPERATION error should be generated when this program hasn't been linked successfully or it doesn't contain any objects to form a compute shader. BUG=angleproject:2324 TEST=angle_end2end_tests dEQP-GLES31.functional.debug.negative_coverage.get_error.compute.invalid_program_query Change-Id: I13dcebef8a0abede5c18a038d4cf915ee4164e2e Reviewed-on: https://chromium-review.googlesource.com/933627 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Xinghua Cao b745f172 2018-01-09T16:10:02 Add more test cases for bindImageTexture Add cases that bindImageTexture binds a single layer of a two-dimensional array, three-dimensional, or cube map texture. BUG=angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I75883ef05c509100e5164a5add69167a41203101 Reviewed-on: https://chromium-review.googlesource.com/856320 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 08a8ec88 2017-12-27T13:31:11 ES31: Support bindImageTexture on Texture3D/Texture2DArray/TextureCube for compute shaders on D3D BUG=angleproject:1987 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I075296ac3b6796a334929699c16f2399d7915e51 Reviewed-on: https://chromium-review.googlesource.com/844063 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 26143fdd 2017-11-01T18:19:05 ES31: Support bindImageTexture on Texture2D for compute shaders on D3D BUG=angleproject:1987 TEST=angle_end2end_tests Change-Id: I3b0afb441a41dbd7f204b1d1bba7884c8d203ce1 Reviewed-on: https://chromium-review.googlesource.com/749004 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He 1f679cc6 2017-11-29T18:06:00 Code refactoring for angle::BitSet and EXPECT_GL_TRUE/FALSE. This change refactors two style issues to make it be consistent. 1) This CL uses "using" to replace "typedef" for all angle::BitSet<...>. 2) This CL uses EXPECT_GL_TRUE/FALSE to replace EXPECT_EQ for bool comparison. BUG=angleproject:2005 Change-Id: I4afad92313ea2457bbfedf80f917a5873d7f29ee Reviewed-on: https://chromium-review.googlesource.com/795871 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yunchao He cddcb59e 2017-11-13T15:27:35 ES31: Fix the issue when rendering against compute program. It is a undefined behavior in gles spec, but we should generate an error. This change also refactored the coding style for shader in the test. BUG=angleproject:2260 Change-Id: I7b480e8b66486d9954f7c7f6e8683298e94b6ad7 Reviewed-on: https://chromium-review.googlesource.com/764797 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Yunchao He 85072e8f 2017-11-14T15:43:28 ES31: Fix detaching/deleting compute shader after LinkProgram. This change also moves the ShaderType enum from D3D renderer to angletype.h. And it uses a bit mask to track the linked shader stages. BUG=angleproject:2247 Change-Id: I5c7ee1445d353a02e24549ffcf6b0ac694dd1069 Reviewed-on: https://chromium-review.googlesource.com/768629 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 7caa80e7 2017-11-14T15:03:14 Edit tests to reference temporary variables The shader translator is intended to prune unreferenced variables in the future. To maintain test coverage when this is done, most tests that used to have unreferenced GLSL locals and globals are edited to use built-ins or reference the necessary variables instead. BUG=angleproject:2166 TEST=angle_unittests, angle_end2end_tests Change-Id: I3964e7a80d52fc04a95f57e73da6095e433095e8 Reviewed-on: https://chromium-review.googlesource.com/768740 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yunchao He 70b715c9 2017-11-07T14:59:15 ES31: Add test for DispatchCompute with rendering program BUG=angleproject:1955 Change-Id: Ib3ee1ead76c83c8dceafba30a1c7526dd0891f8c Reviewed-on: https://chromium-review.googlesource.com/756654 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 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>
Jamie Madill 54164b0c 2017-08-28T15:17:37 Add getUniform impl methods. This will let us remove some of the uniform data management code in the GL front-end, and simplify the GL back-end. It will also enable us to implement uniform data more efficiently in the D3D11 back-end, and probably Vulkan back-end later. This also implements a new impl method for the ProgramGL class to flag optimized-out uniforms as no longer used, post-link. This is important because otherwise the optimized uniforms get assigned valid locations, and then the getUniform calls are expected to succeed. We also use a workaround for uniform value queries for the GL back-end. It seems as though some drivers (seen on NVIDIA and AMD) may not properly clamp to the maximum representable integer value when querying out-of-range floating point values. Work around this by always calling the driver with the proper type and then casting the value in ANGLE. BUG=angleproject:1390 Change-Id: I03dc2382e7af52455c356a2bf3971a4d1bd46ec6 Reviewed-on: https://chromium-review.googlesource.com/616785 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Corentin Wallez 2bde9199 2017-07-28T14:15:01 Extend suppression for new test that fails on AMD Linux too BUG=angleproject:1987 Change-Id: Iebf9aeba61bfaa300de3ed50d7d57c61996f67dc Reviewed-on: https://chromium-review.googlesource.com/592139 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Xinghua Cao 0328b575 2017-06-26T15:51:36 Bind all elements of unbound image arrays to unit zero Spec GLSL ES 3.10, section 4.4.5, Any uniform sampler, image or atomic counter variable declared without a binding qualifier is initially bound to unit zero. If the binding qualifier is used with an array, the first element of the array takes the specified unit and each subsequent element takes the next consecutive unit. BUG=angleproject:1987 TEST=angle_end2end_tests:ComputeShaderTest Change-Id: I6a8188449a91bf3e8ded37e067205dcae4e47fa7 Reviewed-on: https://chromium-review.googlesource.com/547977 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 65ec0b2e 2017-03-28T16:10:52 ES31: Add support for bindImageTexture on GL backend This patch refers to https://chromium-review.googlesource.com/c/380636/ BUG=angleproject:1987 Change-Id: If621eed6ecaa7298214843a2a133801ca1487b03 Reviewed-on: https://chromium-review.googlesource.com/462088 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 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>
Xinghua Cao 2b39659d 2017-03-29T15:36:04 ES31: Implement glDispatchCompute for OpenGL backend This patch refers to https://chromium-review.googlesource.com/c/380639/ BUG=angleproject:1955 TESTCASE=angle_end2end_tests Change-Id: Iafd7a6ba2d71c0b332d9267a1260d9dbd9800c02 Reviewed-on: https://chromium-review.googlesource.com/462089 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Xinghua Cao b123938d 2016-12-13T15:07:05 D3D11: Add support to compile and link compute shaders This is a reland of 2cd9d7e032fb412b539a907c58342060340387a1. BUG=angleproject:1442 TEST=angle_end2end_tests Change-Id: I5be0032b97617c31cdd4c66a823e8eb3b518867a Reviewed-on: https://chromium-review.googlesource.com/430199 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 0aff35eb 2017-01-16T13:46:52 OpenGL 4.2 is required when using ARB_compute_shader extension BUG=angleproject:1702 TESTCASE=angle_end2end_tests Change-Id: I45fe21bc14310b9c873e83004a8ac8766865fbb9 Reviewed-on: https://chromium-review.googlesource.com/428690 Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 417df92f 2017-01-12T09:23:07 Revert "D3D11: Add support to compile and link compute shaders." Fails https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Debug%20%28New%20Intel%29/builds/5769 BUG=angleproject:1442 This reverts commit 2cd9d7e032fb412b539a907c58342060340387a1. Change-Id: Ic1610d20ba0449b423528fa9840aa951c012cf84 Reviewed-on: https://chromium-review.googlesource.com/427229 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 2cd9d7e0 2016-12-13T15:07:05 D3D11: Add support to compile and link compute shaders. BUG=angleproject:1442 Change-Id: I13240e931e6f121d175d2cd6b41324d38bb39a5c Reviewed-on: https://chromium-review.googlesource.com/405831 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Martin Radev 9ddfa060 2016-08-29T13:56:39 Disable compute shader tests on Intel The compute shader tests in angle_end2end_tests fail on Intel Linux. The patch disables the tests for Intel. TEST=angle_end2end_tests BUG=angleproject:1483 Change-Id: I303f0852ea3ccb65c1dd96a196a640c76cc519e4 Reviewed-on: https://chromium-review.googlesource.com/377318 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Martin Radev 4c4c8e72 2016-08-04T12:25:34 Add compute program compilation and linking support Compute shaders can be now compiled and linked to create programs. Some tests are added to verify successful and unsuccessful compute shader linking. The patch also replaces std::array<int, 3> with a custom struct WorkGroupSize. BUG=angleproject:1442 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84 Reviewed-on: https://chromium-review.googlesource.com/366740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>