src/tests/gl_tests/ShaderStorageBufferTest.cpp


Log

Author Commit Date CI Message
Tom Sepez 25390156 2025-08-21T00:13:19 Suppress unsafe buffers on a file-by-file basis in src/ [1 of N] In this CL, we suppress many files but stop short of actually enabling the warning by not removing the line from the unsafe_buffers_paths.txt file. That will happen in a follow-on CL, along with resolving any stragglers missed here. This is mostly a manual change so as to familiarize myself with the kinds of issues faced by the Angle codebase when applying buffer safety warnings. -- Re-generate affected hashes. -- Clang-format applied to all changed files. -- Add a few missing .reserve() calls to vectors as noticed. -- Fix some mismatches between file names and header comments. -- Be more consistent with header comment format (blank lines and trailing //-only lines when a filename comment adjoins license boilerplate). Bug: b/436880895 Change-Id: I3bde5cc2059acbe8345057289214f1a26f1c34aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6869022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mavis Deng 045f2818 2024-12-03T09:55:39 End2end test for GL_MAX_SHADER_STORAGE_BLOCK_SIZE validation Bug: angleproject:381742474 Change-Id: Icae7b2705f5749bc070e096fa045e68bb061b530 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6065459 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Stephen White 4b1e58d9 2024-10-17T09:33:53 Fix for float constant precision in the GLSL backend. Increase the precision of floating point values written out via std::ostringstream. 8 digits is not sufficient to represent all floating point values. Note: the reason the locale test was modified is because it was using a value of 1.9, which has no exact fp32 representation. Increasing the precision causes it to print as 1.8999998 instead of 1.9, failing the test. I've adjusted the value to 1.5, since this does have an exact fp32 representation. (However, note that I couldn't get the test to fail when I removed the locale setting, with either 1.9 or 1.5. Perhaps the locale is being handled at a different level.) Bug: angleproject:374013421 Change-Id: Icb79eb9acd562c83d079f2cc2cdba253220e581e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5938473 Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b3ab67d3 2024-03-14T15:06:02 tests: Remove unnecessary .get() from RAII objects Bug: chromium:40942995 Change-Id: I82509869bce3ad8f51811188fe04267f2de04786 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370904 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 25e60197 2023-03-31T14:17:26 Vulkan: Unify buffer alloc strategy for uploads and GPU copies With this change, glCopyBufferSubData uses the same buffer allocation strategy as glBufferSubData. Only exception is with buffer self-copies which never allocate a new buffer for simplicity. Additionally, this change allows glCopyBufferSubData to be done on the CPU if possible, i.e. if the source buffer is not being written to by the GPU and whenever the equivalent glBufferSubData would have used a CPU upload. Bug: b/276002151 Change-Id: Ice8df5891c5516b148245d5d6fa9b19b787df4ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4390023 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Eddie Hatfield 89e38b57 2022-06-22T15:04:08 Refactor to use ANGLETest vs ANGLETestWithParam Bug: angleproject:6747 Change-Id: I72ad52d0268eae0e1a401f12f3e94cc5efa402f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719002 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Stephen White cb9e1235 2022-06-06T14:34:53 D3D11: fix UAV handling. For setting UAVs, Microsoft has provided two APIs: ID3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews() for pixel and vertex, and ID3D11DeviceContext::CSSetUnorderedAccessViews() for compute. They both take very similar arguments, perform similar functions, but have one crucial difference: the former will clobber any existing UAV bindings that are not specified in the call, while the latter will not. The initial implementation of non-compute UAVs in ANGLE didn't accomodate this, and sets UAVs individually, as is done for compute, which clobbers any UAVs set in a previous call. The fix is to collect all UAVs required for a draw or compute pass, and set them all at once. This required reworking the internal dirty bits to reflect the actual D3D requirements (SRV and/or UAV usage), and to split the sync functions to set only SRV or UAV state. Also add a two-SSBO fragment shader test. Bug: angleproject:7385 Change-Id: I0c98e1506d56eccf1db446c0be808f2f3020ae1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3690735 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
Stephen White 615b2c68 2022-05-24T12:29:40 D3D: implement whole-struct assignment in SSBOs. Bug: angleproject:7395 Change-Id: I18159c5fe60585b319d3f3f282fc25fb742746b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664917 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
Stephen White 88f582f6 2022-05-19T09:48:21 D3D: fix whole-array assignment to SSBOs. SSBOs in HLSL are implemented as RWByteAddressBuffer, which can only Load() or Store() up to 16 bytes at a time, so value-assignment of arrays doesn't work. The fix is to implement a traversal which unfolds such assignments into an element-by-element for-loop. Bug: angleproject:7334 Change-Id: I840c8ff7b62b67dc8935d4c09589d955798d96ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3656070 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Stephen White d3eb61d4 2022-05-18T11:00:34 D3D11: fix SSBO load in a return statement. Add a special case to load from an SSBO in a return statement. Add tests that exercise reading from an SSBO in a function, in both a fragment shader and a compute shader. Bug: angleproject:7226 Change-Id: I08e6c695bf080eb23661ef4df047f0f1a787b06e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645442 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
Jamie Madill 6b94a71c 2022-04-01T10:12:07 Vulkan: Lift SwS suppressions. Bug: angleproject:4092 Change-Id: I0e72b95ba5ba2b60420d5b685349c405864c2e6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3563513 Auto-Submit: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@google.com>
Peter Kasting bcd3ae61 2021-10-18T09:36:49 Fix some instances of -Wshadow. Bug: chromium:794619 Change-Id: I5efe04e64800455585438467bcf6c262e91f398d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3229095 Commit-Queue: Peter Kasting <pkasting@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 43be4d9c 2021-10-11T13:50:28 Vulkan: Fix unnecessary performance warnings for two tests Fix two existing tests so that it wont generate performance warnings that is not related to the test and not intended anyway. Bug: b/200067929 Change-Id: I64a9272be077c536627644ae44104d98cecee7cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3218270 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 5ab152c6 2021-10-04T14:08:15 Vulkan: Add tests that triggers acquireAndUpdate Add test for shader storage write followed by bufferSubData Add test for image store followed by bufferSubData. Bug: b/200067929 Change-Id: I5895eaa31ee54e79333f0fe26d92e9378f427a3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2553171 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 934ffac6 2021-08-05T15:43:32 Vulkan: Propagate BufferData changes to shader storage buffer binding This CL adds context to the observer list of shader storage buffer. When BufferData is called on the current bound shader storage buffer, context gets notified and DIRTY_BIT_SHADER_STORAGE_BUFFER_BINDING gets set. Bug: b/195678877 Change-Id: Id8a5266942e33f0a834d7c57fdde75f57e93d347 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076177 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao c5fa9a44 2021-08-05T15:27:47 Vulkan: Add test for BufferData change is propagated to SSBO properly When BufferData is called while previous reference is still pending, ANGLE may allocate a new storage. When this happened, we need to ensure context gets notified so that it can pick up new buffer storage. Bug: b/195678877 Change-Id: Idb591ed49e7d2c9e2dc5803f65d00894687ae1d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076820 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Yuly Novikov a6b16d29 2021-03-02T19:04:57 Suppress UNINSTANTIATED_PARAMETERIZED_TEST failures on Ozone We only support ES2 on Ozone, so tests that depend on ES3 or ES31 support are not instantiated there. Bug: chromium:1183147 Change-Id: Id58bcd9b44a5b9a70b5ae8115e27c44f5dc81226 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2726550 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 436b43a6 2021-02-16T14:28:06 Add comprehensive memory barrier tests Optimizing glMemoryBarrier can get very tricky. This change adds tests for every glMemoryBarrier bit in different scenarios for a total of about 1500 tests. With the current implementation, there are no syncval errors running these tests. Bug: angleproject:5070 Change-Id: I5358bfeed84f586a67c90ba5ab0fe624db6820b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2698288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 031dd5c5 2021-02-11T14:56:43 Vulkan: Add fast path for pack buffer copies When vkCmdCopyImageToBuffer is possible, it is used to implement glReadPixels with PBO instead of a CPU readback. A few tests are added to verify synchronization between pack/unpack and compute shader writes. Bug: angleproject:5070 Change-Id: Ia5da0feb31348f6b52d164b973ff95e2a0510582 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2691466 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 448b14bb 2020-04-27T13:46:08 Vulkan: Apply binding size in updateBuffersDescriptorSet. Previously we would bind the full Vulkan buffer size in cases of unsized arrays in storage buffers. This then would lead to problems when binding a dynamic buffer that used sub-allocation or larger internal sizes. Instead use the GL binding size or GL buffer size as the size limits. Bug: angleproject:4380 Change-Id: Ia579bfeae3b8d068813336cbd5e1babee9f4f345 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168020 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 33b58ebb 2019-11-25T16:31:43 Vulkan: Give unsized arrays at least 1 entry The function ShaderVariable::getNestedArraySize needs to return at least 1 entry for unsized arrays to ensure the shader buffer sizes are reported correctly. This also allows ANGLE to treat unsized arrays of structs and basic types the same way, allowing for the special treatment of unsized arrays in TraverseStructArrayVariable() to be removed. Bug: angleproject:3596 Test: dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.* Change-Id: I3b2a3a68c25e0913b79e989d7c719b34ce9b75fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1934952 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amy Liu f98084ed 2020-03-12T10:06:26 Fix ShaderStorageBufferReadWriteOffset end2end test Test: ShaderStorageBufferTest31.ShaderStorageBufferReadWriteOffset. Align kBufferOffset to bufferAlignOffset correctly. Bug: angleproject:4471 Change-Id: I71084839a845138b32d58d8bd2cf6fed2633a9be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2100047 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 44722daa 2019-12-06T22:31:08 Vulkan: Enable inactive SSBO with unsized array tests The change introduced in https://chromium-review.googlesource.com/c/angle/angle/+/1951523 removes inactive shader interface declarations. That automatically resolves an issue where glslang wrapper doesn't handle inactive SSBO declarations with unsized arrays, by removing those declarations at translation time altogether. Bug: angleproject:3714 Change-Id: I710d59546d716bfb5bc0112b5152fed20a810a52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954615 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis c1776c61 2019-11-13T11:36:35 Vulkan:Add Swiftshader configs Add Swiftshader configs to existing test instantiation macros for all ESX variants. This causes Swiftshader to be used to run end2end tests. Added detection code to know when tests are running on Swiftshader and skipping a number of fails initially. Note that when running ANGLE end2end tests within Chromium build on Win32 bots there were crashes with Swiftshader config for tests that should have been skipped. Due to this, just skipping Swiftshader configs on Win32 for now. Bug: angleproject:4081 Bug: angleproject:4092 Change-Id: I32527a62304c5fad90f645b372edf9411ca2b212 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1914126 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis 1a01b4b3 2019-11-11T16:41:07 Refactor end2end test macros This is a foundational CL to enabling the end2end tests on swiftshader. Refactored infrastructure with new ANGLE_INSTANTIATE_TEST_ES* macros that will run tests over all various combinations of all platforms for different ES versions. Just skipping failing tests initially to get the refactor landed. Bug: angleproject:4081 Bug: angleproject:4092 Change-Id: I017f6c3267179e49b6ae08cc7488096b423dcdb5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1904635 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Kimmo Kinnunen 7270a6d5 2019-08-06T16:01:42 Fix ShaderStorageBufferTest31.LoadAndStoreBooleanVarAndArray to be more correct The test contained bugs which made it fail on multiple platforms. After mapping SSBO, access the data with GLuint instead of GLboolean. The elements in the SSBO are 4 machine units, even though the SSB talks about bools. A bvec2 declared after bool in the SSB has alignment requirements. The test asserts that a shader written result is zero. In this case it needs to initialize the result buffer to non-zero in order to prove that the shader put the zero there. Bug: angleproject:3749, angleproject:1951 Change-Id: Iad8301be7f9e9df6bbed6b390d9c415d4e437c1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738909 Commit-Queue: Kimmo Kinnunen FI <kkinnunen@nvidia.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Kimmo Kinnunen 483ee3fa 2019-08-07T14:53:37 Remove ShaderStorageBufferTest test skips for bug 2990, bug is marked fixed Unskip ShaderStorageBufferTest tests that reference bug angleproject:2990, the bug is marked fixed and the tests pass. Bug: angleproject:2990 Change-Id: I378f648baa1caf44c5e5280c1580abaefcbe6cba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1742146 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao eb06814d 2019-07-03T17:17:45 Correct barriers of glMemoryBarrier in test cases Some test cases use wrong barriers when calling glMemoryBarrier. Bug: angleproject:2280 Change-Id: I0750c1eba84ed8af32091f7ecd5bdbd2b32fd397 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1687591 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Yuly Novikov ce66a4f8 2019-07-26T16:27:04 Skip 2 end2end tests failing on 431.02 Windows NVIDIA driver ClearTestES3.RepeatedClear/ES3_Vulkan ShaderStorageBufferTest31.LoadAndStoreBooleanValue/ES3_1_D3D11 Bug: angleproject:3748, angleproject:3749 Change-Id: I54c6259d36c9993250e961d92a6d4b8e4349ed57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721185 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov af80b781 2019-07-22T14:31:08 Skip ShaderStorageBufferTest31.ActiveSSBOButNotStaticallyUsed on Pixel 2 Vulkan. Bug: angleproject:3725 Change-Id: Ic5c80ad3ec495c3fd382639f761b368f16993434 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713564 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 2e43b0f5 2019-07-11T17:09:54 Vulkan: Implement memory barriers Bug: angleproject:3574 Change-Id: I13d8f4fcd6f1bf9bf3496c91c2c697076e2491bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699005 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f92fc916 2019-07-15T22:39:23 Vulkan: Compute shader support A DispatchHelper class is created as the equivalent of FramebufferHelper as a command graph resource. There's currently a single dispatcher and all dispatch calls are recorded on that. Context dirty bits are set up in such a way that graphics and compute workloads are independently handled, so that issuing a dispatch call wouldn't cause a framebuffer's render pass to rebind resources. Bug: angleproject:3562 Change-Id: Ib96db48297074d99b04324e44b067cfbfd43e333 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688504 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 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>
Jamie Madill f455f756 2019-03-20T20:49:44 Reuse angle_end2end_test windows and displays. This both speeds up test execution and cuts down on the number of new windows and displays created for a test config. This feature is only currently enabled for Windows NVIDIA and Intel. On every other config there were blocking issues that would need investigation. Several tests were manually flagged as needed new displays on each iteration to prevent test flakiness. This feature might fix the issues with Intel test flakiness that have been prominent on the ANGLE CQ. WGL configurations have also been removed from ANGLE tests. So this removes more of the code from ANGLETest.cpp. Bug: angleproject:3261 Change-Id: Ic2864d4806ad38e0eeaa3c0afcd54ae1c548090f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520995 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Enrico Galli 8922ac23 2018-12-14T13:44:29 ES31: Enable glBindBufferRange on SSBOs in the D3D renderer This patch enables binding a subset of a buffer with glBindBufferRange on the D3D renderer. Bug: angleproject:2990 Test: angle_end2end_tests Change-Id: Ib15b6257891191e28801f52c539b8b2daa80fa68 Reviewed-on: https://chromium-review.googlesource.com/c/1409880 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 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>
Bryan Bernhart 48bbc53e 2018-12-03T16:17:00 ES31: Fix for reading back initialized SSBO buffers in D3D11 If a SSBO is initialized with data, a staging buffer was created. When the data was read back, it was read from the staging buffer instead of the GPU. This patch fixes that by making the UAV buffer the latest buffer. Bug: angleproject:2990 Test: angle_end2end_tests Change-Id: I43c8c85144c74cc9b317577b7c834e3f7e347f72 Reviewed-on: https://chromium-review.googlesource.com/c/1359712 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Bryan Bernhart <bryan.bernhart@intel.com> Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 76f66954 2018-12-18T17:59:00 ES31: Fix the bug that SSBO is active but not statically used If a SSBO is active but not statically used, there will be no UAV slot is bound. So we should skip this kind of block. Bug: angleproject:1951 Change-Id: I4d813ddefcce6c31fa02701f26148eb21c00f380 Reviewed-on: https://chromium-review.googlesource.com/c/1381847 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 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>
Qin Jiajia 4a9f9b08 2018-12-06T17:49:39 ES31: support ssbo as the operand of unary operator Bug: angleproject:1951 Change-Id: I71c2cf2ca35d7b1fe5d14358a0749f47e223816b Reviewed-on: https://chromium-review.googlesource.com/c/1367405 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 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>
Qin Jiajia e14feaf5 2018-11-29T16:29:54 ES31: support ssbo as an argument of aggregate type BUG: angleproject:1951 Change-Id: Icaab8ffd0ee88cca22ba79a9f0d4e02c9134a169 Reviewed-on: https://chromium-review.googlesource.com/c/1349071 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 81a880aa 2018-11-12T15:53:34 ES31: support ssbo as binary operand This patch will process ssbo as compound assignment binary operand or readonly binary operand. BUG: angleproject:1951 Change-Id: I4a0da77649d719fa08e6bf4c3d9ace58dbfb7aab Reviewed-on: https://chromium-review.googlesource.com/c/1349449 Commit-Queue: Jiajia Qin <jiajia.qin@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>
Jamie Madill 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>
Qin Jiajia 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>
Qin Jiajia 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>
Qin Jiajia 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>
Qin Jiajia 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>
Qin Jiajia 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>
Qin Jiajia 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>
Qin Jiajia 672267fc 2018-10-19T17:01:17 ES31: Fix that asuint can't accept bool value This change fixes below errors: error X3013: 'asuint': no matching 1 parameter intrinsic function error X3013: Possible intrinsic functions are: error X3013: asuint(double, out uint x, out uint y) error X3013: asuint(float|half|int|uint) When we store a boolean value, we should cast it to uint firstly. Then do the store. Bug: angleproject:1951 Change-Id: I8931e540d701ef72bb82846496c698acef1ba1fb Reviewed-on: https://chromium-review.googlesource.com/c/1295831 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 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>
Qin Jiajia 1d8a783c 2018-10-09T13:59:56 Re-land: "ES31: Add vector and matrix support in SSBO for D3D" Re-land skips ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 to pass the bots. In fact, ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 is not a regression. The reverted CL added more SSBO features and triggered the failure. To enable ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11, we should support SSBO in render pipeline. This needs to bind SSBO to UAV registers in link time instead of compile time since output variables also occupies the UAVs. Let's enable this test when we support SSBO in render pipeline. Currently, we shouldn't block the SSBO implementation in some common features. Bug: angleproject:1951 Change-Id: Ic339e8327e79335e6db1d86bedf0072635976f5f Reviewed-on: https://chromium-review.googlesource.com/c/1282277 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Jamie Madill c97e3f66 2018-10-12T15:49:06 Revert "ES31: Add vector and matrix support in SSBO for D3D" This reverts commit 671809e62e807eb0f890a5d53eee1f8cb5fb825e. Reason for revert: Regresses angle_end2end_test: ProgramInterfaceTestES31.GetProgramInterface/ES3_1_D3D11 Warning: compileToBinary(232): C:\fakepath(36,21-40): error X4509: UAV registers live in the same name space as outputs, so they must be bound to at least u1, manual bind to slot u0 failed The new test and this CL landed at nearly the same time. This CL breaks the test but it wasn't run on the CQ. Failure link: https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Win10%20FYI%20Release%20%28NVIDIA%29/2717 Original change's description: > ES31: Add vector and matrix support in SSBO for D3D > > Bug: angleproject:1951 > > Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b > Reviewed-on: https://chromium-review.googlesource.com/c/1269827 > Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,jiajia.qin@intel.com Change-Id: I54cda962e1361372f06e9e3bd667fa9c0ecf38dc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:1951 Reviewed-on: https://chromium-review.googlesource.com/c/1278102 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Qin Jiajia 671809e6 2018-10-09T13:59:56 ES31: Add vector and matrix support in SSBO for D3D Bug: angleproject:1951 Change-Id: I19d4218b28770464e4cb38027cce694e2a817b5b Reviewed-on: https://chromium-review.googlesource.com/c/1269827 Commit-Queue: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Qin Jiajia 3026f115 2018-10-09T12:13:38 ES31: Collect shader storage blocks info for d3d. This change collects shader storage blocks info for d3d backend. With this change, program interface APIs can get correct SSBO information for D3D. Bug: angleproject:1920 Change-Id: I6e2414494d0e8240bcb1d0ddc3d9a292eb7158ee Reviewed-on: https://chromium-review.googlesource.com/c/1269824 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
Qin Jiajia 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>
Jiawei Shao d2cb7cec 2018-03-02T09:04:03 ES31: Fix wrong method of computing combined interface blocks This patch fixes a bug in the method of validating the number of combined interface blocks in currenct ANGLE implementation. When a resource (uniform block, shader storage block, image, atomic counter buffer, atomic counter) is used by multiple shader stages, each such use counts separately against the combined resource limit. This patch also fixes an unexpected link error in a related test by skipping the test when the number of ssbos exceeds the resouorce limit. BUG=angleproject:1951 TEST=angle_end2end_tests Change-Id: I0de439a412148e0d5ebef3c27d20e0cbd536175a Reviewed-on: https://chromium-review.googlesource.com/945143 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jiajia Qin 8efd1268 2017-12-19T09:32:55 ES31: Add max combined interface blocks validation BUG=angleproject:1951 Change-Id: I9223964fa84cee3888fb7f5949c3e098fe2aa2b0 Reviewed-on: https://chromium-review.googlesource.com/890818 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qin Jiajia a08d410d 2018-01-11T13:37:14 Fixed ssbo end2end tests failure The array stride is implementation-dependent if the storage layout is not standard layout. So this change will use std140 as the layout to fix the bug. BUG=767240,angleproject:2255 Change-Id: I21de52ebad6d27783eeade63d6fac81c0842085d Reviewed-on: https://chromium-review.googlesource.com/861313 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinghua Cao 10a4d434 2017-11-28T14:46:26 ES31: Enable some dirty bits and dirty objects for compute pipeline BUG=angleproject:2265 TEST=dEQP-GLES31.functional.shaders.builtin_var.compute.* angle_end2end_test.ShaderStorageBufferTest31 .MultiStorageBuffersForMultiPrograms Change-Id: Icc3df122602951a2328003c10a76696ab4c9f0d8 Reviewed-on: https://chromium-review.googlesource.com/792951 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov 78413499 2017-11-16T17:36:13 Skip ShaderStorageBufferTest31.AtomicMemoryFunctions on Linux AMD GL BUG=angleproject:2255 Change-Id: I986ee0e674d0f3fc2425c922ca92a3f8d86efb8c Reviewed-on: https://chromium-review.googlesource.com/775816 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jiajia Qin a3106c58 2017-11-03T09:39:39 ES31: Add atomic memory functions BUG=angleproject:1442 TEST=angle_unittests, angle_end2end_tests dEQP-GLES31.functional.compute.shared_var.atomic* dEQP-GLES31.functional.compute.basic.shared_atomic_op* dEQP-GLES31.functional.ssbo.atomic.* Change-Id: I82b54fde3a852d3bd917b1e19680baa1c28fce4d Reviewed-on: https://chromium-review.googlesource.com/765061 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill a5dc625c 2017-09-20T21:08:14 Suppress two failing angle_end2end_tests. "Add test for GL_KHR_robust_buffer_access_behavior" introduced a failure in Windows 10 NVIDIA OpenGL configs. "ES31: Enable shader storage buffer support for OpenGL backend" introduced a failure on Linux Intel HD 630 configs. BUG=angleproject:1463 BUG=angleproject:1951 Change-Id: I791bc729893b7f31093ab1678dc8d01edfbd0a5a Reviewed-on: https://chromium-review.googlesource.com/676473 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiajia Qin 729b2c6e 2017-08-14T09:36:11 ES31: Enable shader storage buffer support for OpenGL backend BUG=angleproject:1951 TEST=angle_end2end_tests:ShaderStorageBuffer Change-Id: I1afc3cd005ad2e595c6ce937fc53e17423f8ec8b Reviewed-on: https://chromium-review.googlesource.com/618132 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>