src/tests/gl_tests/DrawElementsTest.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>
Yuxiang Qian 611f9ac0 2025-08-20T16:10:13 Lower the cap of max element index Currently, ANGLE follows vulkan spec and returns UINT_MAX -1 for GL_MAX_ELEMENT_INDEX. However, ANGLE stores vertex index in int, so even if we use index a little less than the limit, ANGLE would still catch the overflow error. Modify the cap to 2^30 - 1 to make it safer. An end2end test is also added. Bug: angleproject:440227026 Change-Id: Ie089c9847f3908f0e8a1b7c4b83c8fea1cde262e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6870270 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Charlie Lao 2ac49bb6 2025-07-01T12:11:12 Reland "Vulkan: Move VertexArray::ElementBuffer away from observer" This reverts commit 79ac1a8cd767a32cce6401203e20c4bd4ca4d539. Reason for revert: the regression bug is fixed in PS6 The regression bug with the original CL is caused by when we bind a vertex array without element buffer rebind, we missed to reset mIndexRangeInlineCache. The other bug is that VertexArray::mDiryBits is 64 bit but VertexArrayBufferBindingMask is 16 bit, in VertexArray::setDependentDirtyBits(), bufferBindingMask.to_ulong() << DIRTY_BIT_BUFFER_DATA_0 is only producing the 32 bit value on windows platform due to unsigned long is 32 bit value. bits() is used and bit shift is operated on to uint64_t here to avoid dropping high bits on windows. Two tests are added that reproduce the regression bug caused by the original CL. Bug: angleproject:400711938 Original change's description: > Revert "Vulkan: Move VertexArray::ElementBuffer away from observer" > > This reverts commit 3f012a43ee2c101543785720eedfeaa80708479d. > > Reason for revert: https://issues.chromium.org/427064102 > > Bug: angleproject:400711938 > Original change's description: > > Vulkan: Move VertexArray::ElementBuffer away from observer > > > > Right now, VertexArray's element buffer is always observing buffer's > > change. In previous CLs, we have moved vertex array away from > > subject/observer usage. This CL moves element buffer away from > > subject/observer as well. Since the gl::Buffer tracks buffer's binding > > to each context's current vertex array's binding point, > > kElementArrayBufferIndex is added to VertexArrayBufferBindingMask bits > > so that the element buffer is tracked exactly the same as other vertex > > array buffer bindings. The VerextArray code has been modified to handle > > this special bit, since element buffer has its own binding point > > VertexArrayState::mElementArrayBuffer as opposed to > > VertexArrayState::mVertexBindings. After this CL, VertexArray object > > should be completely off subject/observer usages. > > > > Bug: angleproject:400711938 > > Change-Id: I662ddfabc95034bdc7734939c944ab033f41801c > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6552160 > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > Commit-Queue: Charlie Lao <cclao@google.com> > > Bug: angleproject:400711938 > Change-Id: I9487ba8b108baaeda1c8a27189dba64f77616774 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6663539 > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Bug: angleproject:400711938 Change-Id: I3f47ad1238c41f12b5cbd7a59b84be3fce1e9562 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6664004 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi c486ce8c 2024-12-27T06:24:19 Manual roll Chromium from faba6412dc5c to 8bb7bbeac941 (279 revisions) https://chromium.googlesource.com/chromium/src.git/+log/faba6412dc5c..8bb7bbeac941 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/chromium-angle-autoroll Please CC angle-team@google.com,syoussefi@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Chromium: https://bugs.chromium.org/p/chromium/issues/entry To file a bug in ANGLE: https://bugs.chromium.org/p/angleproject/issues/entry To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md Changed dependencies * build: https://chromium.googlesource.com/chromium/src/build.git/+log/63ad9737d7..8f6742f233 * buildtools: https://chromium.googlesource.com/chromium/src/buildtools.git/+log/56013b77b6..2823e220cb * testing: https://chromium.googlesource.com/chromium/src/testing/+log/41bfee6b2b..2344736aa3 * third_party/libc++/src: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git/+log/11c38d901d..9ba1d4922a * third_party/rust: https://chromium.googlesource.com/chromium/src/third_party/rust/+log/f6418697ac..2559e1ff2f * tools/perf: https://chromium.googlesource.com/chromium/src/tools/perf/+log/e6eba9706f..d0c22105ed No update to Clang. Bug: None Change-Id: I6c019235e8a99d74c91496d1cdfa37b56891d65f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6121262 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: 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>
Mohan Maiya 6769ef2b 2022-12-16T15:34:21 Vulkan: Bug fix in setupIndexedDraw Reset ContextVk::mCurrentIndexBufferOffset to 0 after a call to ContextVk::convertIndexBufferCPU(...) irrespective of whether the buffer binding is dirty. Bug: angleproject:7896 Test: DrawElementsTest.DrawElementsWithDifferentIndexBufferOffsets* Change-Id: I70a63b7e432aaa9f8c647e56bd162312143abd65 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113446 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
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>
Steven Noonan 04460fe8 2022-03-15T19:04:39 end2end tests: add regression test for GL_LINE_LOOP drawing This was fixed by 349636a05a3577a127adb6c79a1e947890bbe462. Adding a regression test which I didn't have ready at the time. Bug: angleproject:7102 Change-Id: Icbb685c1ffad6725a278e5ed65f881f86c5688ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3527604 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao e9d9d933 2022-03-14T09:33:28 Vulkan: Fix another corner case of mCurrentElementArrayBuffer mCurrentElementArrayBuffer is vertex array state. But it gets modified with different draw call parameters. When this changes, we always re-calculate mCurrentElementArrayBuffer. And we have added updateCurrentElementArrayBuffer call at various places where we need to reset mCurrentElementArrayBuffer to back to what bound to vertex array. There is still one more places missing such call, that when a different vertex array is been bound, the new vertex array may still have mCurrentElementArrayBuffer set to the special array for LineLoop. We need to reset it upon it gets bound. This CL also adds a new test case DrawElementsTest.LineLoopTriangles from Steven Noonan. Bug: angleproject:6955 Change-Id: Ida95062b071d25be26e59f886bfe3d61e6886c5c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3522565 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Steven Noonan 584f1b78 2021-10-14T17:55:47 metal: fix crash when checking for flat attributes We can frontload the check of whether or not a shader program uses flat interpolation for its attributes. This prevents a crash where an application does: glAttachShader glLinkProgram glDetachShader glDeleteShader and the check tries to look at the shader attachments (which are no longer valid). Also add some tests to ensure that detaching shaders after program link doesn't cause crashes on indexed draws, and that the flat attribute detection works across program save/load. Bug: angleproject:6526 Signed-off-by: Steven Noonan <steven@valvesoftware.com> Change-Id: I70990808fdfd17608b4b720461cae1a0bdd064b8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3224663 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kyle Piddington <kpiddington@apple.com> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Steven Noonan 397a27bb 2021-10-20T20:33:20 VertexArray: on destroy, remove observer on element array buffer Otherwise there will be a null pointer dereference in gl::Buffer::onContentsChange(). Signed-off-by: Steven Noonan <steven@valvesoftware.com> Bug: angleproject:6599 Change-Id: I73388b6d0ccc357ca1944452a18ccf462dd8046c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3236206 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
Qin Jiajia 5abc0c56 2020-06-09T14:32:28 Fix failures that alpha channel is not correct Previously, the alpha channel was not set which resulted the intended swapchain buffer format is B8G8R8X8_UNORM. It means that the format supports 8 bits for each color channel and 8 bits unused. However, in our test case, we expect to compare the alpha channel. So we should set alpha channel explicitly. Bug: angleproject:4575 Bug: angleproject:4576 Change-Id: Ic26ee81a6a34dc44d0ae32e3dc463e9afa16e05c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2237189 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott a5e46552 2020-04-20T09:33:21 Vulkan: glDrawElements used old offset into index buffer When the vertex array binding is changed, the value of ContextVk::mLastIndexBufferOffset must be reset so that an old/cached offset (from a previous draw call) is not used for a new draw call. This addresses rendering artifacts and Vulkan validation errors seen with running NBA 2K20 on Android (or the ANGLE trace on Windows). Bug: b/153682968 Bug: angleproject:4575 Bug: angleproject:4576 Change-Id: I69089964b8d278c7fc8610ab003548864a215dab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2152850 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@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>
Jamie Madill 5993d899 2019-06-03T13:05:38 Vulkan: Use storage buffers for index conversion shader. This allows us to use the shader regardless of driver support for texel buffer views. It also allows us to convert indices on the GPU unconditionally. We add a new internal compute shader that converts pairs of indices into a packed single uint value that stores two 16-bit values. In the future we could add support for converting primitive restart indices. Should speed up benchmarks on systems which didn't have R8_UINT support for compute shader buffers. Bug: angleproject:3490 Change-Id: I56ca0cabb094e97f36ab4edc779e6c8ad2d2601e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1639058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
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 2c0d6a94 2018-11-28T14:03:58 WebGL: Fix DrawElements test and remove size check. Also optimizes the DrawElements validation to remove redundant tests. Also make some more validation WebGL-specific. Bug: angleproject:2979 Change-Id: I2d5c3094ed86ebadbc572e46b8ae105431f7ae68 Reviewed-on: https://chromium-review.googlesource.com/c/1343139 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Olli Etuaho 5804dc8e 2018-04-13T14:11:46 Refactor GL tests to use a shader library Instead of having the same simple shaders repeated over and over in the test code, reuse a single shader library. BUG=angleproject:2474 TEST=angle_end2end_tests Change-Id: I13f8ca8c0125e6d30f1761639bf8c3f69e0e77d2 Reviewed-on: https://chromium-review.googlesource.com/1012078 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill 9fdaa497 2018-02-16T10:52:11 Don't no-op draw calls for zero count in validation. Make the no-op happen in the Context, so we can properly generator more errors for negative WebGL tests. Some validation tests still need to check for no-ops, such as range checks. BUG=angleproject:2050 Change-Id: I48d0b3cf640f7f128679600e5df108146cfd6348 Reviewed-on: https://chromium-review.googlesource.com/522869 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Brandon Jones ed5b46f1 2017-07-21T08:39:17 Add additional ES2 and WebGL 1.0 Validation Adds validation for various cases. Adds corresponding unit tests. Change-Id: I9451d286bcf2d6fa32de495e5d0bdec1eb5c955d Reviewed-on: https://chromium-review.googlesource.com/633157 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 3f6d4dff 2017-01-30T18:04:36 WebGLCompatibility implement and add tests for section 6.4 The checks for VertexAttribPointer were already implemented in a previous patch, so we only add the checks for DrawElements. BUG=angleproject:1523 BUG=chromium:668223 Change-Id: I5da55f9a7e7479627099c7f77618353a63b75a8e Reviewed-on: https://chromium-review.googlesource.com/434958 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e0cc2a4a 2016-01-20T10:58:17 Enable all angle_end2end_tests targeting OpenGL and OpenGL ES backends. Added failure supressions and filed bugs for failing tests. BUG=angleproject:1145 BUG=angleproject:1289 BUG=angleproject:1291 BUG=angleproject:1292 BUG=angleproject:1293 BUG=angleproject:1296 Change-Id: Ida78ba855500fe8a6ce6154d43ee01520330e3b1 Reviewed-on: https://chromium-review.googlesource.com/322695 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 77a90c26 2015-08-11T16:33:17 Reland of "Store the applied element array buffer as a binding pointer." To be consistent with how we start vertex attributes. A null pointer indicates we're using the streaming buffer. Will also aid the dirty state bits refactor. The re-land fixes a crash with WebGL related to element array buffers. BUG=angleproject:1040 TEST=WebGL CTS, end2end_tests, unittests Change-Id: I9b82e06825bf95f0fc2b7c7427e1eb6dd257c1ee Reviewed-on: https://chromium-review.googlesource.com/290044 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>