src/libANGLE/renderer/vulkan/vk_helpers.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 3d2de99e 2020-06-09T01:14:42 Vulkan: Fix RTs attached to textures with non-0 mip Cleared confusion between GL level indices and VK level indices by adding the corresponding suffix to variables and function arguments. A handful of places that sent one index and expected the other are fixed. The conversion between the two is given by: levelIndexGL = levelIndexVk + baseLevel; Bug: angleproject:4695 Change-Id: I84ecbaf867d00a40fb39b6db7ad79658016f4d9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2235362 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 15328f69 2020-06-04T16:59:22 Capture/Replay: Don't assert when reading combined depth/stencil We can't actually read them back at the moment, so this needs a proper fix. In the meantime, the apps we are tracking don't need this value at the beginning of the trace. Test: Angry Birds 2 MEC Bug: angleproject:3662 Bug: angleproject:4688 Bug: b/157672184 Change-Id: I67190092bcce7080edc69714f1ca1194c37d54fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2231802 Reviewed-by: Manh Nguyen <nguyenmh@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi da958a59 2020-06-04T13:56:47 Vulkan: Fix clear of non-zero-base-level images The staged resource updates adjusted their level to take base level into account, but clear updates used a cached unadjusted value. Bug: angleproject:3148 Change-Id: I9a49d5341083b2f870baa1ee6053e54baef35086 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2230786 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 6c158164 2020-05-28T15:19:51 Vulkan: Fix XFB invalid accesses in buffer OOM. This uses the "null" buffer in the Renderer to bind an empty buffer handle so ANGLE can maintain a consistent state. Bug: chromium:1086532 Change-Id: I1912a1d1cb64433a285fcfced80a675619690a0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219140 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill b947498b 2020-05-28T13:06:13 Vulkan: Clean up VMA wrapper classes. Make these more consistent with the rest of the wrapper classes. Also handle some VkResult errors that were being ignored. Will pave the way for better handling of buffer allocation error conditions. Bug: chromium:1086532 Change-Id: Idc5b3f0e2945b1f44f152d33e8cc572f83a6b658 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219136 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Jamie Madill 558882a1 2020-05-28T15:26:37 Vulkan: Pass vk::Context to BufferHelper::init. This is necessary so we can initialize a "null" BufferHelper in RendererVk which does not have access to the ContextVk. This in turn will allow us to use a single global "null" Buffer instead of instantiating them all over ANGLE. Also removes a TODO that was sticking in the code. Bug: angleproject:2162 Bug: chromium:1086532 Change-Id: Ica48d5b886e885ebfe0f8e3abfbe8169a8eaa5b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Antonio Maiorano 9905f7f5 2020-05-29T11:25:33 Fix CopyTextureTestES3.ES3FloatFormats for VK When enabled, this would crash in debug because mFormat would be nullptr on the target VkTexture, and the ASSERT would access mFormat via getAspectFlags(). Fixed this by only calling getAspectFlags() if mFormat is valid. I'm not sure this was the original reason this test was disabled, but they pass now on SwiftShader. Bug: angleproject:4092 Change-Id: I9b04bbc61dde14f722d3a510f3d38776f4f6c7ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2221420 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Tobin Ehlis 02fa7313 2020-05-05T17:01:18 Vulkan:Initial worker thread disabled by default Created new CommandProcessor class that can be run as a worker thread. Running CommandProcessor within RendererVk as a worker thread that takes a CommmandBufferHelper (CBH) ptr as the interface and processes that CBH into a primary command buffer. Main thread has a queue of CBH to draw from. After submitting a CBH to the worker, it pulls next CBH from the queue. Worker thread releases CBH back to the main thread queue when done. Synchronization goes two ways: 1. Work submitted to worker thread is managaed with a mutex and condition variable based around the work queue. 2. Available CBH ptrs for the main thread have a mutex and condition variable that manages the CBH queue. The worker thread is disabled by default, and, when enabled, it will currently behave and perform as the non-threaded code. This is because the kNumCommandBuffers const in ContextVk.h is set to 2. With only 2 command buffers, they will be assigned to the inside and outside RenderPass command buffers respectively. Then, as soon as one is submitted, the main thread will stall waiting for it to be completed and put back into the queue mentioned in #2 above. The next step is to move command submission to the worker thread and update the number of command buffers so that processing/submission will occur in parallel with the main thread. Right now there is a race condition issue when attempting to run in parallel because the main thread updates and submits the same primary command buffers that are used in the worker thread, which is in violation of the Vulkan spec. The follow-on CL will fix this issue as the main thread will only touch SecondaryCommandBuffers and the worker thread will be the only thread touching the primary command buffers. Bug: b/154030730 Change-Id: Ib0c518bbd7ca9a3a7e789f4e1f2f7131ddc0509e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174719 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 30298dc2 2020-05-15T15:21:04 Vulkan: Optimize out barrier needs for transition between shaderReadOnly If we are transition between different kind of shaderReadOnly, there is no actual layout change or accessType change. Instead of always insert a barrier, this will track what shaderStage has made read access and only insert barrier if the read is from new shader stage. The barrier inserted will be always from last non-ShaderReadOnly transition. There is no read to read barrier generated. Bug: angleproject:4550 Change-Id: I4aeb7d4bddf2d072b60839f98e7af1aa23f977b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2204480 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Tobin Ehlis d3d7b95b 2020-05-19T17:27:50 Vulkan:Migrate timer sync functions to one-off cmd buffer ContextVk's getTimestamp() and synchronizeCpuGpuTime() were the two places that mCommandQueue was used outside of processing SecondaryCommandBuffers. Migrating those functions to use the one- off command buffer instead. This will allow for the removal of mCommandQueue from ContextVk as we migrate it to RendererVk instead for threading phase2 development. Bug: b/154030730 Change-Id: Ic00ce56739dadcdc4b5a1b1839e0e18603bfe0eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2209312 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 1a4f6e1f 2020-05-20T10:37:24 Vulkan:Migrate command buffers to pointers This is an intermediate CL as we move to a worker thread. With the worker thread there will be a pool of more than 2 command buffers so the current command buffers in use on the main thread will be pointers that are assigned from that pool. This CL isolates the command buffers as pointers to make review simpler. Bug: b/154030730 Change-Id: I3fc91222b07d5f3bf60f92a4c01b0910daad7df6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2207812 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya cf8422c2 2020-05-19T10:14:02 Vulkan: Acquire a new BufferHelper from the pool based on a threshold We acquire a new BufferHelper from the pool when the app updates the data of the entire buffer. In scenarios where the app updates say, 60% of the buffer it would still be benificial to acquire a new buffer and copy over the remaining 40% of data from the old buffer to the new one. This reduces the transfer workload from 60% to 40% of buffer size. Currently the threshold is set to 50% of buffer size. Bug: angleproject:4380 Change-Id: I12576c585230e771d4c1a4352fab93dd3db2ecef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2204655 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 258d94f6 2020-05-18T16:21:50 Vulkan: Add workaround for nvidia to always merge barriers into one vkCmdPipelineBarrier call Nvidia preferes one barrier call than multiple calls with fine grained stage dependency information. They do not care much about stage dependency. This adds a feature flag that sets to true on nvidia and will merge all barriers into one call. Bug: angleproject:4633 Change-Id: I204484aa4c5989655f74d70a0eaa235c3c83f548 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2207635 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Charlie Lao 8a90905c 2020-05-16T17:35:03 Revert "Vulkan: Try to merge barriers if possible" This reverts commit 153c14cbd6e9f095c09dc1e6c938b1656bc56159. Reason for revert: The dependencyStrongerThan logic is incorrect and causing perf regression on ARM. Original change's description: > Vulkan: Try to merge barriers if possible > > This is try to reduce the number of vkCmdPipelineBarrier API calls into > driver. It should not affect the actual barriers. > > Bug: b/155341891 > Change-Id: I57b8b8cdad50d494c76a008006bd54961170c8bc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2194841 > Commit-Queue: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=courtneygo@google.com,timvp@google.com,syoussefi@chromium.org,jmadill@chromium.org,cclao@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: b/155341891 Change-Id: I8ebe7481b299af446dfd488874e64e6e60b4f764 No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: I8ebe7481b299af446dfd488874e64e6e60b4f764 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2205433 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 8270ebbd 2020-05-08T14:00:18 Vulkan: Refactor and clean up XFB code. This is a refactor-only change mostly. It makes the classes work more similarly to how the other classes in the Vk back-end work. Also removes some redundant code. Moves the buffer caching into begin for a more dirty-bits like approach. Bug: angleproject:4622 Change-Id: I34ac13e1d05b48e3267937c760d195493a76ed02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2191172 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Brandon Schade 8f6d1af9 2020-03-19T14:35:48 Vulkan: Implement EXT_texture_format_sRGB_override Implemented support for EXT_texture_format_sRGB_override This is done by creating new imageviews for textures with sRGB overridden that reinterpret the format to its sRGB counterpart. As preparation for this, textures that use this feature are reallocated with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. This will have a performance cost for textures that use this feature, but should have no performance cost for regular textures, since they will not have this bit set. Bug: angleproject:4561 Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan* Change-Id: Iba25f1f2b0a7227959c1cb4ba6e3ca8311c20d06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2152145 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Michael Spang 11f9c56c 2020-05-11T22:56:18 Vulkan: Tighten up asserts for resource ownership We're not permitted to make accesses to a resource while it's owned by an external instance or API. Add some asserts to verify this. Exempt images on platforms that don't implement external memory barriers. Bug: angleproject:3289 Change-Id: I1de929f6a412bfe5c1b798eaa1dc401bbceb5b7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2195685 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
Charlie Lao 153c14cb 2020-05-11T14:45:35 Vulkan: Try to merge barriers if possible This is try to reduce the number of vkCmdPipelineBarrier API calls into driver. It should not affect the actual barriers. Bug: b/155341891 Change-Id: I57b8b8cdad50d494c76a008006bd54961170c8bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2194841 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Sunny Sun 664376e2 2020-05-09T10:47:48 Vulkan: Fix performance issue c9e0edc2 changed the layerCount in SubresourceUpdate to VK_REMAINING_ARRAY_LAYERS in some cases. So that the deferred clear logic cannot work correctly. Bug: angleproject:4617 Change-Id: Idedada085c618ff900538094412c752522594684 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2191551 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 6b924160 2020-05-07T13:42:48 Vulkan: Split barriers into multiple calls to ensure no extra dependency gets introduced This tracks barriers in an array based on dstPipelineStage. Bug: b/155341891 Change-Id: Icba2ef81530edcdb9ae363b00f0e7b9efe93d48f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2188955 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 234ea5b1 2020-05-05T14:44:30 Vulkan: Wrap barrier data into PipelineBarrier class This is preparation CL without introducing any functional change. This Cl wraps barrier data into its own class and put necessary data structures in place. It still uses one vkCmdPipelineBarrier call. Bug: b/155341891 Change-Id: If9c70d24873bd9b89e598acfba2eeee364f0b6c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185149 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Michael Spang dae210e6 2020-05-04T00:44:16 Fix validation errors & re-enable VulkanExternalImageTest clear tests These tests previously encountered errors attempting to transfer images from VK_QUEUE_FAMILY_EXTERNAL back to itself (this is not valid because one of the queues families in a memory barrier must be the family of the queue that executes the barrier). These invalid transfers were made because our ownership tracking started all resources in the "externally owned" state, with the expectation that the first operation on the resource would be a call to glWaitSemaphoreEXT to acquire ownership. It is far from clear that a call to glWaitSemaphoreEXT is always required to gain ownership of a resource. The EXT_external_objects extension inherits Vulkan's semantics, and what the Vulkan spec says is that the first entity to access a resource implicitly assumes ownership (see 11.7.1 "External Resource Sharing"). Binding a resource to memory does not constitute an access to that resource, or affect its ownership. Allocations should not be accesses, either; they happen at a lower level and the entire discussion about determining initial ownership from first access would serve no purpose if the mere allocation of the underlying memory was sufficient to assume ownership. This patch therefore adjusts the initial queue family ownership of resources created in memory objects to be the ANGLE renderer's queue family, just like a locally allocated image would be. Since this ownership state may not be correct (an external API may have already accessed the image, and assumed ownership) we must relax our assertions to allow a call to glWaitSemaphoreEXT while in this state. For images, this is only permitted while the layout is undefined. An alternative would be to set the initial queue family to a sentinel value that indicates that we don't know, but that would require checking for this value before making any accesses, and only then asserting local ownership. There's no real upside to this; the net effect of the first access rule is that we must effectively assume ownership until proven otherwise. Besides appearing to be the spec's intent, this change simplifies some usage scenarios because a queue submission is not required in the source Vulkan instance in order to allocate resources that will be initially accessed from GL. This seems especially important since there's no mechanism to allocate an external memory object from inside GL. The only downside is that the initial ambiguity in ownership prevents us from diagnosing certain errors, but this limitation is temporary; ownership becomes clear as soon as there is at least one access or at least one synchronization operation affecting the resource. Bug: angleproject:4229 Change-Id: Ibca2bfe373810c55352b1d849d07733d5fcfe5f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2178946 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 562602a3 2020-05-05T12:32:56 Vulkan: Move CommandBufferHelper to vk_helpers.h Pull CommandBufferHelper class out of ContextVk.h/cpp and move it to vk_helpers.h/cpp. This is the natural place for it as it's a helper class. Also, this class is planned to be the interface between the main and worker threads so moving it to vk_helpers makes it easy to share between Context and Renderer. Bug: b/154030403 Change-Id: Ie5eeb864164a3787f800905ae885027834bd1a08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2182177 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill d657e1d7 2020-04-24T13:13:18 Vulkan: Defer framebuffer clears. This works by storing the deferred clears in the ImageHelper's staging buffers. We apply the deferred clears onto the RenderPass right before we begin to draw. Storing the clears in the ImageHelper solves problems where we clear GL Textures in a Framebuffer and then unbind the Textures and sample from them. Or do other commands like CopyTexImage. Note that because the staging buffer clears only handle full-image clears we need to immediately apply some scissored clears where before we would use the RP. This should be a pretty rare occurrence and it is possible to optimize that in the future. Reduces the RenderPass count in the Manhattan "frame 10" trace from max 22 to max 20. May improve perf slightly on Android or may have effects too small to measure. Should not regress performance. Bug: angleproject:4517 Change-Id: I02150d531022afb903f1058f070937ec6337bd88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2142711 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 2ad30d7a 2020-05-04T16:14:22 Vulkan: honor compressed texture block width/height When a texture's base or max mipmap level is changed, ANGLE creates a new VkTexture (and potentially copies lots of data old->staging buffer->new). However, ANGLE wasn't looking at the texture's format, and for a compressed format ANGLE wasn't looking at/using the texture format's compressed block width and height. Bug: b/155499736 Change-Id: I11a12028aee998fa23d503c2c0db39fbb49ae6ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2180881 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Geoff Lang c9e0edc2 2020-04-30T14:48:40 Handle 3D texture entire-mip initialization for FBO attachments FramebufferAttachmentObject::initializeContents clears the entire mip level for layered textures (not including cube map). This was done by special casing 2D array and 2D multisample array textures but did not work for 3D. Generalize the logic to work for all layered texture types. Handle clearing the entire 3D texture mip in Vulkan. TEST=conformance2/misc/uninitialized-test-2.html BUG=angleproject:4602 Change-Id: I35bb9fc3304f0553e8de68d205b0843845bf7549 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174264 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Tobin Ehlis 428e4415 2020-04-27T12:27:00 Vulkan: Migrate trace events and occlusion queries Moved GPU trace event and occlusion query commands that were on the primary command buffer to the SecondaryCommandBuffer (SCB). Putting these commands on outside render pass SCB and flushing those commands to primary on-demand as needed to maintain ordering of commands. For resetQueryPool command used by occlusion query, allow the SCB to queue up that command for inside RenderPass SCB. This avoids ending a renderPass prematurely and allows all outstanding reset commands to be executed before the beginRenderPass command since the resets must occur outside of a renderPass. This is groundwork to simplify the hand-off of SCBs from the main thread to a worker thread. Long-term we'd like a single SCB that can handle both inside and outside renderPass commands at the same time to pass to the worker thread for processing into a primary CB. Bug: b/154030403 Bug: angleproject:4603 Change-Id: Ic1023ae27a9b14435743549ea9933edf1c4b318b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168114 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Charlie Lao df31624e 2020-04-30T13:28:24 Vulkan: Reduce the onBufferRead/onBufferWrite API verbosity a bit This adds helper functions to handle common use case for onBufferRead and onBufferWrite to reduce the API verbosity a little bit. Also fix the transform feedback bug that we are passing in wrong access/stage flags when it is emulated by vertex shader. Bug: b/155122200 Change-Id: Id2549ca00cad184a90c6230dc3665aaff44dda08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174265 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao f07d0072 2020-04-27T16:51:05 Vulkan: use fine grain stage for buffer barriers We are using VK_PIPELINE_STAGE_ALL_COMMANDS_BIT for mGlobalMemoryBarrierStages, which is used for both src and dst. This will cause a full pipeline stall whenever a buffer object introduces a barrier. This CL will let the caller pass in the specific stage it will be used for, allowing us to track write and read stage dependencies separately and request the corresponding barriers. Bug: b/155122200 Change-Id: I8b8bd291a03b77d07cfbcbe7c3cda2d3771588b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2169014 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Schade fa03eb9d 2020-02-05T15:25:52 Vulkan: Use DynamicBuffer for BufferVk When there is glBufferData API call, if the current VkBuffer is in use, we copy to a staging buffer to be gpu copied later. Instead of doing this second copy, write directly to a new buffer that will be used for subsequent gpu operations. BufferVk now has a DynamicBuffer to handle the logic of acquiring a new/free buffer to be used. Bug: angleproject:4380 Change-Id: I207f334013ae944090eb48c26c692a09e8815f74 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040513 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Alexis Hetu 6e7d7296 2020-04-24T15:40:57 Fix clearing compressed textures with Vulkan backend When making sure a texture's data is initialized in ANGLE, it is illegal to attempt to clear it when using the Vulkan backend. The Vulkan spec, regarding vkCmdClearColorImage, mentions that: "image must not have a compressed or depth/stencil format" The proper way of initializing the memory of a compressed image in Vulkan is to do a buffer to image copy instead. This was added to ImageHelper::stageRobustResourceClear() so that it may now handle compressed textures properly. Bug: angleproject:4092 Change-Id: I073ed0603d9e92e787b9be8992751dbc0c8978db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165636 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Jamie Madill 35e389cc 2020-04-24T13:33:36 Vulkan: Remove unicode character from error string. Will fix presubmit checks on Windows. Bug: angleproject:4586 Change-Id: I36cec3e850c88a015f33d8a0bb7cc8f8c26402d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165628 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 21c5af31 2020-04-20T10:29:13 Vulkan:Migrate events and queries to secondary Cmd Buffer Replace flushAndGetPrimaryCommandBuffer() function with endRenderPassAndGetCommandBuffer() for events and queries. The end result should be the same, but this allows a number of places that were putting commands directly into the primary to put the commands into ANGLE's custom SecondaryCommandBuffer (SCB) instead. This also fixes a couple of minor bugs related to command buffer ordering. flushAndBeginRenderPass() now flushes any outside RenderPass (RP) commands first. Also, when insideRP commands are flushed to the primary, set "mHasPrimaryCommands = true;" Bug: b/153666475 Change-Id: I68413f25d27175afed0a20bc49f22f4c8d01e4fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2156932 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill 492ec932 2020-04-21T13:38:41 Vulkan: Track allocated sampler counts. Helps to diagnose perf bugs where resources are over-allocated. Also can be useful to evaluate caching strategies. Bug: angleproject:4517 Change-Id: I48df5a09fbc394fa0b1712fa8cf28a179665e6e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159293 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Mohan Maiya b7d6949b 2020-04-17T13:36:14 Vulkan: Enable persistently mapped buffer objects The VMA allocator has a handy feature where during memory allocation we can request persistently mapped memory. This saves IOCTL overhead for apps that update buffers frequently. Bug: angleproject:2162 Change-Id: I870d880033beec343efae6de06f1c5935de4c2c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2155131 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill 4d10efbc 2020-04-15T15:14:11 Vulkan: Store ImageType in ImageHelper. We ended up needing this to recover the image type in the RenderTarget. Otherwise we don't have direct access to this information in the FramebufferVk sync state code. Bug: angleproject:4517 Change-Id: I387947e0b7394e1f63f313dd4792bb042b8da73a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2151170 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 8c67c079 2020-04-16T14:42:15 Vulkan: store ImageLayout in PackedAttachmentOpsDesc The layout in the PackedAttachmentOpsDesc only have 5 bits, not enough for raw VKImageLayout enums. This change will store vk::ImageLayout which are ANGLE defined and packed for 5 bits and able to handle the extension bits of VKImageLayout. Bug: b/153885625 Change-Id: Ida268a974094188d8aeee39c61019eef30a60507 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2153845 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill aefa3aa9 2020-04-15T14:27:12 Vulkan: Make staged clears store aspect mask. This will allow us to store depth- or stencil-only clear when we defer clears in FramebufferVk syncing. Currently a refactoring change only. Bug: angleproject:4517 Change-Id: Ifc9bf8f9ebab993509155cf6cf66db5b11f35163 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2151169 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Hyunchang Kim 6e0d718a 2020-03-31T18:41:57 Vulkan: Implement device memory sub-allocation Use AMD Vulkan Memory Allocator for device memory sub-allocation. We now have a mempool from which all glBuffer memory is allocated. The CPU overhead involved in repeated IOCTL calls to the kernel is reduced significantly. Bug: angleproject:2162 Change-Id: Id7681ffe2ac3d2853141ebe34c7df7b7fdd0d55e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2124519 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Tim Van Patten 405f8e7b 2020-02-24T17:38:10 Vulkan: Support Program Pipeline Objects Add support for PPOs to the Vulkan back end. Bug: angleproject:3570 Change-Id: I5403456929847c185467b008d810f31ecfcb60cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2072652 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 2a0c3596 2020-03-31T15:36:45 Vulkan: Clean up robust and emulated image clears. This change consolidates image clears in multiple places into a single site in ImageHelper initialization. It adds support for appending clear image commands as well as prepend (the default). We prepend clears because image initialization happens after data upload. The Vulkan robust clear path now works like the other back-ends. The change flushed out a bug where partially uninitialized CopyTexImage was not correctly initializing a texture before triggering a full resource clear. Texture::copyImage now uses a workaround where we first init the image before clearing it. After the init we upload the new data. We'll use the appending clears path when implementing deferred clears. Bug: angleproject:4517 Change-Id: If9212f3b8cdd0fc8b7e729d364530801a644e164 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2130627 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill a30c6f35 2020-04-07T11:25:20 Vulkan: Pass RendererVk to BufferHelper::destroy. Bug: angleproject:2162 Change-Id: I7c0090d48b0a5bac222b1edf4c2db280d5b32930 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2139993 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Nico Weber a053f340 2020-04-01T16:58:16 Vulkan: Use shader stage specific barrier Followup fix for copy/paste error that ImageLayout::GeometryShaderReadOnly was using VK_PIPELINE_STAGE_VERTEX_SHADER_BIT Bug: angleproject:4467 Change-Id: I5be7f800177c4f36a334f1cc75f876e271ca22b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133089 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 745e0712 2020-03-21T17:46:05 Vulkan: Enable CPU only buffers for PBOs Add support for a CPU only buffer for PBOs that serve as the destination for all host operations like MapBuffer*. This removes the latency caused by waiting for the in-flight GPU commands to be complete before handing over the buffer to the app. This change removes a ~6ms wait/sleep on the first call to MapBuffer* in each frame of Manhattan Bug: angleproject:4339 Tests: angle_end2end_tests --gtest_filter=BufferDataTest*Vulkan Change-Id: I52016b160af8a670cc30f01c05e48f699521310f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2116874 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 20e375eb 2020-03-14T20:27:09 Vulkan: Use shader stage specific barrier Seperate vertex and fragment shader read/write with shader stage specific barriers Bug: angleproject:4467 Change-Id: Id18909b497b087e58d750023399943bc9d414edf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102957 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 6328caf3 2020-03-24T19:31:02 Vulkan: Avoid renderpass break for occlusion query This ensures beginQuery and endQuery only get inserted into renderpasses and will not close renderpass because of query call Bug: angleproject:4381 Change-Id: I690f096b9e8e4b7ea9a67045d1be0fd7a319c98c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2119246 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill db32bda4 2020-03-30T17:01:54 Vulkan: Observe staging buffer changes in TextureVk. This switches where we notify the Texture class that the back-end has a dirty staging buffer. Previously we notified in every possible code site in TextureVk. Now we notify in a single centralized location in the staging buffer. This will allow us to stash clears in the staging buffer in the FramebufferVk class via RenderTargetVk. And ultimately let us defer clears to fix Manhattan's rendering feedback loop. Bug: angleproject:4517 Change-Id: I67760f133e2c58feddbba3d1062de0b966bac281 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2128546 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexis Hetu b83b0f5e 2020-01-31T15:09:17 Add support for NV_read_depth, NV_read_stencil and NV_depth_buffer_float2 extensions This cl adds the ability for the ReadPixels function to read other attachments than the color attachment. Checks were added for both depth and stencil attachments. A new test was added (DepthStencilFormatsTest.DepthStencilReadback) to test this new functionality. As the name mentions, it's used to test reading from the depth and stencil attachments using ReadPixels. Bug: angleproject:4295 Change-Id: I6fe9be11f05d6055a5883b4315f870e7c0ac41ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031702 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop dfae826d 2020-03-01T16:07:49 Capture/Replay: Update getTexImage for depth/stencil and 3D 3D support based on work from ancheng.qiao@arm.com. Test: Manhattan mid-execution capture working Bug: angleproject:4058 Bug: angleproject:4091 Change-Id: I7f8b8542fbc1f3484a2451850db0dc752c0b8906 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2070899 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Ancheng Qiao 90019cea 2020-02-26T18:04:25 Vulkan: Add depth to mipmap generation In generateMipmaps, remove hard coded depth of 1, shift depth like every other dimension. Remove MipmapsForTexture3D test pixel value check, in es spec3.2 8.14.4 "No particular filter algorithm is required, though a box filter is recommended." It's implementation-dependent. In current angle implementation, will choose VK_FILTER_LINEAR/VK_FILTER_NEAREST according to vkdeice support. Bug: angleproject:3983 Test: MipmapTestES3.MipmapsForTexture3D/ES3_Vulkan Test: dEQP-GLES3.functional.samplers.single_tex_3d.diff_max_lod Test: dEQP-GLES3.functional.samplers.single_tex_3d.diff_min_lod Test: dEQP-GLES3.functional.samplers.multi_tex_3d.diff_max_lod Test: dEQP-GLES3.functional.samplers.multi_tex_3d.diff_min_lod Change-Id: I5e73f8c743053aeb521b5e0b3e372bbe77e57ad2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2076740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Xiaoxuan Liu f8b28678 2020-02-26T19:12:39 Vulkan: Add support for VK_EXT_index_type_uint8 Enable VK_EXT_index_type_uint8 Vulkan extension if supported by VkDevice. Bug: angleproject:4405 Change-Id: I84d030497898c5944a36d9a88a31e7377ccd5e9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2082391 Commit-Queue: Xiaoxuan Liu <xiaoxuan.liu@arm.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b84969ad 2020-02-29T09:14:36 Vulkan: Use QueryHelper for internal GPU timing. This cleans up the code. Using QueryHelper means we don't need to duplicate the timestamp query/result code. It also means we don't need special allocate/free functions in DynamicQueryPool. Done while investigating timing GPU events for T-Rex. Bug: angleproject:4433 Change-Id: I8512a5618e1dd00956942ae2d12d46d8193c4e51 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2081379 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a1e5f582 2020-02-29T08:01:16 Vulkan: Clean up QueryHelper uses. Makes the wrapper classes take boxed query handles. Also cleans up some repeated code patterns. It also encapsulates the QueryHelper class more so that the pool indexes and handles are hidden from the user of the class. Fixed while working on GPU trace event timing. Bug: angleproject:4433 Change-Id: Ib6cba9c52ec956ebede9b411b70261ea5b877d7d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2081378 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Xiaoxuan Liu b07816d6 2020-01-02T15:13:37 Vulkan: Add robust init for NULL texture image. In gl::ReadPixels(), ValidateReadPixels() will try to flush staged updates before readPixels. In the case where a texture was initialized with null RGBA data, no Framebuffer dirty bits are set, and thus the staged clear would never be flushed from the staged updates. 1. Add robust init in TextureVk::initImage to ensure image is initialized. Test: ./angle_end2end_tests --gtest_filter=\ RobustResourceInitTest*_Vulkan_AllocateNonZeroMemory 2. Update stageSubresourceRobustClear() to kEmulatedInitColorValue in the case where robust resource was initialized without full RGBA format to update init value of robust resource. Test: texture-attachment-formats.html in webgl_conformance_vulkan_passthrough_tests. 3. Revert "Suppress Vulkan RobustResourceInit tests." Revert commit a8e6a463121b9920564fb6efd7f2c857d7023fe3. Reason for revert: re-enable related robust tests. Bug: angleproject:4255 Change-Id: I79f20e0c02c2f1b1cd68ab590f0f765229f9e780 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1985503 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 916d204c 2020-02-25T14:18:38 Vulkan: Use new APIs in BufferHelper::copyFromBuffer. We shouldn't need to special case the barrier logic in this function any more. Instead use the 'onBufferRead' and 'onBufferWrite' APIs. Bug: angleproject:4029 Change-Id: I7f67b67aa312d9ae64172b40d73086b7772d49d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071143 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 660c0dd6 2020-02-25T13:30:33 Vulkan: Fix padding out Buffer allocations on AMD. We would often pad incorrectly given the constraints of the max stride. We shouldn't really be rounding up the buffer size, but we should instead be adding the max alignment size to the end of the buffer. Bug: angleproject:4428 Change-Id: Id2afc572c85985548a18f60b42cdc388d83d5c4c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071235 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 5b7ce876 2020-02-25T09:52:05 Vulkan: Update buffer accumulation TODO bug IDs. Bug: angleproject:4029 Bug: angleproject:4429 Change-Id: Ice4ae48a92e376ea916f05d1433a68f3accc09d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071145 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill aa09ca69 2020-02-24T13:33:30 Vulkan: Update ContextVk command buffer access methods. Use the following names: - flushAndBeginRenderPass - endRenderPassAndGetCommandBuffer - flushAndGetPrimaryCommandBuffer This clarifies that a flush is part of the method. Bug: angleproject:4029 Change-Id: I6c870761339ea7aa39c83142200781ba39ad6a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2068129 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill a741abb9 2020-02-21T16:37:37 Vulkan: Rename CommandGraphResource to Resource. Also renames the h and cpp files to ResourceVk (to keep distinct from other resource.h/cpp files) and renames 'onResourceAccess' to 'retain'. Cleans up a few remaining mentions of the command graph in comments. Bug: angleproject:4029 Change-Id: Ifc8e880c8cea3fc48a4aec4730191c88aa35a076 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill c58458e6 2020-02-19T14:51:41 Vulkan: Remove CommandGraph code. Also updates relevant comments to no longer refer to a graph. Bug: angleproject:4029 Change-Id: Ic29716e9ae4926870f902947d49d8fee7af98662 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057804 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill ce4918f1 2020-02-19T09:39:44 Vulkan: Sanitize Images & Buffers with non-zero values. Only enabled for specific tests at the moment. This CL allows our tests to sanitizes memory for the robust resource access extension. It is quite slow so should not be enabled by default. Only works for 1 level 2D color textures and buffers. Makes several flaky robust resource initialization tests consistently fail. Controlled via an angle::Feature in FeaturesVk. It works by initializing memory to an abitrary non-zero value: - if newly allocated memory is mappable, we map it in init and set it - if a buffer or texture can be a transfer destination, we use a staging resource - otherwise we don't attempt to initialize the resource. Bug: angleproject:4384 Change-Id: I9b4f347bfcddf3096f491ed0243bef86837feaa0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2043271 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tobin Ehlis cf2ec3b1 2020-01-31T16:55:50 Vulkan:Add FramebufferVk cache This adds a FramebufferVk cache. Cache signature is based on unique Serial values that are assigned to ImageHelper objects backing all color and DS rendertargets as well as level/layer values unique to the imageView. Update the Serials and cache signature at FramebufferVk::syncState() time. L0 cache is a currently active framebuffer. L1 cache retrieves previously created framebuffer from new cache. If neither of those hit, create new FramebufferVk and add to L1. Bug: angleproject:4322 Change-Id: I3f585271798ddfb9e5f194020adca8cf8a6b19dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033869 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 3c066404 2020-02-05T12:43:12 Vulkan: Command graph linearization (Step 4). Implements GLES 3.0 functionality for the new command recording style. Tested with angle_end2end_tests. dEQP/CTS testing will come later. Bug: angleproject:4029 Change-Id: Ibdc4f1355a7b880946699ec227fd9807f4a27af9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040197 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8257ac30 2020-02-07T14:17:08 Vulkan: Defer RenderPass image barriers. We accumulate image barriers in two places: * for GL sampler textures * for GL framebuffer attachments (Render Targets) Then we issue the barriers together in a single call before the RP. This fixes a bug where we were missing a layout transition in some cases when transitioning between a sampler and a render target. It should also be faster to issue a single barrier before a RP than issue several smaller barriers. Bug: angleproject:3539 Bug: angleproject:4029 Change-Id: I180b770f0df6b44d209e5c618ba36bcc1c6372e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2044236 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop e02f4996 2020-02-06T12:26:07 Vulkan: Pass correct level count in getLevelDrawImageView This bug was hit by a KHR ES 3.1 test. This CL just applies the obvious fix already noted by jmadill@. Test: KHR-GLES31.core.shader_image_size.*-nonMS-* Bug: angleproject:4008 Bug: angleproject:4108 Change-Id: I5d05c0a7432f7b70d2b995fd8b11224c119ece5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2042491 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 25b7b846 2020-02-05T10:22:18 Vulkan: Command graph linearization (Step 3). Implements queries with the new command graph syntax. The T-Rex capture benchmark uses queries so this fixes several errors. Bug: angleproject:4029 Change-Id: Ia785f8e31257116aa3c75032dd66471b49926a78 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2021003 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 20b1259a 2020-02-05T17:08:05 Vulkan: Command graph linearization (Step 2). ES 2.0 is feature complete. Passes all of the angle_end2end_tests with the new linear command recording method. Also runs the T-Rex benchmark without any obvious glitches. Likely has issues with creating too many RenderPasses. ES3 is mostly untouched. Bug: angleproject:4029 Change-Id: Ic5acf3d768495fbffd07b07bf0a6f2b5787c51f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2012900 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3712b2e4 2020-01-24T17:08:30 Vulkan: Command graph linearization (Step 1). This initial prototype introduces a new feature to the Vulkan back-end that disables the deferred command recording. The intent is to have a lower CPU overhead during submission calls which currently walk a DAG. The feature is not complete. Currently it only passes the ANGLE SimpleOperationTests. Moreover it is extremely simple and only allows use of one command buffer at a time. In the future we'll allow open command buffers for recording outside and inside render pass commands at the same time. We'll also support collapsing RenderPasses together for some use cases. Currently the prototype only passes "SimpleOperationTest". There are quite a few unimplemented features like queries, XFB, etc. Bug: angleproject:4029 Change-Id: I82760986683f55e37ac4ea559de6f4cffb6ef84e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953485 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi b36e46ab 2020-01-08T15:49:18 Vulkan: Line raster emulation through specialization constant In preparation for compiling shaders early at link time, this change reworks line raster emulation such that it uses specialization constants instead of a preprocessor condition. This means drawing both triangles and lines with this program will still result in a one-time shader compilation. The compilation is still done at draw time in this change. Bug: angleproject:3394 Change-Id: I0bf91398868d7f7147456533b728906b505192b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1992365 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 579c5940 2020-01-17T13:20:21 Vulkan: Rename onGraphAccess to onResourceAccess. Clarifies the function for the upcoming command graph linearization. Bug: angleproject:4029 Change-Id: Ib50997c007053757de533f69c155a92d7555e0b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003235 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 09a2d065 2020-01-17T13:20:20 Vulkan: Clean up naming of ResourceUse checks. Instead of referring to command graphs we can refer to if the resource is in use by "ANGLE" or the "Driver". This will make the methods more consistent when we switch away from the command graph. Bug: angleproject:4029 Change-Id: I3045a4eb2a38234ef331c0662694656065590ae1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003234 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 441b72f0 2020-01-16T14:48:39 Vulkan: Make ContextVk own ResourceUseList. This moves the resource use tracking functionality out of CommandGraph. Making the list a separate class helps the implementation avoid tricky circular include problems. Bug: angleproject:4029 Change-Id: I3288fc685b21e949f12b0796109a2b7bb117c249 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002931 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4ff1651e 2020-01-16T12:42:27 Vulkan: Add ResourceUseList helper. This abstracts away the ResourceUse tracking from CommandGraph. Pulling it out will allow us to more easily swap resource use tracking into ContextVk. The command graph is eventually going away so we need to move functionality out of CommandGraph. Bug: angleproject:4029 Change-Id: Icc3bcc824510b03e91f8ff010a82751a81516bfa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002930 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 6b275406 2020-01-09T11:14:47 Vulkan: Workaround vertex attributes vs stride issue on AMD Under robustBufferAccess, Vulkan states that: Vertex input attributes are considered out of bounds if the offset of the attribute in the bound vertex buffer range plus the size of the attribute is greater than either: - vertexBufferRangeSize, if bindingStride == 0; or - (vertexBufferRangeSize - (vertexBufferRangeSize % bindingStride)) The latter implies that if the buffer size is not a multiple of the vertex attribute stride, what lies beyond the last multiple of stride is considered out of bounds. It also says: Out-of-bounds buffer loads will return any of the following values: - Values from anywhere within the memory range(s) bound to the buffer (possibly including bytes of memory past the end of the buffer, up to the end of the bound range). - Zero values, or (0,0,0,x) vectors for vector reads where x is a valid value represented in the type of the vector components and may be any of ... The first bullet point indicates that the driver is allowed to load the attribute values from the buffer if its range still lies within the buffer size. Take the following example: - Buffer size = 12 - Attribute stride = 8 - Attribute offset = 0 - Attribute size = 4 Basically the buffer is thus laid out as follows: attr stride _________/\_________ / \ +----------+----------+----------+ | vertex 0 | padding | vertex 1 | +----------+----------+----------+ \___ ____/ V attr size In the above example, the attribute for vertex 1 is considered out of bounds, but the driver is allowed to either read it correctly, or return (0, 0, 0, 1) for it. Most drivers implement the former, while AMD implements the latter. This change introduces a workaround for AMD where GL_MAX_VERTEX_ATTRIB_STRIDE is limited to 2048 (the common value for it according to gpuinfo.org) and conservatively rounds up every buffer allocation to that size. While technically, this workaround should be applied on any device with the robustBufferAccess feature enabled, it is currently limited to AMD to avoid the inefficiency. A possible future revision of Vulkan may relax the above restrictions. Bug: angleproject:2848 Change-Id: Ida5ae5d777da10f22ce8be5a09a7644b5bbd778e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1991709 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Ian Elliott 4576f1d0 2019-12-05T10:10:48 Vulkan: Implement multisample textures This functionality is exercised by running angle_deqp_gles31_tests with the following sets of command arguments: --gtest_filter=dEQP.GLES31/functional_texture_multisample* --use-angle=vulkan --gtest_filter=dEQP.GLES31/functional_state_query_texture_level_texture_2d_multisample* --use-angle=vulkan --gtest_filter=dEQP.GLES31/functional_state_query_texture_texture_2d_multisample_texture_immutable* --use-angle=vulkan The following are some high-level design notes: - Texture::setStorageMultisample() handles converting the "requested number of samples" to the actual number of samples used (e.g. converting 3 to 4), supported by the underlying back-end). The actual number used is stored in gl::TextureState::mImageDescs, for use by other GLES commands. - ANGLE uses the Vulkan standard sample locations/positions. If the underlying Vulkan driver's VkPhysicalDeviceLimits::standardSampleLocations is false, ANGLE limits itself to GLES 2.0 (i.e. before GLES 3.0 which adds multisample renderbuffers). - The Vulkan specification currently doesn't support ANGLE providing support for GLES 1-sample textures, because of the following Vulkan specification statement: - If the image was created with VkImageCreateInfo::samples equal to VK_SAMPLE_COUNT_1_BIT, the instruction must: have MS = 0. - At least one Vulkan driver returns different VkPhysicalDeviceLimits::*SampleCounts for different formats. Because of this, ANGLE does a logical-AND of all values in order to only support the commonly-available numbers of samples. The detailed design document is located at: https://docs.google.com/document/d/1NiM8gAR74iGGXGTE6IP1ChdDUZjhtXRuJdtEp_wGFEM/edit?usp=sharing Bug: angleproject:3565 Bug: angleproject:4103 Bug: angleproject:4104 Bug: angleproject:4196 Bug: angleproject:4197 Bug: angleproject:4198 Change-Id: I28921badf9568427799b0af347198b5df06c2db0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919982 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 61c6aecc 2019-11-28T14:30:18 Vulkan: Fold read access into write flags on buffer writes This could lead to a subtle bug: Say we use a buffer as a storage buffer and write to it. We then must issue a memory barrier before using it as a uniform buffer. However we would set the SHADER_READ bit as a read mask on a storage buffer access. This seems like it could lead to a missing barrier. Bug: angleproject:4178 Change-Id: I486002739b7fb000ffacc0a1e996784b7875e7ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1943034 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 62a93045 2019-12-02T15:19:15 Vulkan: Fix WaW same-layout image transitions These transitions were incorrectly handled by an execution barrier alone, but that's not per spec. Write-after-write hazards always need a memory barrier. Bug: angleproject:3347 Bug: angleproject:3554 Change-Id: Id2d2579888e0b59e589fcdd52416363f2cf5cf97 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1943546 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9601a548 2019-11-23T23:44:52 Vulkan: implement external semaphore barriers glWaitSemaphoreEXT and glSignalSemaphoreEXT functions optionally request buffer and image barriers to be performed by the implementation. If any barriers are present, a single global memory barrier is inserted to take care of memory accesses. In both functions, buffer and image memory barriers are used to perform queue ownership transfers to ANGLE's queue (glWaitSemaphoreEXT) or the EXTERNAL queue (glSignalSemaphoreEXT). In glWaitSemaphoreEXT, the given layouts are information regarding how the external entity (the caller) has modified the images' layouts, and is used to update ANGLE's internal state tracking. Bug: angleproject:3289 Bug: 1026673 Change-Id: Ic478a8813df727c89413c8ae2adf42b5c1d06069 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1933016 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Jamie Madill fc3ec57d 2019-11-27T21:43:22 Reland "Vulkan: Accelerate Texture PBO updates" This reverts commit 27d3c9399925d23726880ef910b9068fa39307cf. Reason for revert: Investigation is unable to reproduce the regresion. Shows up on the perf CI. Original change's description: > Revert "Vulkan: Accelerate Texture PBO updates" > > This reverts commit efb45edaefc07fc7120ebbde83bbc84876afda1a. > > Reason for revert: Significant perf regression on several benchmarks. > See bug for more details. > > Bug: chromium:1027098 > > Original change's description: > > Vulkan: Accelerate Texture PBO updates > > > > If the format of the image and the PBO match, > > use a vkCmdCopyBufferToImage transfer operation. > > > > Test: angle_end2end_tests --gtest_filter=*PBOCompressedSubImage* > > angle_end2end_tests --gtest_filter=*PBOWithMultipleDraws* > > dEQP-GLES3.functional.texture.specification.tex*image*d_pbo* > > Bug: angleproject:3777 > > Change-Id: I3f271024a635be113202a16f8893a199c194172d > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1906203 > > Reviewed-by: Cody Northrop <cnorthrop@google.com> > > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > > TBR=cnorthrop@google.com,syoussefi@chromium.org,jmadill@chromium.org,m.maiya@samsung.com,b.schade@samsung.com > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: angleproject:3777 > Change-Id: I774655962e9ab5a866b9324002fb8edae8550834 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939927 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,syoussefi@chromium.org,jmadill@chromium.org,m.maiya@samsung.com,b.schade@samsung.com Change-Id: I8560a2e70de230eac3256a1df5eb2ecaa6f26bcf No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1027098, angleproject:3777 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939852 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 27d3c939 2019-11-27T11:39:41 Revert "Vulkan: Accelerate Texture PBO updates" This reverts commit efb45edaefc07fc7120ebbde83bbc84876afda1a. Reason for revert: Significant perf regression on several benchmarks. See bug for more details. Bug: chromium:1027098 Original change's description: > Vulkan: Accelerate Texture PBO updates > > If the format of the image and the PBO match, > use a vkCmdCopyBufferToImage transfer operation. > > Test: angle_end2end_tests --gtest_filter=*PBOCompressedSubImage* > angle_end2end_tests --gtest_filter=*PBOWithMultipleDraws* > dEQP-GLES3.functional.texture.specification.tex*image*d_pbo* > Bug: angleproject:3777 > Change-Id: I3f271024a635be113202a16f8893a199c194172d > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1906203 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> TBR=cnorthrop@google.com,syoussefi@chromium.org,jmadill@chromium.org,m.maiya@samsung.com,b.schade@samsung.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:3777 Change-Id: I774655962e9ab5a866b9324002fb8edae8550834 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1939927 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 5b2740c5 2019-11-22T11:55:25 Vulkan: Remove unnecessary barrier in image -> buffer copy There was already a changeLayout call that inserted an imageBarrier. A TRANSFER_SRC to TRANSFER_SRC barrier was unnecessarily (and manually) added afterwards that was pointless. Bug: angleproject:3816 Change-Id: I8177487fc843fa5869c7b5063c74602933a81d58 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929270 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Sunny Sun <sunny.sun@arm.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Ethan Lee a825eb70 2019-11-21T11:37:17 Implement BaseVertex draw calls for Vulkan, OpenGL, NULL contexts. This adds support for the following functions: - glDrawElementsBaseVertex - glDrawRangeElementsBaseVertex - glDrawElementsInstancedBaseVertex Bug: angleproject:3582 Bug: angleproject:3402 Bug: angleproject:4166 Change-Id: I83770f62e3a918c0965fd4ca8c7d9e598b8b4154 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929083 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Brandon Schade efb45eda 2019-09-24T09:23:53 Vulkan: Accelerate Texture PBO updates If the format of the image and the PBO match, use a vkCmdCopyBufferToImage transfer operation. Test: angle_end2end_tests --gtest_filter=*PBOCompressedSubImage* angle_end2end_tests --gtest_filter=*PBOWithMultipleDraws* dEQP-GLES3.functional.texture.specification.tex*image*d_pbo* Bug: angleproject:3777 Change-Id: I3f271024a635be113202a16f8893a199c194172d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1906203 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Tobin Ehlis 16da9515 2019-11-04T11:19:14 Vulkan:ImageHelper read combined DS textures Update ImageHelper to be able to copy both the depth and stencil aspects of a DS image to a buffer. The aspects are copied separately with the depth data preceding the stencil data. This allows dEQP-GLES31.functional.stencil_texturing.misc.base_level test to pass. Added exception for ANDROID VULKAN where test still fails and new tracking bug (4080) for this case. Bug: angleproject:3949 Bug: angleproject:4080 Change-Id: Ib6104d7fa9f516154131f3e82161078ba216cfe1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897649 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill 422ebad2 2019-10-31T16:02:48 Fix ANGLE_get_image cube map handling. Was missing a layer parameter. Also includes a regression test. Also updates incomplete texture handling in Vulkan. Will try to sync the texture storage if the texture has never been used. Bug: angleproject:3944 Change-Id: I5fcd6931f9cb9e008faaeaecb1f6df275a2af73f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1894142 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill bb35bb4e 2019-10-29T17:17:04 Vulkan: Implement simple case ANGLE_get_image. A couple cases are left unimplemented: Incomplete/unused Textures. This leads to a slightly more tricky implementation. Since we need to read back from the staging buffer we will need to flush the Image contents to a temporary buffer. Depth/stencil readback. Requires a more complex pixel packing step. 3D/Cube/2D Array readback. Also requires a more complex packing step. Bug: angleproject:3944 Change-Id: Ic5d9a606177ba7e3e5ab945feb5f555afa11741f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879964 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill e7852798 2019-10-28T13:51:43 Vulkan: Clean up redundant vk:: prefixes. Were in a lot of places in vk_helpers. Bug: angleproject:3944 Change-Id: I8635400d6debb7ed92e3cf84993773ca9ed74285 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879963 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 96ba0f12 2019-10-28T13:51:42 Vulkan: Move readPixels logic to ImageHelper. This logic will be shared with ANGLE_get_image. Cleans up some of the graph access logic so it can work easily with TextureVk/RenderbufferVk. Bug: angleproject:3944 Change-Id: If069528f27b2c291d52de892c707562875b95227 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879962 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill a6206854 2019-10-24T12:55:09 Enable "-Wmissing-field-initializers". This is another warning required by Skia. This one didn't find anything that surprising. Enabling the warning does help enforce code consistency and avoids a bit of possible undefined behaviour. Bug: angleproject:4046 Change-Id: Ifec7f4afad49cd820bf3c0a79df3f46559473ee2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877477 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinyi He 052167bc 2019-08-13T14:09:04 Vulkan: Mipmap is unconditionally enabled in ANGLE ANGLE always enables the Mipmap. The fix does redefining the image with mipmaps and replace the origin one only when it is necessary. Bug: angleproject:3737 Change-Id: Ia33a16fd7feae303fb114988059c4eec58c4232d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750627 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jamie Madill 1efcbdb6 2019-10-22T12:32:04 Vulkan: Fix sampler object lifetime. Using the same scheme as we do for VkImageViews we can track VkSampler lifetime using SharedResourceUse. This fixes the race condition that could occur when samplers are deleted in one Context while being used in another. This fixes the last known resource lifetime issue. The multithreading tests should now pass without validation errors. Also adds regression tests to angle_end2end_tests. Bug: angleproject:2464 Change-Id: I9dbed5062a0863b240ddf1a9b5d28560334934de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869548 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 68591eff 2019-10-13T15:05:23 Vulkan: Store ImageView access in the graph. This will ensure we don't destroy the image views when they are still in use by other Contexts. Bug: angleproject:2464 Change-Id: I1d3ba2ad241250e31ea32873446c4cb23971750d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1843236 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill beacd8c8 2019-10-17T14:34:02 Vulkan: Rename format fields. Renames 'angleFormat' to 'intendedFormat'. Also renames 'bufferFormat' and 'imageFormat' to 'actualImageFormat' and 'actualBufferFormat'. This renaming should make it clearer to the reader what the meaning of the different format fields are. Intended format is the front-end format and the actual formats are the formats we pass to Vulkan. Also updates the documentation. Bug: angleproject:4009 Change-Id: If61bf7250e88f7ed3d452718574c963d718e27b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866077 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 7f418fc2 2019-10-01T07:56:53 Vulkan: lineloop support for DrawArrayIndirect Add support for lineloops. Includes a compute shader for generating an index buffer to draw lineloop. Instancing turns out to be a special case for indirect draws if we have vertex attributes that need to be emulated (e.g. divisor too large or native vertex format not available). Test: dEQP.GLES31/functional_draw_indirect_* angle_end2end_tests --gtest_filter=LineLoopIndirectTest.*/* dEQP.GLES3/functional_draw_* Bug: angleproject:3564 Change-Id: I1fdabe2c8a690c8b6df9e252e1e839e08796bcca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1834682 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0b9ebe58 2019-10-15T11:15:42 Vulkan: Add "ImageViewHelper". This allows views to track a different lifetime than vk::ImageHelper. This in turn will fix the race condition on ContextVk destruction when releasing ImageViews owned by TextureVk and RenderbufferVk. For now this is a refactoring change only. Bug: angleproject:2464 Change-Id: I9581975bd5d4913233bbed8439dd4a632cc78a2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1843231 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Tobin Ehlis bbf0ce28 2019-10-11T06:55:36 Vulkan:Add support to stage D or S textures Correctly set image aspect for depth or stencil texture staging. This fixes 6 failing dEQP 3.0 tests and an end2end test. Note that DS combined aspect textures will need special handling to read each aspect separately which is not included in this fix. Bug: angleproject:3949 Change-Id: I8e3f8166bdd31e2c002752b2f5c107ba411b2b0d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855964 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Cody Northrop f912b294 2019-10-10T15:32:14 Vulkan: Handle 2Darray base/max level change When staging updates to the vkImage based on texture base/max level change, we weren't properly handling texture 2Darray. This CL changes several helpers to explicitly accept Vulkan extents and offsets so it is clear how things should be treated. Bug: angleproject:3991 Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.*sampler2darray* Change-Id: Iae80ce7201180224fc3bb7823f21a360950c515d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1854020 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 2d5c8d31 2019-10-08T22:37:32 Vulkan: Fix off by one when flushing staged texture updates When updating ImageHelper::flushStagedUpdates to handle base and max texture level, we got off by one when deciding if an update landed in in the range of the current vkImage. When there are 8 mipLevels and we see an update for level 8, that should not be applied, and should be preserved in updatesToKeep. Bug: angleproject:3950 Test: MipmapTest.DefineValidExtraLevelAndUseItLater/ES2_Vulkan Change-Id: I63e0c24f7885f8b0580ce212b531711aebcf0e01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1848933 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Courtney Goeltzenleuchter a333b87c 2019-09-27T14:00:14 Vulkan: Handle D24 -> D32FS8X24 depth fallback Swiftshader's depth support requires that ANGLE fall back to using the D32FS8X24 depth format. Some conversion routines needed to be added to support that use. Test: dEQP.GLES3/functional_texture_format_sized_* Bug: angleproject/3937 Change-Id: I979dc5e9b01dac40f564daad4f4817b61bd056ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829170 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten f750d86a 2019-10-01T17:52:37 Trigger a flush() when the command graph contains too many objects If an App repeatedly issues GL commands like glTextImage2D without a finish/flush/draw, it's possible for ANGLE to exhaust the available Vulkan memory allocations and exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount. When this occurs, the Vulkan validation layers will trigger an error and cause dEQP tests to fail. This change will query the backend if a flush() should be performed during each of the GL delete calls, and perform it if necessary. This will cause a queue submission and a Serial increment, allowing the allocated memory to be freed, preventing the validation errors. Bug: angleproject:3818 Test: KHR-GLES3.copy_tex_image_conversions.forbidden.renderbuffer_cubemap_* Change-Id: I26d0a47aa7bca10c25bc8141f1523afbab0b3b5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1834781 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>