src/libANGLE/renderer/vulkan/TextureVk.cpp


Log

Author Commit Date CI Message
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>
Amy Liu 572ee7b9 2020-04-26T13:58:22 Vulkan: Fix texture copy from texture3d to texture2d or cubemap In vulkan spec, if srcImage or dstImage parameters are of VkImageType VK_IMAGE_TYPE_3D, the baseArrayLayer and layerCount members of the corresponding subresource must be 0 and 1. Bug: angleproject:4553 Change-Id: Iabdc9708c86606c0d78c095c9d44827951264180 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2166863 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott eba008ad 2020-05-05T10:46:21 Add end2end test for changing MAX_LEVEL with compressed texture This is a follow-on to https://chromium-review.googlesource.com/c/angle/angle/+/2180881. This adds a comment explaining part of that solution, and an end2end test that creates a compressed texture and then renders after decreasing MAX_LEVEL and then again after increasing MAX_LEVEL. Bug: b/155499736 Change-Id: I04bb0dc9ead2807f7121e4c6b95ffd3594d5dcc0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2182174 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@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>
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>
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 963759a3 2020-04-21T15:14:56 Vulkan: Mask out implementation dirty bit in sync. This would needlessly create many redundant sampler objects. Bug: angleproject:4517 Change-Id: Ib8ef28b9bcbbeec804c493fbe677cbee7d9a750d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159296 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 6fc0066a 2020-04-21T17:40:54 Vulkan: Add a sampler cache. This uses a packed sampler description to re-use samplers for multliple VkImages. The samplers will persist for the lifetime of RendererVk. In the future we could look at doing cache eviction for large object counts. Reduces the active VkSampler cache in Manhattan from over 1200 to 9. Also should reduce the number of VkSamplers used with Chrome. Bug: angleproject:4491 Change-Id: Idca00e4ed8cb660a0865281544aaa57cf884bbdb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2160771 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1fc354fa 2020-04-22T11:49:00 Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages." Re-land fixes ASSERT on Android GLES. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I91d31213b115a58546b574caa574eebbb098266c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 623d0443 2020-04-21T15:15:03 Revert "Vulkan: Forward RenderBuffer/Surface dirty messages." This reverts commit 3fb33ade6ec8f286797bff5645304df580b1a963. Reason for revert: Causing WebGL test failures on GLES/ANGLE/Android. Bug: chromium:1072739 Original change's description: > Vulkan: Forward RenderBuffer/Surface dirty messages. > > Previously we were only forwarding Texture staging changes to the > Framebuffer for re-sync. We could miss out on clears that were staged > in Surfaces and Renderbuffer attachments. Complete the chain by making > the SurfaceVk and RenderbufferVk forward notifications from the > VkImage. > > Bug: angleproject:4517 > Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4517 Change-Id: I4fd4d79dc11da0ba86065d3a80975de4c791a2a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3fb33ade 2020-04-09T15:27:12 Vulkan: Forward RenderBuffer/Surface dirty messages. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 e4aa679c 2020-04-01T17:46:31 Texture: Pass explicit unpack buffer to setImage. This will allow us to call setImage internally even if there's an unpack buffer bound. Useful when implementing robust resource init with copyTexImage in some edge cases. Bug: angleproject:4517 Change-Id: I7e8e9536ab9222c620e572f7b6c20b08fa29d646 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133088 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
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>
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>
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 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 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>
Michael Spang e4ba2d87 2020-02-20T16:05:02 Pass ContextVk instead of gl::Context to internal methods Minor cleanup to change funciton signatures of vulkan specific methods in MemoryObjectVk & SemaphoreVk. Bug: angleproject:2475 Change-Id: I230664548004ebc48b559e0f25264ea948ce5a1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2067500 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
Jamie Madill 0a9c0b7b 2020-02-19T14:55:04 Vulkan: Fix image queue changes with graph disabled. These again weren't being tested on the CQ. Probably necessary for some image sharing scenarios. Bug: angleproject:4029 Change-Id: Iccbebf127e2ec6fdb74dd213998674fff77b75b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065529 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Jamie Madill 3b82506a 2020-02-11T09:35:38 Vulkan: Command graph linearization (Step 5). Implements ES 3.1 support. Bug: angleproject:4029 Change-Id: I3c08602cf4ec64621bfdb40cd40d142b666e6edf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2046052 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@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 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>
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 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>
Peng Huang 92ba377f 2019-12-10T23:48:35 Vulkan: remove unnecessary transition of external images Since semaphore has been supported, the code for changing external texture layout and queue family is not necessary anymore. So remove them. Bug: angleproject:3289 Change-Id: I5470fa4bf7db7ee4c68f157674cf907a8e455d75 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1964655 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Michael Spang <spang@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 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 88752889 2019-11-20T14:09:52 Vulkan: Fix barriers w.r.t sampled->storage image update df415528411f97454e765ff6a83ed1cbc90a7d13 implemented a feature where images are not created with the storage flag until needed. This is a necessary optimization. There were a few misuses of the BufferHelper::onRead/Write helpers that set up the appropriate barriers that this change fixes. Bug: angleproject:3816 Change-Id: I7e62d98b7325f938152a1972f4ebee083ed319c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1924989 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Xinyi He <xinyi.he@arm.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Sunny Sun <sunny.sun@arm.com>
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>
Sunny Sun df415528 2019-10-24T09:22:39 Vulkan: Enable VK_IMAGE_USAGE_STORAGE_BIT when it is needed VK_IMAGE_USAGE_STORAGE_BIT is always enabled for vkImage, this increases memory bandwidth in some platforms. This CL changes the behavior to enable VK_IMAGE_USAGE_STORAGE_BIT when necessary. Bug: angleproject:3904 Test: angle_end2end_tests Test: angle_deqp_gles2_tests Change-Id: I8ffd37efa8d99d04328fa6232de0755be3273d9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1857799 Commit-Queue: Sunny Sun <sunny.sun@arm.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 dfc20daf 2019-10-28T13:51:42 Plumb more logic for ANGLE_get_image. Also implements and tests validation / negative API. Bug: angleproject:3944 Change-Id: I3385a4255f4fab6a12eee2abfa5ffcce2107359a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879961 Commit-Queue: Jamie Madill <jmadill@chromium.org> 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>
Jamie Madill a14555a7 2019-10-13T15:05:22 Vulkan: Refactor RenderTargetVk ImageViews. Instead of storing a pointer to an ImageView, store a pointer to an ImageViewHelper. The level and layer index are all that's needed to pull the right image view from the ImageViewHelper. Will make it easier to store ImageView references in the graph to track lifetime. Bug: angleproject:2464 Change-Id: I773fa79a89ceefc99ff70e4eed4985f9f01fe26a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1857549 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
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>
Cody Northrop d192e933 2019-09-27T10:27:10 Vulkan: Support binding texture levels as a rendertarget This CL refactors how TextureVk handles rendertargets. It removes the single rendertarget that previously supported 2D, and expands the layer/level list of rendertargets to handle all cases. Bug: angleproject:3184 Bug: angleproject:3996 Test: Texture2DTestES3.FramebufferTextureChangingBaselevel/ES3_Vulkan Test: FramebufferRenderMipmapTest.RenderToMipmap/ES2_Vulkan Test: FramebufferRenderMipmapTest.RenderToMipmap/ES3_Vulkan Test: ComputeShaderTest.ImageStoreMipmapSlice/ES3_1_Vulkan Change-Id: I466d0389cc6744994f88c40cc388fca694b53a99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1854895 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@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>
Jamie Madill 28ff9922 2019-10-09T16:08:35 Vulkan: Get rid of "TextureVkViews". This struct was used to implement different views for stencil mode. It is replaced with a single stencil mode view for sampling. We shouldn't be using a stencil-specific view for our render view. In cases where we're attaching a Depth/Stencil texture to a Framebuffer's special depth/stencil attachment point we will still need to use a single 'Draw' view attached to depth/stencil. So there's no need for a separate 'Draw' view for stencil. Also there's no current support for a separate 'Fetch' view for stencil textures. There may not be any easy way to trigger this path as it's only used in seamful cube map emulation and image copy. Seamful emulation is ES 2.0 only while stencil textures are ES 3.1 so that's not a possible use. Image copy doesn't seem to be possible either as it stands right now. Bug: angleproject:3975 Change-Id: Ic999f9471ea533d1184a364732c569124aa802bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1842230 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 88bc4d3d 2019-10-04T20:41:24 Vulkan: Get rid of "fetch" level/layer image views. Instead always use 2D array views when rendering to cube maps. We need to keep the "fetch" image view for the main image for emulating seamless cube map textures on GL 2.0. We also use it for some texture copying init. These uses could potentially be replaced with sample instructions if we wanted to remove this last "fetch" view. Bug: angleproject:3975 Change-Id: I90f9be9fc6542d8ec27f6722132c1b27acf72176 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1842226 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill cb653d43 2019-10-04T17:26:59 Vulkan: Get rid of level layer "storage" views. By using a 2D instead of 2D array view for the render target we can merge the 'storage' and 'draw' level/layer views. Bug: angleproject:3975 Change-Id: Icf8c0bf6bec4147595c2b728362abd51bdf03f3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1841947 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cody Northrop 6acfca3a 2019-10-04T08:06:29 Vulkan: Handle texStorage when base level is set In this scenario, we allow the texStorage call to fully populate the image, then let dirty bits change the vkImage to reflect the base level. Bug: angleproject:3948 Bug: angleproject:3949 Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.* Change-Id: I1f453653a23b9d1802a374def40c9372ada8822a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1841275 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 6b60dfd8 2019-10-02T07:54:18 Vulkan: Remove image views forced to one mip level textureSize requires the view to reflect actual mip levels, so we can't artificially limit the view based on filtering mode. This CL removes those views. That unearthed a problem where the VK backend wasn't properly implementing non-mipmapped filter modes. There is a blurb in the Vulkan spec about this: There are no Vulkan filter modes that directly correspond to OpenGL minification filters of GL_LINEAR or GL_NEAREST, but they can be emulated using VK_SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and maxLod = 0.25, and using minFilter = VK_FILTER_LINEAR or minFilter = VK_FILTER_NEAREST, respectively. So this CL also adds that emulation. Bug: angleproject:3948 Test: TextureSizeTextureArrayTest.BaseLevelVariesInTextureArray Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.* Change-Id: I81d5c3417e7d9abd0cdd058b935963706024a28f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1835937 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill f10bf6bf 2019-09-26T10:27:18 Vulkan: Implement multi-threaded GL. The main component of this change is to make vk::BufferHelper, vk::ImageHelper and vk::SyncHelper use a common path. We introduce a new "vk::SharedGarbage" helper class that stores small lists of garbage from individual objects like an ImageHelper or BufferHelper. The SharedGarbage is stored in the RendererVk with the ResourceUse of the helper object. The ResourceUse tells RendererVk when it is safe to destroy the GarbageObjects. New "onGraphAccess" commands are added in a few places to enable the common garbage collection path. A couple Context-only resources like default attributes now are referenced where they were not before. Also reorganizes some functions so we can add a few helpful ASSERTs to our graph dependencies. Added "updateCurrentAccessNodes" for this. Also adds a "RendererScoped" helper to replace many uses of "ContextScoped". The multithreading EGL tests mostly pass but have some remaining flakiness so cannot yet be enabled. Bug: angleproject:2464 Change-Id: Ia3e3ae8848d731abf3f21ebe04c33e381e130be0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808444 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cody Northrop 988f7170 2019-09-30T15:52:37 Vulkan: Base/max level fixes and cleanup This CL cleans up references to base/max level bug and fixes one lingering issue regarding special handling of depth/z for arrayed surfaces. Bug: angleproject:3148 Bug: angleproject:3184 Bug: angleproject:3948 Bug: angleproject:3949 Bug: angleproject:3950 Test: dEQP-GLES3.functional.texture.mipmap.*base_level* Test: dEQP-GLES3.functional.texture.mipmap.*max_level* Test: Texture2DArrayTestES3.DrawWithLevelsOutsideRangeWithInconsistentDimensions Change-Id: Iad72005a111507c50b8be9726adc32285bbae52b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1832757 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 2e80cf9d 2019-08-08T22:05:42 Vulkan: Refactor render target initialization for texture arrays Bug: angleproject:3188 Bug: angleproject:3189 Test: dEQP-GLES3.functional.texture.*.3d.* Test: dEQP-GLES3.functional.texture.*.2darray.* Test: Texture3DTestES3 Test: CopyTexImageTestES3 Test: DrawBuffersTestES3 Change-Id: Ia48766170c02fadb56cddcd415144a00123b02c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1745722 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop cb16fb5f 2019-08-29T16:53:55 Vulkan: Support texture base and max levels The Vulkan backend uses a vkImage that matches the number of effective levels in the GL texture. This is due to the fact that GL textures can have really strange layouts that only make sense when base level and max level are applied. For instance, take the following layout with disjoint mip levels: Level 0: 4x4 RGBA Level 1: 2x2 RGBA Level 2: 10x10 RGB If base level is set to zero and max level is set to 1, the image is still considered mip-complete: Level 0: 4x4 RGBA ==> Base Level 0 ==> Level 0: 4x4 RGBA Level 1: 2x2 RGBA ==> Max Level 1 ==> Level 1: 2x2 RGBA Level 2: 10x10 RGB If base and max level are then both set to 2, the texture is still considered complete, but of a different size and format: Level 0: 4x4 RGBA Level 1: 2x2 RGBA Level 2: 10x10 RGB ==> Base/Max Level 2 ==> Level 2: 10x10 RGB When the base or max level is changed, we must recreate the vkImage to match the new level count. To support that, we: - Stage updates from the current image to the new image - Only stage updates if there aren't already staged updates for a level - Free the current image and so it can be recreated at the next draw This CL does the following: - Refactors TextureVk::copyImageDataToBuffer to support staging updates without flush - Adds TextureVk::copyImageDataToBufferAndGetData to support previous use model - Adds TextureVk::changeLevels, triggered during syncState, which stages updates and releases the current image. - Updates ImageHelper::flushStagedUpdates to understand base/max levels - Updates TextureVk::ensureImageInitialized and TextureVk::generateMipmap to account for base/max level - Tracks base and max levels in ImageHelper - Adds ImageHelper::stageSubresourceUpdateFromBuffer to support this use case - Adds ImageHelper::isUpdateStaged to determine if changeLevels should propagate data - Makes gl::TextureTypeToTarget available for use outside of ImageIndex - Enables several deqp and end2end tests Bug: angleproject:3148 Test: dEQP-GLES3.functional.texture.mipmap.*base_level* Test: dEQP-GLES3.functional.texture.mipmap.*max_level* Change-Id: I14ca071c9c62eb310dfed7ef9290dc65fc3ff696 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776933 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill b540da89 2019-09-19T14:19:12 Vulkan: Use ResourceUse to track object lifetime. With the new resource tracking scheme the CommandGraph, tracking a "Context serial" aka "current" serial is no longer necessary for CommandGraphResources. Serial tracking has been moved to the shared ResourceUse struct that gets updated on a command submission. Thus we don't need to store the serial as a current separate piece of info in BufferHelper/ImageHelper. Will lead to further redesign for the multi-threading support for Vulkan. Bug: angleproject:2464 Change-Id: I1ae4bcc27fcfb93422b4ab4c9682a458e482f295 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785990 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d7f28aae 2019-09-19T14:19:10 Vulkan: Pass CommandGraph when updating serials. This is in preparation for storing a pointer to a shared resource use structure. Bug: angleproject:2464 Change-Id: I8f4ba1c71de6ad6a27ac06fc8012a0e94267cc16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785988 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mingyu Hu 7e44ec26 2019-08-26T15:59:48 GL_EXT_multisampled_render_to_texture extension. Part 1. Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before. Bug: angleproject:980428 Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Courtney Goeltzenleuchter 1f2782e0 2019-08-29T14:19:23 Vulkan: fix unsized internalformat depth sampling Many implementations provide OES_depth_texture behavior if the texture was specified with a non-sized format (e.g. GL_DEPTH_COMPONENT). This change implements that behavior for Vulkan and adds a couple of tests to verify it. Bug: angleproject:3890 Change-Id: I005b1eaa30db033f7d78a5cf2236aab7f442b7f5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1764301 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 912e52d8 2019-08-23T00:25:09 Vulkan: Storage image support Image bindings are placed after atomic counters in the "resources" descriptor set. There are two issues yet to be addressed: - GL can create a 2D (array) view of a 3D image, but this is not allowed in Vulkan. If this cannot be made possible, emulation needs to be done. https://github.com/KhronosGroup/Vulkan-Docs/issues/1033 - GL can create an image view of a texture with a different format and have the data reinterpreted. This is not currently done. Bug: angleproject:3563 Change-Id: I95c4d92c50bb033212a9a67f3f2d6f97c074c7bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1767366 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 0b1fbcff 2019-08-30T15:05:12 Vulkan: Make vk::ImageView pointers const Bug: angleproject:3563 Change-Id: I8b6415dd9508941d093f36e7ded72d25f571b6f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1779204 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 886698bc 2019-08-27T16:48:07 Vulkan: Style cleanups to TextureVk. Pass params by const & and use "CPU instead of "Cpu" naming. Also prefer "ContextVk *contextVk" to "ContextVk *context". Bug: angleproject:2464 Change-Id: I887de5b2e5494d14f0e9c7db269eb63744f2a3cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1771499 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9288dcf6 2019-08-27T15:00:35 Vulkan: Remove command buffer param from initImage. This method didn't use the parameter. Removing it simplifies the code. Bug: angleproject:2464 Change-Id: Ib8f5f649f66eae405fb91f7cfcc8cefc4c44bda2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1771992 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Courtney Goeltzenleuchter bc0a7b58 2019-08-05T09:26:23 Add support for sampling stencil texture Suspect a potential driver issue with integer sampling from stencil so skip dEQP-GLES31.functional.stencil_texturing.misc.compare_mode_effect in the expectations file. Will follow-up with more directed tests. Also skip dEQP-GLES31.functional.stencil_texturing.misc.base_level Blocking Bug: angleproject:3148 Test: dEQP-GLES31.functional.stencil_texturing* Bug: angleproject:3575 Change-Id: I9547406b44ec16629631c1bf50907e6a24f1a20e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1736946 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten 99cffe5d 2019-08-01T17:10:50 Vulkan: Fix glCopyTexSubImage3D() Update glCopyTexSubImage3D() to account for the requirements necessary for VK_IMAGE_TYPE_3D. Bug: angleproject:3765 Test: KHR-GLES2.texture_3d.copy_sub_image.rgba8 Test: angle_end2end_tests CopyTexImageTestES3 Change-Id: Ife3d768323d0cfe2a53e5ae4c47a0747d65981bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1730637 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
James Darpinian 7e48c9eb 2019-08-06T17:17:19 Add explicit integer casts WebKit uses the -Wshorten-64-to-32 flag which warns on these cases. Bug: 3439 Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Fei Yang d7500aa8 2019-08-02T15:52:39 Vulkan: Regression issue on AngryBird for read bandwidth Use AllGraphicsShaderReadOnly as the image layout for graphics path. Bug: angleproject:3473 Change-Id: I1e653890e69f347b2aba4a0156a5d5b86109fd0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1732617 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Ian Elliott b90755ba 2019-08-09T10:53:22 Vulkan: Remove a call to addReadDependency() that shouldn't be done. Bug: angleproject:3798 Change-Id: I516e6b0766ba0fe7c0bc7f6cd9f4aea91c7536f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1745839 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Cody Northrop eb0479e2 2019-07-24T14:15:56 Vulkan: Texture 3D and 2DArray layers as framebuffer attachments Support glFramebufferTextureLayer by correctly handling layers from 3D and 2DArray textures. Modeled after CubeMap layers support. Bug: angleproject:3188 Bug: angleproject:3189 Change-Id: Ic73a6017134e9d2b49beed103487454397a97167 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738436 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Ian Elliott dc2c5c5a 2019-08-02T09:32:18 Vulkan: Initial Implementation of PBO support (software only) This contains support for both pixel unpack buffers (i.e. for glTex*Image*) and pixel pack buffers (i.e. for glReadPixels). Bug: angleproject:3209 Bug: angleproject:3210 Change-Id: I077cccbffb96fb5f0198922bc7c1850a7eb3f616 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1723096 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop a2129356 2019-07-23T12:54:13 Vulkan: Add support for 2D array textures Includes changes from jmadill to align with Vulkan backend design. Correctly setting layer count and depth when the texture type is 2Darray. Vulkan requires depth of 1 for 2Darray textures. Bug: angleproject:3189 Change-Id: I0d58c33fcd75b1d768ea0308ac6e54230d8cfcc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721169 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill c327370e 2019-07-23T12:54:12 Vulkan: Pass VkExtent3D to TextureHelper::init. Bug: angleproject:3189 Change-Id: I4b95240bb32fbc2b3d0c8f097e0552d0fe23417d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi c68e7cbc 2019-07-25T11:28:07 Vulkan: Fix image copy flipping The draw framebuffer was consulted for flipping instead of the read framebuffer. Revealed a bug with copy-with-transfer not taking source render target's level/layer into account. This test was failing on Linux/Intel because there the framebuffer is not flipped, so the transfer path was taken. Bug: angleproject:2954 Bug: angleproject:3723 Change-Id: If95bf97b8e0536302ed39999be47bf904283c9e4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1718784 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill deb43a31 2019-07-22T09:56:27 Vulkan: Store VkExtents3D in ImageHelper. This makes the distinction between a gl::Extents (includes a depth value for 2D array texture layer count) and a Vulkan extents (2D array textures have a "1" for depth) clearer. Preparation refactor patch. Bug: angleproject:3189 Change-Id: I9a13379c421e7f3c7856ac15b7a73013258ab9fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709754 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill da2b649c 2019-07-22T09:56:26 Texture: Make ImageIndex store layer counts. Only for 2D array textures. Bug: angleproject:3189 Change-Id: I9958ab60ffa464aa63f5cb321cbbe14b378f3647 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709109 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill 4e71b2bc 2019-07-08T13:23:38 Framebuffer: Clean up query naming. Changes instances where we were querying 'color buffers' and 'depth buffers' to 'color attachments' and 'depth attachments', etc. Bug: angleproject:3611 Change-Id: I7af7d33e5204f21d288f5bcad997988d36eabfc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1690679 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
James Dong a7d8ada2 2019-06-28T11:10:41 Test out-of-bounds writes in glCopyTexSubImage2D Adds a test for out-of-bounds writes resulting from clipping the copy area to the size of the source framebuffer causing the destination area to be out of bounds. This causes a GL_INVALID_VALUE error according to the spec. Bug: angleproject:3355 Change-Id: I39638daa9b0c03cc82a6dbf6cabd0027e32a8ea8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1682111 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c773ab98 2019-06-25T17:11:58 Vulkan: Recycle dynamic buffer storage. This adds a free list to the dynamic buffer storage. Buffers are added to the free list when the retained buffers are released. They are taken from the free list when we allocate a new buffer. We only allocate a new buffer in the ring when we run out of free buffers. This reduces the amount of time we spend in allocation for frequent updates. Now that we're recycling buffers inside of DynamicBuffer we also need to be a bit more careful about when we allow ourselves to reuse them. If they're still in use by the GPU we should not try to modify them. Bug: angleproject:3082 Change-Id: Ibee5a7e2fe4a17f4a2f7af6bc6bcce54bdc413c2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1646548 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
James Dong 87748543 2019-06-18T18:45:42 GL/Vulkan: handle depth texture discrepancy In GLES 3.0, depth textures where changed to behave like RED textures, but in GLES 2.0 with ARB/OES_depth_texture, they were treated as luminance textures. This change produces the expected behavior on GLES 2.0 for the GL backend and on GLES 3.0 for the Vulkan backend. Bug: angleproject:3540 Change-Id: Iad6b4e03cf947b27eb97dbb10419bc8bcdb11024 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1666363 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Dong <dongja@google.com>
Jamie Madill 44168468 2019-06-20T09:50:23 Vulkan: Sync image in TextureVk::syncState. We can use the DIRTY_BIT_IMPLEMENTATION internal dirty bit in the gl::Texture class to force calls to ContextVk::syncState. In syncState we can ensure we call ensureImageInitialized before we get to the ContextVk. This in turn means we can remove some of the command graph breaks from TextureVk. We need to make sure the dirty bits are propagated to EGL Image siblings with this method. This fixes a potential implementation issue with EGL images with the GL back-end. Also makes a state change test a little better by removing some of the VAO and program init calls before the draw. Improves perf on the texture change microbenchmark by 12.5%. Bug: angleproject:3539 Bug: angleproject:3117 Change-Id: I2b5481690801fa98f859a6c02e3f4b974590cd3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1663839 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 3ea463bf 2019-06-19T14:21:33 Move event tracer back into common. Requires that we update the TRACE_EVENT macros to accept a platform as an argument. The refactor isn't complete. In order to finish we'd need to ensure we have the Display's PlatformMethods available at all sites. Unblocks adding trace events directly in the perf tests. Bug: angleproject:1892 Bug: angleproject:3117 Change-Id: Iee0ca086ccfe23acab3fc186fb042f018711a94c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1664794 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
James Dong c6601ec8 2019-06-14T11:07:23 Vulkan: fix texture swizzle Corrects texture swizzle in Vulkan backend. Previously user-supplied swizzle was applied before internal swizzle; this change applies the internal swizzle first, causing the correct behavior. Also recreates image views when swizzle is dirty. Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.texture.swizzle.*' Test: ./angle_end2end_tests --gtest_filter='SwizzleTest.*/ES3_Vulkan' Bug: angleproject:3212 Change-Id: Ie2c44b479da5c19ba744ace7562a73c944f97a49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660909 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 88596bea 2019-06-13T14:17:48 Vulkan: Implement a texture descriptor cache. We noticed a significant hotspot in vkAllocateDesctiptorSets. The app was repeatedly cycling through a few combinations of active textures. For each state change in ANGLE we were allocating a new desctiptor set. This in turn would trigger internal driver memory allocation and cause jank. Using a cache avoids allocations entirely since the application is rotating through a stable set of textures. The descriptor cache is stored in each program. It is indexed by a set of 32-bit serials. Each texture generates a unique serial for every combination of VkImage and VkSampler that the texture owns. The texture descriptor is refreshed every time a texture changes or is rebound. The descriptor cache is accessed via an unoredered map with the texture serial sets as the hash key. We also store the maximum active texture index in the cache key so we don't need to hash and memcmp on all 64 active textures. This will currently fail if more than MAX_UINT serials are generated. But that number is high enough that it shouldn't be possible to hit in practice in a practical amount of time. Requires shifting the texture sync to ContextVk so we can get the new serial after the textures are updated. And to make sure to update the image layouts even if the descriptors are not dirty. Improves performance of the T-Rex demo. Also improves the score of the texture state change microbenchmark by about 40%. Bug: angleproject:3117 Change-Id: Ieb9bec1e8c1a7619814afab767a1980b959a8241 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642226 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
James Dong 13ac9422 2019-06-10T17:53:09 Vulkan: add support for shadow samplers. Adds support for ES 3.0 shadow samplers. Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.texture.shadow.2d.*' Bug: angleproject:3211 Change-Id: Ic82ecfe19290fb952fcb0ba423691b5bac87c4a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1652021 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f2a1c384 2019-05-21T16:32:49 Vulkan: Implement multisampled framebuffers Simultaneously implements ANGLE_framebuffer_multisample and ES3 multisampled framebuffers. Additionally, implements ES3 framebuffer blitting where multisampled framebuffers are involved. Bug: angleproject:3203 Bug: angleproject:3204 Bug: angleproject:3200 Change-Id: I5694a30f71168e807688a9568e3742b81d907918 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1622667 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang ee244c77 2019-05-06T10:30:18 Vulkan: Move command graph and garbage to ContextVk. To support multithreading, contexts should manage their own command graphs and garbage. This allows safe access to vulkan resources such as command pools without thread synchronization. BUG=angleproject:2464 Change-Id: I930149bc9f0793028761ee05ab50b8c0a4dec98a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516515 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ce9be8c7 2019-05-24T09:35:06 Vulkan: Have a cubemap as 2D-array view handy Previously, only texture copies used a shader that performed texelFetch(). To support cubemaps, a hack was used to temporarily create a 2D array view. With upcoming support for multisample resolve, more shaders will be using texelFetch() all requiring this workaround. This change instead makes sure that a separate view is created for cubemaps for the purpose of being used with these shaders. As a result, we have three logical views on textures and render targets: - Draw: a view that can be used as a color/depth/stencil attachment - Read: a view that can be used to sample from - Fetch: a view that can be used to fetch from The fetch view is generally the same as the read view, except for cube maps. Bug: angleproject:3200 Change-Id: I21547f728c16f0aa8f0fcae152c400b5cc1565da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1628585 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6722009e 2019-05-20T11:12:53 Vulkan: Handle dirty RTs with state messages. Prior to this CL we were handling dirty state change notifications by flushing the RT Images just prior to use or just after they were changed. This could lead to a few redundant checks in several places. It also meant we needed an owner pointer from the RT to the parent Image. This pointer would be null for Surfaces and Renderbuffers. This cleans up the image flushing logic to be handled by dirty bit notifications. When an app updates an attached Texture with TexSubImage or related calls it will send a notification to the Framebuffer. The Framebuffer then sets a dirty contents bit that is handled in the implementation. In Vulkan this means flushing the dirty bits. Requires adding a flag to the FramebufferImpl class to determine if we need to syncState before we checkStatus. Adding the option allows us to only call syncState for the GL back-end. Not calling syncState allows the robust resource init operation to happen *before* we syncState. Which in turn allows FramebuffeVk to initialize the VkImages in one go. Added new regression tests for Texture updates. This might not cover all cases. I found it was very hard to trigger some of the resource update staging in TextureVk. Bug: angleproject:3427 Change-Id: Idfa177436ba7fcb9d398f2b67922e085f778f82a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601552 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tom Anderson 08146a27 2019-05-17T10:40:44 Remove non-source sources from binary targets No behavior changes. BUG=chromium:964411 Change-Id: I843757e65f110882c01514fe6bf4aed28e07dd21 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1617011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter eaf2d928 2019-04-18T16:31:25 Add support for OES_depth_texture Note: Includes workaround for http://anglebug.com/3452 - some Android devices do not indicate filtering support on VK_FORMAT_D16_UNORM. Bug: angleproject:3103 Test: angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTexture/* angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.PackedDepthStencil/* angle_end2end_tests --gtest_filter=DepthStencilFormatsTest.DepthTextureRender/ES2_VULKAN Change-Id: Ic325fb94ab0e619a17c2e149e0e0865fa4142f3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575426 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0631e19b 2019-04-18T16:09:12 Vulkan: Rename Vulkan "Texture" format to "Image" Also adds some comments to vk_format_utils.h. Bug: angleproject:3372 Change-Id: I529b9b189e4cdfd400c3c981a47139727d9954ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>