src/libANGLE/renderer/vulkan


Log

Author Commit Date CI Message
Yuly Novikov 508a8a02 2022-01-31T15:12:55 Remove old spellings for SYNC-HAZARD-WRITE_AFTER_READ skips Obsoleted by VVL roll crrev.com/c/3426000 Bug: chromium:1292106 Change-Id: I360dea6f97e75a25245597e96553aa86d655c340 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3428099 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 2d3ce72d 2022-01-20T10:13:06 Refactor shared library load to avoid allocations. Fixes a leak of an angle::Library detected in the EGL loader. Bug: angleproject:6937 Change-Id: I623aa6172b98a35465e1d2641b92f67bdc5d24e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3403060 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 665ddccd 2021-12-09T23:06:39 Vulkan: Emulate dithering Dithering in OpenGL is vaguely defined, to the extent that no dithering is also a valid dithering algorithm. Dithering is enabled by default, but emulating it has a non-negligible cost. Similarly to some other GLES drivers, ANGLE enables dithering only on low-bit formats where visual banding is particularly common; namely RGBA4444, RGBA5551 and RGB565. Dithering is emulated in the fragment shader and is controlled by a spec constant. Every 2 bits of the spec constant correspond to one attachment, with the value indicating: - 00: No dithering - 01: Dither for RGBA4444 - 10: Dither for RGBA5551 - 11: Dither for RGB565 The translator appends code to the shader that, based on the format specified by the specialization constant, adds dithering to each color attachment output. A 2x2 Bayer matrix is used for dithering, indexed by gl_FragCoord.xy % 2. Bug: angleproject:6755 Change-Id: Ib45da5938e299b6626bff921119d63e7357dd353 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3374261 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 55ef2b4f 2022-01-28T23:24:49 Update one more SYNC-HAZARD-WRITE_AFTER_READ skip vkCmdCopyImageToBuffer() was changed to vkCmdCopyImageToBuffer in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/3705 Skip both variants for now, the old one to be removed after a VVL roll. Bug: chromium:1292106 Change-Id: I8c1a6be7bcf829c9a8b848c5ef2362462a965a11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424667 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 168e0ae5 2022-01-27T16:50:00 Vulkan: Refactor descriptor pool code. This uses vk::Context to init DynamicDescriptorPool, and removes some accesses to ProgramExecutableVk member variables so the methods can more easily be moved into another class. The changes should have no effective behaviour difference. Note that the immutable sampler descriptor count is entirely set by the format of the immutable samplers. However we can't determine this count by looking at the descriptor set layout desc with the current implementation. Bug: angleproject:6776 Change-Id: I0a323d19fa3720b5afd8300401ed9c30b105c0ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424657 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov a994ea99 2022-01-28T17:52:16 Update SYNC-HAZARD-WRITE_AFTER_READ skip VK_PIPELINE_STAGE_2_NONE_KHR was renamed to VK_PIPELINE_STAGE_2_NONE in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/3705 Skip both variants for now, KHR to be removed after a VVL roll. Bug: chromium:1292106 Change-Id: Ie8d095eccedc526880edf7d3601fa0aca23c1498 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424665 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jeff Vigil e03f1753 2022-01-06T09:48:12 EGL: mutable_render_buffer deferredFlush fix When in SINGLE_BUFFER mode, need to get around deferredFlush and call Swapbuffers to force update This must do status check for OUT_OF_DATE. Bug: angleproject:6878 Change-Id: I34b7381f6799879bf6f6d490aba02feffc5c3748 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373739 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
sugoi1 8a1f8af4 2022-01-28T10:51:47 Turn on the Vulkan backend on ChromeOS ChromeOS needs to switch from testing on legacy SwiftShader GL to testing on SwANGLE instead. This CL allows ANGLE's Vulkan backend to exist on ChromeOS. Bug: chromium:1225003 Change-Id: I7bf702ce18857707226461152b560a570797fce0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3424658 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Lubosz Sarnecki 42c8b29d 2022-01-05T13:35:23 Tests: Add Dead By Daylight trace. Add GL_EXT_shader_framebuffer_fetch prerequisite. Ignore SYNC-HAZARD-READ_AFTER_WRITE validation error in RendererVk. Test: angle_perftests --gtest_filter="*dead_by_daylight*" Bug: angleproject:6870 Change-Id: I01f53ff8d26b704b75afe8c02ac12777b51fd5de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3372793 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Kyle Piddington c4a9d416 2022-01-05T15:28:11 Metal: Refactor to build without SPIR-V Refactor ShaderInterfaceInfoMap and constant names to thier own files, allowing Webkit to build without needing to compile SPIRV code via mtl_glslang_utils.cpp. Bug: angleproject:6782 Change-Id: I7a9c7e387145c95807f780e24bd2764e0efb5709 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3364970 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Kyle Piddington <kpiddington@apple.com>
Charlie Lao 701d51b1 2022-01-25T15:44:39 Vulkan: Add SmallBufferPool for small allocations The small pool uses buddy algorithm that is much faster. The only downside is that it rounds size to power of two. For small allocations that rounding does not generate much waste and avoid fragmentation as well. This CL adds a small pool for host visible non-coherent pool. My testing with gardenscape shows that on top of other CLs, this reduces CPU overhead from 1.77ms to 1.55ms as measured with --minimize-gpu-work with offscreen. Bug: b/215768827 Change-Id: I68434931f238c4e980b77d3df46d762260ef1db5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3415211 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao df19e35a 2022-01-24T17:47:58 Vulkan: Use queue for mGarbageQueue This variable is also acting exactly like queue as the name implies. This CL changes from vector to queue so that the very last erase() call will not actually move anything. Bug: b/215768827 Change-Id: Ieb39c3a1b3acb25f93bcda2a46737a6d009d71f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3414355 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill 4e644b33 2022-01-22T16:17:46 Vulkan: Remove ProgramExecutableVk back-pointers. This removes the mProgram and mProgramPipeline back-pointers from ProgramExecutableVk. In order to fix this, we needed to refactor the VkPipeline init functions to call through ProgramExecutableVk only instead of passing through ProgramVk. We also needed to move the early fragment shader optimization boolean out from Program. This CL also fixes a few places where the early fragment test optimization boolean wasn't properly updated. Bug: angleproject:3570 Change-Id: Ie4c48087f6eb022e6f0a4dacc2710085165d49e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3408267 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Patrick To b3ed4780 2021-12-21T17:20:19 Change Windows display initialization from ANSI to wide version Bug: angleproject:6846 Change-Id: I2aee8f4b5b7546fc707705e435251fa9861e27d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352866 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Roman Lavrov 602b957b 2022-01-26T15:01:21 Enable robustnessEXT for SwiftShader. This is a reland of commit b803b60df1806f189c1b29ca77da47896241e0f1. The issue with webgl-oversized-printing.html crashes is supposed to be resolved by commit b1216bf1759ab23ffe2d6b6727f9ec10ddfa4d0f Failing test angle-instanced-arrays-out-of-bounds.html disabled by commit d235e032000d611d31e6fd8a8190e4425b4c0ecb I don't think we need to change the test expectations any more as that swiftshader issue is supposed to be already fixed http://anglebug.com/6906#c4 Bug: chromium:1287631 Bug: angleproject:6922 Change-Id: I0fdf806cac51d000088a029bbb3070906453dfb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3415875 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 2ad5f350 2022-01-25T12:15:16 Vulkan: Fix texture array level redefinition When a level of a texture is redefined, all staged updates to that level should be removed, not the ones specific to the new layers. The bug fixed was that if the texture was redefined to have its number of layers changed, the staged higher-layer-count update to the image was not removed. Bug: chromium:1289383 Change-Id: I9b90025f78af80ab19a280f90b58510716da31d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3413004 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao a7970889 2022-01-24T11:50:27 Vulkan: Use queue instead of vector for mSharedGarbageList The garbage collector code is iterating the mSharedGarbageList from begin to end and if the garbage object is completed, we destroy it and erase it from the vector. This is done one by one. The problem with that is each erase call end up moving the remaining vector to ahead by one, and this process is repeated for each completed element. This is O(N^2) problem and really magnifies when you have many garbage objects. Since we only add garbage when it is GPU pending, so most of these garbages are in sort of fifo order anyway. This CL changes the garbage list from vector to queue so that erase becomes pop and this becomes a O(N) problem. This reduces CPU overhead as measured with minimize-gpu-work for gardenscapes from 10ms to 2ms due to suballocation generates lots of garbages. But this CL is a general improvement for the garbage collection performance. Bug: b/215768827 Change-Id: I002aadf75f958d8b79eb6281a2608597776e908d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3414354 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 39f66a9c 2021-12-16T23:26:00 Vulkan: Support different SCBs for outside and inside RP The render pass command buffers are generally much larger than outside render pass command buffers, and their allocation sizes and frequencies differ. This change allows choosing between ANGLE and Vulkan secondary CBs independently for outside and inside render pass commands, as part of an investigation to understand which implementation performs best for each. Switching to Vulkan secondary command buffers is still slower. In the ball park, switching outside render pass SCBs doesn't seem to make much difference, while switching render pass SCBs duplicates the frame's CPU time. Bug: angleproject:6811 Change-Id: Ia8455fd19897a0eaeadf3d6db29286ea53df1f5e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3346341 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill cb96c236 2022-01-26T18:53:55 Revert "Vulkan: Enable framebuffer fetch on SwiftShader." This reverts commit 5107231939b5e04d3d5e4376176db42c3ae60193. Reason for revert: Fails new code paths in Chrome+Skia. Bug: angleproject:6947 Original change's description: > Vulkan: Enable framebuffer fetch on SwiftShader. > > This also fixes a bug with non-coherent fetch in the symbol table. > > Bug: angleproject:6947 > Bug: angleproject:6948 > Change-Id: I190b2e0cddf1bc1b53a79079d3e2f79ccbb40d15 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3412998 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6947 Bug: angleproject:6948 Change-Id: I8bd6c55598552b733547e45c854f6d55768d2b65 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3417503 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c1346bd 2022-01-21T11:35:45 Vulkan: Consolidate uniforms code in ProgramExecutableVk. De-duplicates several methods. Refactoring change only. Bug: angleproject:3570 Change-Id: Ib68bc30b3e9b1087871bb268ea292677e0c9fe2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3408061 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0dc0dc2a 2021-12-30T11:35:40 Re-land: "Vulkan: Remove "fillProgramStateMap"." This copies additional shader info like uniforms from the Program to the Program Piplines. There is now a duplication between PPOs and Programs. There is no additional storage required for non-PPO Programs. Re-land fixes fragment in/out uniform updating with PPOs. Bug: angleproject:3570 Change-Id: I64b2db6fbc3a610f3b5e617301f94eb30d915939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3412999 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 51072319 2022-01-25T10:41:25 Vulkan: Enable framebuffer fetch on SwiftShader. This also fixes a bug with non-coherent fetch in the symbol table. Bug: angleproject:6947 Bug: angleproject:6948 Change-Id: I190b2e0cddf1bc1b53a79079d3e2f79ccbb40d15 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3412998 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Roman Lavrov 5f0badf4 2022-01-18T20:05:55 Vulkan: Prevent out of bounds read in divisor emulation path. Split the replicated part of StreamVertexData out to StreamVertexDataWithDivisor, there is only a partial argument overlap between the two. Bug: chromium:1285885 Change-Id: Ibf6ab3efc6b12b430b1d391c6ae61bd9668b4407 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3398816 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Jeff Vigil d6dd0cb5 2021-09-21T15:26:13 EGL: EGL_KHR_lock_surface3 backend Add vulkan implementation Add test: EGLLockSurface3Test Test: angle_end2end_test --gtest_filter=EGLLockSurface3Test Bug: angleproject:6062 Change-Id: Id5bfe37895b550392d11e9e9cc1262c1f0288c42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3174323 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 6a14e328 2022-01-25T00:49:45 Revert "Vulkan: Remove "fillProgramStateMap"." This reverts commit 38deffe40db83836588e0cd50864945a9ddba36b. Reason for revert: angle_end2end_tests failures on Pixel 6. Original change's description: > Vulkan: Remove "fillProgramStateMap". > > This copies additional shader info like uniforms from the Program > to the Program Piplines. There is now a duplication between PPOs > and Programs. There is no additional storage required for non-PPO > Programs. > > Bug: angleproject:3570 > Change-Id: I5ed6c946df945aaf2f65752f797b16e7649d5584 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3362297 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Tim Van Patten <timvp@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3570 Change-Id: I3a4822c8a65d024070a9fe5df103b88a3c8333d3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3414024 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 29678329 2022-01-21T14:06:42 Vulkan: Fix advertised precision ranges Advertise precision ranges similar to the spec requirements. This change requires a fix to the CTS to allow drivers to provide more precision in some situations: 97ceb2222747fef380d25acd15638b599fbc1d5a in VK-GL-CTS Bug: angleproject:6645 Change-Id: I9b537a8acdf885e35fbcb539c70b730c5f2accc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3407737 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 38deffe4 2021-12-30T11:35:40 Vulkan: Remove "fillProgramStateMap". This copies additional shader info like uniforms from the Program to the Program Piplines. There is now a duplication between PPOs and Programs. There is no additional storage required for non-PPO Programs. Bug: angleproject:3570 Change-Id: I5ed6c946df945aaf2f65752f797b16e7649d5584 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3362297 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexey Knyazev a20cd8b7 2022-01-22T01:40:34 Fix initialization for ETC2 punchthrough alpha formats * Zero-filled ETC2_A1 data must be treated as opaque black * Removed init functions when emulation is not needed * Fixed initialization for emulated ETC2_R8G8B8A1_SRGB_BLOCK Bug: angleproject:6936 Bug: angleproject:6941 Change-Id: Ie5555bbaa6b1a2bcfd9c22cb9c17d1a96e72aa70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3406761 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya 096c268b 2022-01-12T15:21:02 Add a few overrides for Samsung 1. Enable perFrameWindowSizeQuery feature 2. Return correct vendor string Bug: angleproject:5111 Change-Id: I9efb0d2168994c6f209d8730c658f2568f3d3afa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3387848 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya a0fbcb37 2022-01-13T14:26:58 Vulkan: Remove flush from SyncHelperNativeFence::serverWait The spec doesn't require a flush in native fence's server wait method Bug: angleproject:2517 Test: EGLSyncTest.AndroidNativeFence_* Change-Id: If6870fe1e25ddf3a1b724e776f5408523a7bdf50 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3388231 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao d2354968 2022-01-20T10:59:05 Vulkan: Rename BufferHelper::initFor* to allocateFor* Simply name change per feedback from other CL's review. Bug: b/205337962 Change-Id: Ieb53ed9a2922d09716a1219eb340fe273e5f1807 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402882 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao a83f7e91 2022-01-19T14:14:16 Vulkan: inline some of the BufferSuballocation APIs These are simply get* calls and frequent used ones. The measurement I have on Pixel6 shows there is 0.01ms out of 2.28ms on CPU overhead with asphalt_8 app trace measured with --minimize-gpu-work. Bug: b/205337962 Change-Id: I746a1ccc67c589d1aba25495601ad874ddc034a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3403159 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 1b5efe51 2022-01-19T14:04:35 Vulkan: Rename SubAllocation to Suballocation Simply a name change to make it one word. No functional change is expected. Bug: b/205337962 Change-Id: Ic505536821f18141c0d036b13d9aa81554a8bafd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3403158 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 15439f8e 2022-01-13T14:58:41 Vulkan: Remove BufferMemoryAllocator This class was added in crrev.com/c/3036256. The original intention was to use VMA to implement buffer suballocation. Because VMA itself does not support buffer suballocation, I was thinking to use VMA custom pool to implement it and this class was intended to wrap all these functionality into one class. But now thanks to Jamie's effort, VMA exported generic suballocation algorithm via API and we have implemented buffer suballocation using that virtual allocation API. So this BufferMemoryAllocator class is really no longer useful. This CL mostly reverted that CL and flatten out the buffer allocation call to directly use VMA's Allocator object. Bug: b/205337962 Change-Id: I0336056e440f39e2ff49fee8e0ff4b1f355cefe4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3244022 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Yuly Novikov dcac02ac 2022-01-19T21:30:21 Revert "Enable robustnessEXT for SwiftShader." This reverts commit b803b60df1806f189c1b29ca77da47896241e0f1. Reason for revert: blocks roll into Chrome - anglebug.com/6922 Original change's description: > Enable robustnessEXT for SwiftShader. > > Bug: chromium:1287631 > Bug: angleproject:6906 > Change-Id: I3c8c32561a1ac7860c83b8d3ba22aafd0bf81fd4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3390489 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Roman Lavrov <romanl@google.com> Bug: chromium:1287631 Bug: angleproject:6906, angleproject:6922 Change-Id: Ic8ff7dd996455009037cbff9e10b6fbbc420b37e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402820 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Cody Northrop b5360798 2022-01-14T12:45:14 Vulkan: Support fetching from default FBO If GL_EXT_shader_framebuffer_fetch is enabled, specify framebuffer attachments as having VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT. Add new test FramebufferFetchES31.DefaultFramebufferTest which exercises the behavior. Also limit exposure of either framebuffer fetch extension to be Android only due to swapchain images requiring INPUT_ATTACHMENT. Test: FramebufferFetchES31.DefaultFramebufferTest Bug: angleproject:6893 Change-Id: I227e36a9844e2301f0fe0602f4e4d905874b32e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3389791 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop fa3241b7 2022-01-13T17:56:52 Vulkan: Move shader_framebuffer_fetch to FeaturesVk Per feedback in http://crrev/c/3371244, move the new and existing checks for whether the extension should be enabled. Controlling them based on hardware vendor should be done with FeaturesVK so we can centralize our workarounds. Also remove the envvar-based override for non-coherent extension. It can now be forced using ANGLE's feature system. The new way to force the override is: ANGLE_FEATURE_OVERRIDES_ENABLED=supportsShaderFramebufferFetchNonCoherent or on Android: debug.angle.feature_overrides_enabled=supportsShaderFramebufferFetchNonCoherent Bug: b/201764768 Bug: angleproject:6519 Bug: angleproject:6870 Bug: angleproject:6872 Change-Id: Ie78ebfa94807a156b9e7f704e8a36cd38b85f878 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3389707 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Roman Lavrov b803b60d 2022-01-14T23:29:14 Enable robustnessEXT for SwiftShader. Bug: chromium:1287631 Bug: angleproject:6906 Change-Id: I3c8c32561a1ac7860c83b8d3ba22aafd0bf81fd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3390489 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
SeongHwan Park 9b231f09 2022-01-18T04:49:08 Vulkan: Fix incorrect bit test when mipmapping Fixed an issue where angle::Bit was used instead of angle::BitMask when should selecting [0, x) to set bit range (x, y] in an n-bit bitmask. Bug: chromium:1287962 Change-Id: I053fbc836ef12b0dfd30305fd527de3fabfdf525 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3394468 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 158ecba6 2022-01-07T16:40:26 Vulkan: Remove cached Impl pointers from ContextVk. These pointers were a common source of programming error, where sometimes they wouldn't be updated when they were needed. Instead we can pull the objects directly from the GLES state. We added them initially to attempt a performance improvement, but it's likely they didn't significantly decrease memory accesses or the number of instructions we process for GLES calls. Hence removing them should be an improvement in safety without a perf loss. Bug: angleproject:6864 Change-Id: I54107686992065a514077c71d173b804e295515e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3378904 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Peng Huang 5adee916 2022-01-11T13:09:55 Wrap some global vulkan methods which depend on env variables ANGLE scoped sets some envion variables during initialization. Those env variables will change some vulkan global methods behavior. So to make sure those global methods have same behavior, this CL wraps those global methods, and sets those envion variables before call those vulkan methods. Bug: chromium:1264439 Change-Id: Ie4e29884fcf5b67f4e53ddd3c90a9ade7b226a1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3379209 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Shahbaz Youssefi 6601b8d2 2022-01-14T14:15:24 Vulkan: Fix storage buffer limits on geom/tess without Vulkan support Bug: angleproject:6896 Change-Id: I7172b65b460122fcb2485921fadb360dba199283 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3388117 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov 30254d34 2022-01-14T12:54:40 Ignore VUID-RuntimeSpirv-NonWritable-06341 warning To facilitate setting up Pixel 6 bot, where it triggers Bug: angleproject:6896 Change-Id: I69241f56a3b26ed932f06563aca700ff77fdb2dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3388195 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 158d4783 2022-01-13T13:30:34 Vulkan: Suppress VVL message about allocation exceeding heap size VMA does not check the result of vkGetBufferMemoryRequirements against the heap size before attempting to make an allocation, which leads to a validation error. The error is benign for ANGLE as the subsequent Vulkan allocation will fail, leading to an OOM generated by Vulkan isntead of ANGLE to the same effect as far as the application is concerned. Bug: angleproject:6444 Change-Id: Ia474629971d6835f727b3fb43313a6003e3c939a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3387088 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 6312da1a 2022-01-10T14:00:55 Vulkan: Disable GL_KHR_parallel_shader_compile Disable the extension GL_KHR_parallel_shader_compile in the Vulkan backend. Vulkan's shader compiler is very fast and is outweighed by the threading overhead. Additionally, Vulkan doesn't support parallel linking, which is where the real benefit of multithreading lies. Bug: angleproject:6748 Change-Id: I0cd14856865eaaade6bfa40d4bf9f133d613b4d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3379302 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Amirali Abdolrashidi 9b1a6d8a 2022-01-06T10:38:25 Vulkan: Invalidate depth/stencil unconditionally * Moved depth/stencil content invalidation during swapImpl() to doDeferredAcquireNextImage(), so it can be done regardless of whether render pass optimization is done. Bug: angleproject:6861 Change-Id: I47fab18afe5b178bf55c2df3df712c40118aff1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3370583 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Peng Huang cd157aae 2022-01-12T14:44:50 Revert "Use STL container for vulkan memory allocator" This reverts commit cc516f97018fdcbcded2b0bad712a0bc2af4e227. Reason for revert: This is not the right way to use STL containers in VMA. See [1] for detail. [1] https://chromium-review.googlesource.com/c/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/+/3381940 Original change's description: > Use STL container for vulkan memory allocator > > There is a crash related to VMA containers, so switch to STL > containers to see if it can workaround the issue. > > Bug: chromium:1266412 > Change-Id: I8416e4b4a27588ac2d710a4ef7600cd91b080535 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3327744 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Peng Huang <penghuang@chromium.org> Bug: chromium:1266412 Change-Id: Ib020c824a3576489c728503a2ced68ca772d4065 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3381979 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Lingfeng Yang 926b43e7 2022-01-06T13:31:54 Reland: Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. This is done via a new custom entry point, EGL_PrepareSwapBuffers, so that we can control how the global lock is used throughout the entire call. Bug: angleproject:6851 Change-Id: I095cd8b3bdbb13c842cab0a46148e2122582cdfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373426 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Mohan Maiya 2d105177 2022-01-10T11:44:37 Enable a few features for Samsung Check for Samsung vendorID and enable a few features. Bug: angleproject:5111 Change-Id: I17a93bfb9a094b80d185eb3d2a08ed00f528a30b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3379223 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Roman Lavrov 345cdcb0 2022-01-10T22:41:46 Rename features for consistency. supports_custom_border_color -> supportsCustomBorderColor supports_protected_memory -> supportsProtectedMemory Also drop EXT from the end of the variable name as other variables don't have that. Bug: angleproject:6731 Change-Id: I60b20d84387bccbca0c4c1cbc7e341c1f5e8f0ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3378827 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Tim Van Patten b0e15ee4 2021-12-28T20:37:33 Decide GL_KHR_parallel_shader_compile in backends GL_KHR_parallel_shader_compile was previously being enabled unconditionally in the front end. However, some backends (Vulkan) perform worse with parallel shader compilation. This CL moves the decision of enabling GL_KHR_parallel_shader_compile to the backends. To support single-threaded shader compilation without affecting the generic worker thread pool, Context::mSingleThreadPool is added to own the single-threaded WorkerThreadPool and can be returned by the new function Context::getShaderCompileThreadPool(). Otherwise, if the extension is enabled, the (renamed) Context::mMultiThreadPool is returned. Bug: angleproject:6748 Change-Id: Ic8d3a183f397608f3002a05480deb976dfe44792 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3360337 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Yuxin Hu a026d053 2021-12-22T01:08:33 Add support for subgroupSize of 16 in Debug Overlay Module The subgroupSize on some Android devices is 16, which is not supported by current OverlayCull and OverlayDraw compute shaders. This change adds support for subgroupSize of 16. This change also removes the subgroupBallot and subgroupArithmetic paths in OverlayCull compute shader. These two paths were added by Shabi as an experiment, and he suggested to remove them for easier code maintenance purposes. Bug: angleproject:6806 Change-Id: I5ce68cb18fbf3472c987d811c89f065cb8581858 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352865 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 9d11a341 2021-12-16T13:47:04 Vulkan: Fix Vulkan SCB vs multiple subpasses vkCmdNextSubpass must be called on the primary command buffer, so the render pass command buffers need to be split on subpass boundaries. This is only done when using Vulkan secondary command buffers. Bug: angleproject:6811 Change-Id: I087fff305c757c78e87bfde4410e7de6bd1a6ba6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3344774 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi acd8fc76 2021-12-16T01:05:02 Vulkan: Distinguish RP and outside-RP command buffer types What goes inside and outside a render pass command buffer is largely mutually exclusive. Moreover, the size and frequency of allocations is different between the two. This change distinguishes the C++ types used for inside and outside render pass command buffers: - The type now documents which command buffer a function is able to receive. - `isRenderPass` flag passing, checking and asserting is largely removed. - A follow up change experiments with using different (Vulkan vs ANGLE) secondary command buffers for inside and outside RP command buffers. - A future change could specialize the pool behaviors per command buffer type. Bug: angleproject:6811 Change-Id: Ia4bc669d26ac7e94e8a0dfb9b361666c82f42cc3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3344373 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 60a8b593 2022-01-05T11:06:16 Vulkan: Remove std::unique_ptr usage from BufferVk::mBuffer BufferVk::mBuffer is std::unique_ptr mostly because BufferHelper object itself does not support move assignment. Now crrev.com/c/3366855 added move assignment support, we can now use BufferHelper directly. The main downside I can see is that in BufferVk::ghostMappedBuffer() and BufferVk::acquireAndUpdate() functions where we have to use move assignment of mBuffer object, it becomes slightly more expensive than moving pointer. But switch to using BufferHelper directly makes code simpler and other access to mBuffer (which is more common usage) slightly cheaper by removing one pointer indirection. Bug: b/208323792 Change-Id: Ia7e7731e284eb6c76db954fef194e9d1de82174b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3362252 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Cody Northrop ae1a56b6 2022-01-06T17:04:41 Vulkan: Turn on GL_EXT_shader_framebuffer_fetch for ARM On ARM, coherent is the default behavior of framebuffer fetch, so we can expose the GL extension. Tests: Dead By Daylight app and trace Bug: b/201764768 Bug: angleproject:6870 Bug: angleproject:6872 Change-Id: I0f98c57e20619d73d1507c4655e7f9bb8c10a53a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3371244 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 9d668d6c 2022-01-07T18:18:23 Revert "Frontend: separate lock in swap prep" This reverts commit 40c5cb255c0a07bdab574aa076ee603e7d791ab3. Reason for revert: Regression in TSAN caused by this CL: https://ci.chromium.org/ui/p/angle/builders/ci/linux-tsan-test/352/overview Original change's description: > Frontend: separate lock in swap prep > > Swapchain-based backends like Vulkan might block a lot in > vkAcquireNextImageKHR, which is bad for overall fast progress if we also > hold the global EGL lock there. > > This CL starts to split the global EGL lock. We release the EGL lock > when performing vkAcquireNextImageKHR, and only maintain a lock for > surfaces. > > Bug: angleproject:6851 > Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Lingfeng Yang <lfy@google.com> Bug: angleproject:6851 Change-Id: Ie03b784021f7b8b5c1ef95a911ef7da4029abd46 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373165 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lingfeng Yang 40c5cb25 2022-01-06T13:31:54 Frontend: separate lock in swap prep Swapchain-based backends like Vulkan might block a lot in vkAcquireNextImageKHR, which is bad for overall fast progress if we also hold the global EGL lock there. This CL starts to split the global EGL lock. We release the EGL lock when performing vkAcquireNextImageKHR, and only maintain a lock for surfaces. Bug: angleproject:6851 Change-Id: I329d5c4c579718a4980c4261590f77099ce1400e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3361249 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Charlie Lao caf6433a 2022-01-04T14:37:29 Vulkan: Rename releaseStagingBuffer to releaseStagedUpdate There is no more per ImageHelper dynamic buffer for staging, and this function is not just removing staging buffer, but removing all staged updates. Rename it to reflect what it actually does. Bug: b/208323792 Change-Id: I5a2182291848a9e137ed29b888f31215664b46fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3367078 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 93159c02 2021-12-30T16:01:52 Vulkan: Remove DynamicShadowBuffer implementation This is no longer used since mShadowBuffer was removed from BufferVk in https://chromium-review.googlesource.com/c/angle/angle/+/3313333 Bug: b/208323792 Change-Id: I0bb1d66c2f0f58bac74139a274c957681edf2ad4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3362504 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 3263eb01 2021-12-28T10:10:50 Vulkan: Switch GPU translated vertex buffer to NonHostVisible When we translate using GPU, there is no need to use host visible memory. Use device local memory instead. Bug: b/205337962 Change-Id: Ic76dcb28bde2f079f6ac406d846518bf5f369d74 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3340553 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 8589c456 2021-12-22T17:13:33 Vulkan: Remove mStagingBuffer from ImageHelper and ContextVk This CL removes ImageHelper::mStagingBuffer and ContextVk::mStagingBuffer and uses per shared group staging buffer pool instead. Bug: b/208323792 Change-Id: I46b5fd542697eb860def9c6d592dd147ad4dc973 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354090 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 6da1ac81 2021-12-22T10:13:43 Vulkan: Switch ReadPixels from DynamicBuffer to shared pool FramebufferVk::readPixelsImpl() and ImageHelper::copyImageDataToBuffer() use per FramebufferVk DynamicBuffer. This CL removes this and uses shared buffer pool to allocate a temporary staging buffer for readPixels as needed and frees it immediately afterwards. Bug: b/208323792 Change-Id: I65ddf9bf9f1f14578d9def63f5287cb1a4121dff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354038 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao ad27d5d6 2021-12-21T11:22:30 Reland "Vulkan: Consolidate all vertex conversion buffers to shared pool" This is a reland of cca412cd8b349b7281727c50f2a59d115fd90a05 Further inspection shows it was red-herring. The original CL does not have the un-intended diff that I saw in the commit email. This is try to reland the original CL without any modification. Original change's description: > Vulkan: Consolidate all vertex conversion buffers to shared pool > > There are various conversion buffers that holds converted vertex or > element or index data. They are DynamicBuffer for now. This CL switches > them to use the shared group buffer pool. With this change, all > allocation is represented by a BufferHelper object instead of an offset. > I am able to remove the offset arguments from a lot of APIs. > > Bug: b/208323792 > Change-Id: Ib611beb0c16cddbdd9ddf7b8961c439da9fa5180 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352489 > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/208323792 Change-Id: I90852ad38c2b9ac423800bb6854757bcc17cd166 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3370602 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Tim Van Patten a61a7f59 2021-12-28T18:16:40 Vulkan: Use correct aspectMask Update ImageHelper::stageSubresourceUpdateFromImage() to use the correct aspectMask flags based on the image's format, rather than assuming only color formats. Additionally, only call ensureMutable() for sRGB textures that indicate srgbDecode == GL_SKIP_DECODE_EXT. Bug: angleproject:6852 Test: DepthStencilFormatsTest.DepthTextureRender Change-Id: Iaf1f167612144f836c5574b0f561cc1b58c3cb6a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3360090 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Charlie Lao 4e85bdd9 2022-01-06T17:06:25 Revert "Vulkan: Consolidate all vertex conversion buffers to shared pool" This reverts commit cca412cd8b349b7281727c50f2a59d115fd90a05. Reason for revert: There is accidental code merge bug left in. Original change's description: > Vulkan: Consolidate all vertex conversion buffers to shared pool > > There are various conversion buffers that holds converted vertex or > element or index data. They are DynamicBuffer for now. This CL switches > them to use the shared group buffer pool. With this change, all > allocation is represented by a BufferHelper object instead of an offset. > I am able to remove the offset arguments from a lot of APIs. > > Bug: b/208323792 > Change-Id: Ib611beb0c16cddbdd9ddf7b8961c439da9fa5180 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352489 > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/208323792 Change-Id: I18bba207d1d8bb76dff32d9855a744dba93bc6d6 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3370601 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao cca412cd 2021-12-21T11:22:30 Vulkan: Consolidate all vertex conversion buffers to shared pool There are various conversion buffers that holds converted vertex or element or index data. They are DynamicBuffer for now. This CL switches them to use the shared group buffer pool. With this change, all allocation is represented by a BufferHelper object instead of an offset. I am able to remove the offset arguments from a lot of APIs. Bug: b/208323792 Change-Id: Ib611beb0c16cddbdd9ddf7b8961c439da9fa5180 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3352489 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Tim Van Patten fd014271 2021-12-16T20:44:42 Vulkan: Match chromaFilter to min/mag for YUV AHBs From the VVL: VUID-VkSamplerCreateInfo-minFilter VkCreateSampler: VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT specifies that the format can have different chroma, min, and mag filters. However, VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT is not supported for VkSamplerYcbcrConversionCreateInfo.format = VK_FORMAT_UNDEFINED so chromaFilter needs to be equal to minFilter/magFilter. We don't know what the min/mag filters are when the AHB is imported, so we need to update the YcbcrConversionDesc with the current min/mag filter value before creating the VkSamplerYcbcrConversion when the ImageView is created. Additionally, if the min/mag filters are updated later, TextureVk::syncState() needs to recreate the ImageViews to ensure the chromaFilter matches the new min/magFilters. Test: atest android.media.cts.DecodeAccuracyTest#testGLViewDecodeAccuracy[0] Test: ImageTestES3.SourceYUVAHBTargetExternalYUVSampleLinearFiltering Bug: b/210526871 Change-Id: I95dbd9738f6e3fd0870e484518eee105e995f93a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3346394 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Charlie Lao 0e49a3dd 2022-01-04T11:23:54 Vulkan: Add std::move support for BufferHelper There are needs to support std::move for BufferHelpers in other CLs (See crrev.com/c/3352489). Without this support, we can not store BufferHelper into std::vector. This CL adds move support for BufferHelper class. Bug: b/208323792 Change-Id: I93f79490715750abc1bcedd41b683ad0c2460ebb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3366855 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 43b0e92b 2021-12-13T15:38:32 Vulkan: Consolidate mHostVisibleBufferPool and mMapInvalidate BufferVk::mHostVisibleBufferPool is allocated when BufferVk::mBuffer is not hostvisible and we need to map it. In that case mHostVisibleBufferPool is allocated and data copied from mBuffer to it and the pointer to mHostVisibleBufferPool is returned to user. BufferVk::mMapInvalidateRangeStagingBuffer is used when map is called on a small range. In this case we allocate memory for the small range of buffer and return that intead of waiting for entire buffer for GPU to finish. Also when BufferSubData is called, we also needs to allocate a staging buffer and issue a copyBuffer from staging buffer to main buffer. This CL consolidate all these three usage cases into one mStagingBuffer. It removes mHostVisibleBufferPool and mMapInvalidateRangeStagingBuffer from BufferVk class. This makes overall logic of managing data consistency much simpler as well since we only have two buffers: The main buffer storage mBuffer or mStagingBuffer. And mIsStagingBufferMapped tracks if mStagingBuffer is the one actually mapped to user or not so that at unmap time we know if we should flush the data to mBuffer or not. Bug: b/208323792 Change-Id: I4f0c79a2d86da1a43844ed2ba83ddeb7dd4a5c0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335216 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Peng Huang e9e9a2c6 2022-01-04T20:14:48 Do not pass mInstance to vkGetInstanceProcAddr for vkEnumerateInstanceVersion Bug: angleproject:6869 Change-Id: Ifc93a067824c3467003a47bad240b3be10874ab0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3366038 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Shahbaz Youssefi a400e76d 2021-12-22T12:24:13 Vulkan: Don't expose MSRTT without VK_KHR_depth_stencil_resolve Previously, ANGLE exposed the EXT_multisampled_render_to_texture extension even if VK_KHR_depth_stencil_resolve was not available. This was due to scarcity of drivers on the bots with support for this extension and allowed partial testing. This is no longer true. Additionally, this cleans up the expectations because old and buggy drivers are now simultaneously filtered out. Bug: angleproject:6845 Change-Id: I8c285a5fa5d9beeb98b48d8b056cdc8779cce6fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3353895 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Lingfeng Yang 6f1c39b5 2021-12-16T16:10:49 Vulkan: Restore color attachment mask-related blend states When we end up resetting blend state such as when changing to a depth-only FBO and back, we can end up adding attachment states. They need to be updated with the current GL blend state. Bug: b/210543392 Bug: angleproject:6828 Change-Id: I3419acb8081eb7d662576a75382bb8684cc0d29f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3346320 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Tim Van Patten 542f7d80 2021-12-22T19:36:27 Vulkan: Copy buffer data to correct cube map face TextureVk::copyBufferDataToImage() was failing to set region.imageSubresource.baseArrayLayer to the correct cube map face value, causing every glTexSubImage2D()-type call using GL_PIXEL_UNPACK_BUFFER to only copy to the GL_TEXTURE_CUBE_MAP_POSITIVE_X face. In the case of PUBG Mobile, this left all other faces with "random" data, resulting in corrupted reflections on things like water, the airplane, etc. Bug: b/194140619 Test: TextureCubeTestES3.CubeMapPixelUnpackBuffer Change-Id: I93a9219ce098985f9f4b906f8fe2e05850fb8d43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3354091 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Cody Northrop 2ebd583e 2021-12-22T11:24:43 Android: Remove setenv from common path In Android production stress testing, the setenv call was causing a race condition. To fix, only use setenv in the paths that need it as a performance optimization. Specifically, FrameCapture makes use of it every frame. Bug: angleproject:6822 Change-Id: I452f1ef8607ca9baf15d69246932c47454a3ce46 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3353893 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Charlie Lao 2f3e6cc0 2021-12-13T17:40:18 Vulkan: Remove mShadowBuffer from BufferVk class. The shadow buffer was initially designed to avoid synchronization in glMapBuffer call while buffer itself is still busy. There are many optimization done inside BufferVk::mapImpl that try to avoid wait for GPU as much as we can by distinguish GPU write versus read, by detecting map call read/write intention by checking access bit, and finally by allocating a staging buffer to return a CPU friendly copy of data to caller. This shadow buffer implementation also have known bugs that are not keeping data in sync. With all these optimization added after initial mShadowBuffer implementation, I believe we do not have a good reason to still keep mShadowBuffer. And this has been disabled for months in main branch. This CL removes this code path completely which makes code a lot simpler. Bug: b/208323792 Change-Id: Ie5999e38b6120a371ec2e969f196e4754ebd0f8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313333 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao bc9d2d7d 2021-12-07T16:16:47 Vulkan: Consolidate BufferHelper's code paths into one There are cases that BufferHelper may not sub-allocate from the pool. For example, when buffer is created from external memory. Right now we have two different code paths in the BufferHelper object and checking if suballocation object is valid or not and pick different code path. This CL consolidates both code path into one by making non sub-allocated case also creates BufferSUbAllocation object and owns a BufferBlock object. Bug: b/205337962 Change-Id: Iac82bdb0b69d424e4147b52d458ced6274e106a1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3322100 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 4114fe23 2021-11-20T22:05:56 Vulkan: Simplify transform feedback emulation logic In [1], the program is transformed to not output transform feedback logic when transform feedback is inactive. With that change, it's no longer necessary to dedicate a driver uniform to indicate if transform feedback is active. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/3294661 Bug: chromium:1209285 Change-Id: Ica725d0da08e2676f442fe6307962d367b443535 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3294702 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao eca427b2 2021-12-20T10:55:41 Vulkan: Add mutex to protect mVirtualBlock mVirtualBlock could be accessed from multiple thread when asyncCommandQueue is enabled, where the free call could come from the submission thread. This CL adds a mVirtualBlockMutex in BufferBlock and always take the lock when mVirtualBlock is been accessed. This CL also adds ConditionalMutex class for the general usage that a mutex is only used based on a boolean. Bug: angleproject:6840 Change-Id: Ib647b4ff12ebfc08f2a70192d39f16e15a1fc5f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3350798 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi c1598640 2021-11-30T23:44:30 Vulkan: Improve mid-RP clear warning message One app does: - Draw - Draw - Clear depth, then disable it - Draw In this case, the message generated for mid-RP clear, suggesting the clear be done earlier is not meaningful as the previous draw calls did use the depth/stencil image. The message now includes an alternative suggestion to invalidate the depth/stencil image instead of clearing it. Note that the app may still legitimately do multiple passes in one render pass where depth/stencil is cleared in between, so the warning is not applicable in all cases. It's still useful to notice issues in more common scenarios. Bug: angleproject:2472 Change-Id: I3abbecf8c83b7b856c2430675e69b1471e91c0c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3308920 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi cf8ac00a 2021-12-20T11:57:25 Vulkan: Fix MSRTT w.r.t stencil-only unresolve The stencil bit was being silently masked out in a bitset in FramebufferDesc that tracked whether the framebuffer requires any unresolve. If only stencil needs unresolving, this mask was zero, leading to an incorrect framebuffer getting pulled from the cache. A follow up change will add an ASSERT in BitSetT to catch such errors in the future. This issue was only reproducible on SwiftShader and AMD as the only implementers of VK_EXT_shader_stencil_export. Bug: angleproject:6840 Bug: angleproject:6324 Change-Id: I4f055982ebd75f621ec1e34b0d60eaa497c27b17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3349979 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 34ea8111 2021-10-28T11:07:53 Reland "Vulkan: Don't expose MSRTT on SwiftShader" This is a reland of fb77afd3c76301e11f5c7397d9a63d283f86036c Original change's description: > Vulkan: Don't expose MSRTT on SwiftShader > > Emulating this extension on SwiftShader is neither useful nor efficient > (on the contrary, it hurts performance (which is true for all non-tiling > architectures)). This extension was exposed purely to increase testing > coverage, but is being disabled now as OOMs resulting from allocating > the implict multisampled image is confusing Chrome. Note that > SwiftShader exposes only a limited amount of memory. > > Bug: chromium:1263046 > Change-Id: Ia69b7fc63804169431885352a8f637a95ab08bd0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3251581 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: chromium:1263046 Change-Id: I88415f3c1a7532eda5473da6acbd22acf14ae11c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3260330 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 4a148e9d 2021-12-20T13:39:48 Revert "Vulkan: Suppress VUID-vkCmdDraw-blendEnable" This reverts commit 797ebdde9894b4411ed304a83fdaeb8d8a91fe56. Reason for revert: The VVL bug has been fixed. Original change's description: > Vulkan: Suppress VUID-vkCmdDraw-blendEnable > > A new VVL causes failures in BlendIntegerTest.MRT* > > Bug: angleproject:6355 > Change-Id: If62b1a7934574acaeb95601d7fb0a61dc5d9c99a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140159 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:6355 Change-Id: I769d34fada1c2db00513f9912ef178dcd1eb4ee9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3347648 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 6c894e82 2021-11-04T14:49:41 Vulkan: Replace BufferVk::getBufferAndOffset() with getBuffer() Now BufferHelper class already keeps offset information. There is no reason for BufferVk to have that information any more. Bug: b/205337962 Change-Id: I6e014fb480bfcd5018ef9231b0fb87a50021f179 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3266147 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 83a670ab 2021-10-29T09:12:26 Vulkan: Implement BufferPool using VMA's virtual allocator VMA's allocation calls used to be sub-allocating a pool of memory. What we really want is sub-allocate a VkBuffer object. VMA recently added support to expose the underlying range allocation algorithm via APIs, which user can use it to sub-allocate any object. This CL uses that new virtual allocation API to sub-allocate from a pool of VkBuffers. In this CL we only switched BufferVk::mBuffer to sub-allocate from the BufferPool object. Bug: b/205337962 Change-Id: Ia6ef00c22e58687e375b31bc12ac515fd89f3488 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3266146 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Lingfeng Yang 83679716 2021-12-14T19:02:48 Vulkan: Dirty vertex buffers if default attrib values changed In the call_break_offline trace, attribute index 4 is disabled then enabled before a draw. This redundant operation is currently not blocked and makes it to the Vulkan backend, resulting in handleDirtyGraphicsVertexBuffers. However, at the same time, we change the default attrib value for index 3. Which makes handleDirtyGraphicsVertexBuffers not redundant. We'll need to take into account cases when other attribute indices are not dirty and yet the default attrib value changes. Bug: angleproject:6802 Change-Id: I4a3ec411aa42f73a209fd0f06976d7ef2d21e027 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3331412 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Lingfeng Yang <lfy@google.com>
Charlie Lao 543f5750 2021-12-15T16:58:46 Vulkan: Disable protected memory for ARM ARM driver reports protected memory feature support. But when we enable the feature, even if the feature is not been used (i.e., no memory or queue is created with protected bit), we still see quite large performance drop, mainly due to excessive load/store unit activity. This CL disables this feature on ARM platform until we can find a good solution for it. Bug: angleproject:6817 Change-Id: I57e8b3f568f3818080e56b5d6ae9d1623732d236 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3343671 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Peng Huang 6e5fd816 2021-12-15T18:31:13 Support more ImageLayout in ConvertImageLayoutToGLImageLayout Bug: chromium:1264439 Change-Id: I35938a65981edf495bd9aafb8bfb17aa3ec9a66c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3341640 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Amirali Abdolrashidi 89e11878 2021-12-06T09:42:46 Vulkan: Fix the UAF issue with BufferData * Fixed the use-after-free issue with stale buffer handles after calling BeginTransformFeedback. * Added an observer for TransformFeedbackVk to update the buffer handles when buffer's storage is changed and the buffer update type is StorageRedefined. * Added a function to TransformFeedbackVk::onDestroy() to release the counter buffers in order to avoid crash due to TransformFeedbackVk::end() not being called, e.g., as a result of no glEndTransformFeedback() calls. Bug: chromium:1274316 Change-Id: I8ed477f36e6ff89dd4764bb59af564c69efe33e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3321789 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 05a44dd2 2021-11-29T12:16:58 Vulkan: Set content undefined on eglSwapBuffers * Invalidate the swap buffer content if the swap behavior is EGL_BUFFER_DESTROYED. * In that event, WindowSurfaceVk::getBufferAge() sets `age` to 0 and returns with no errors. * Unit tests in EGLBufferAgeTest.cpp updated to reflect this. * Minor cleanup in the test file. Bug: angleproject:6363 Change-Id: Ibab7ccb99c1be149588e6aad16bcc2d6dd989295 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3307776 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 5275f487 2021-12-14T21:03:54 Vulkan: Disable async command queue with Vulkan SCBs There is currently a threading hazard with ContextVk::mCommandPool, where ContextVk records to command buffers allocated from the pool while the async command queue thread is using other command buffers allocated from the same pool. While experimenting with Vulkan SCBs, disable the async command queue feature when using Vulkan SCBs. It is unknown whether async command queue with Vulkan SCBs is even worthwhile; if it proves to be, we could make ContextVk maintain multiple pools and rotate between them. Bug: angleproject:6811 Change-Id: Iac2e9337b5b109b2c7cb359109afe6ee386e4c34 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3340018 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 90c3038e 2021-12-14T16:46:13 Vulkan: Fix desc set updates with Vulkan SCBs Since Vulkan SCBs are a command buffer in their own, we cannot aggregate desc set updates to be done once after all the binds have been recorded. This change makes sure that desc set updates are issued before bind, but this problem could potentially also be solved with VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT, by actually issuing the writes at the end of the secondary CB, just before closing it. Bug: angleproject:6811 Change-Id: I18e150b73a5881258679ba53a2d84acd2fc44edd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3338390 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 800c6971 2021-12-08T01:08:17 Modified buffer fallback format to smaller storage format Bug: angleproject:6726 Change-Id: I475d99fc0143f265e66cc4f7aa13fa0de8745169 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3315916 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Mohan Maiya e70a81b9 2021-12-14T13:41:28 Vulkan: Rectify typo introduced in 36fcf80b1f2a99 The method should have been updateYcbcrConversionDesc Bug: angleproject:6732 Test: Texture2DTestES3.*Yuv*Vulkan Change-Id: I67ab35ac07a6d751cbe3c3c29bdde21a5a7f5834 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3339605 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Mohan Maiya 36fcf80b 2021-12-11T20:55:53 Vulkan: Consolidate SamplerYcbcrConversionCache Now that SamplerDesc and ImageHelper have the fully qualified description of a VkSamplerYcbcrConversion, we can lazy allocate the conversion handle along with streamlining the interface to the SamplerYcbcrConversionCache class. Bug: angleproject:6732 Test: Texture2DTestES3.*Yuv*Vulkan Change-Id: I7deaa0220031bc4c500d88021459017bf937218c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3333629 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Hailin Zhang 7b13a9ac 2021-12-09T18:37:59 Vulkan: Fix dynamic partial update buffer data issue. add test case for dynamic update buffer data. Signed-off-by: Hailin Zhang<hailinzhang@google.com> Bug: b/207714894 Change-Id: I8c1e93d152847c3162c0e2dd49abe3d899c859a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3328869 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Hailin Zhang <hailinzhang@google.com>
Peng Huang 32f572b7 2021-12-03T17:58:51 Support creating EGLImage from VkImage Bug: chromium:1264439 Change-Id: I520182143e748f25b44d0725f3f171b7b33a85d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3311131 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Amirali Abdolrashidi 5b858acf 2021-12-09T14:22:14 Vulkan: Fix the offset issue in multiDrawIndirect * In MultiDrawElementsIndirect, it resets the index buffer offset (mCurrentIndexBufferOffset) to 0. * Added a unit test for MultiDrawElementsIndirect to make sure that the index buffer offset is reset properly. * Updated the test program in MultiDrawIndirectTest to include a multi-colored mode. * D3D11 and Metal tests regarding the following functions are disabled so more test coverage can be added: * glMultiDrawElementsIndirectEXT * glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Bug: angleproject:6751 Change-Id: I81bb7b3aa9b6ad8a9283dd50728ec6250c3668ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3330737 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi b7a42c88 2021-12-13T15:53:07 Vulkan: Remove VK_EXT_swapchain_colorspace check We don't make use of this extension since https://chromium-review.googlesource.com/c/angle/angle/+/3208689. Bug: angleproject:2514 Change-Id: I8b8edf5006ac1c3eeeefcadbe77249a5a6a5dda7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335070 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill f40e83cb 2021-09-10T19:15:17 Reduced "rx::vk::kInFlightCommandsLimit" from "100" to "50". The "100" value is too high and causes "S21 Adreno" block in "vkQueueSubmit()". This is a temp solution. Patch authored by Igor Nazarov <i.nazarov@samsung.com> Bug: angleproject:6401 Change-Id: Ie7f9c8ef5311b17325640cae0f613ece768c0fa3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3165666 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>