src/libANGLE/renderer/vulkan/TextureVk.cpp


Log

Author Commit Date CI Message
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>
Michael Spang f02a767d 2019-04-09T18:45:23 Vulkan: Implement glTexStorageMem2DEXT This implements support for creating textures that alias vulkan images allocated inside external memory. Bug: angleproject:3289 Change-Id: Iad071f353a217793102ae737647c7cd572f7b0ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552029 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Michael Spang <spang@chromium.org>
Shahbaz Youssefi 65d10f3b 2019-03-21T16:30:31 Vulkan: Implement robust resource initialization If a texture or renderbuffer needs to be cleared for robust access or due to having emulated channels, it is immediately cleared. The former relies on a front-end feature that optimizes robust access clears only to levels and layers that are not fully initialized through data upload. Bug: angleproject:2722 Change-Id: Icdab856eb4ffe963f78569b6d80d9ff5cb27ff9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535056 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten 5f388c24 2019-03-14T09:54:23 Vulkan: dEQP-EGL.functional.image.modify.* Determine the destination internalFormat correctly. dEQP-EGL.functional.image.modify.renderbuffer_rgb565_tex_subimage_rgb8 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgb565_tex_subimage_rgb8 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.tex_rgba8_tex_subimage_rgba4 dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba5_a1_tex_subimage_rgba4 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.tex_rgba4_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.renderbuffer_rgba4_tex_subimage_rgba5_a1 dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba8 dEQP-EGL.functional.image.modify.renderbuffer_rgb5_a1_tex_subimage_rgba4 Bug: angleproject:3170 Change-Id: Ic9870390b2d4a0dcbe561efd3fb1597faadb7d79 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1524404 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 892d1805 2019-03-27T14:21:34 Vulkan: Have the WindowSurfaceVk own the submit semaphores. Chaining of submit semaphores is only needed for window surfaces because they are required for the first usage of the swap chain image and final present of the image. Move ownership of the submit semaphores from RendererVk to WindowSurfaceVk and update all calls to finish and flush to be piped through a ContextVk which tracks the currently bound window surface. BUG=angleproject:2464 Change-Id: I4b3083124d7910a5dee297afc219e3a3f28057f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1542257 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 2660b503 2019-03-21T12:08:40 Vulkan: Restore CommandBuffer to namespace vk Moved vk::CommandBuffer and vk::SecondaryCommandBuffer to vk::priv:: and aliased vk::CommandBuffer to one or the other. This allows the rest of the classes to continue seeing vk::CommandBuffer as they used to do. Used a special alias for the primary command buffer that gets submitted (vk::PrimaryCommandBuffer). Bug: angleproject:3136 Change-Id: I61236fd182230991db7395d05e3da3be5e3f45be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1534456 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis a8ff8814 2019-03-05T07:06:32 Vulkan:Optimize SecondaryCommandBuffers RELAND of this commit. Had to fix fuzzer build errors. Optimize performance of SecondaryCommandBuffers and enable them as the default build option. To disable this set angle_enable_custom_vulkan_cmd_buffers=false in your build args. This CL enhances the PoolAllocator to have a "fast" mode that can be enabled at class creation. This mode uses an alignment of 1 byte and enables a fastAllocation() call that avoids some bookkeeping overhead. The SecondaryCommandBuffer uses this fastAllocation() function. Furthermore the fast path of fast allocate, using the current page, is inlined for maximum speed. Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate blocks so that the commands occur linearly in memory. This speeds up processing with improved cache coherency and minimizes overhead when recording commands. Also the core Draw functions and their state updates are all inlined as well as the common functions to initialize commands and to copy command pointer data. This change also includes some new, custom commands. One is imageBarrier that is a specialized version of pipelineBarrier that only performs a single image layout transition. There are customized versions of various Draw commands to minimize copying of parameters. There are also specialized commands to bind[Graphics|Compute]Pipeline that have the pipeline type built in to the command. More custom commands and command data size optimizations will be made in follow-on commits. Bug: angleproject:3136 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Change-Id: I621d8f8893308fca240b32390928e8ba0036cf06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535385 Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 896e7811 2019-03-22T14:56:33 Revert "Vulkan:Optimize SecondaryCommandBuffers" This reverts commit 2219b18c984ed69251f3db3c7b5fd69a2fa68c77. Reason for revert: Failing to compile on ASAN builders: https://ci.chromium.org/p/chromium/builders/try/linux-libfuzzer-asan-rel/134782 Currently blocking roll. Original change's description: > Vulkan:Optimize SecondaryCommandBuffers > > Optimize performance of SecondaryCommandBuffers and enable them as the > default build option. > To disable this set angle_enable_custom_vulkan_cmd_buffers=false in > your build args. > > This CL enhances the PoolAllocator to have a "fast" mode that can > be enabled at class creation. This mode uses an alignment of 1 byte and > enables a fastAllocation() call that avoids some bookkeeping overhead. > The SecondaryCommandBuffer uses this fastAllocation() function. > Furthermore the fast path of fast allocate, using the current page, > is inlined for maximum speed. > Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate > blocks so that the commands occur linearly in memory. This speeds up > processing with improved cache coherency and minimizes overhead when > recording commands. > Also the core Draw functions and their state updates are all inlined > as well as the common functions to initialize commands and to copy > command pointer data. > > This change also includes some new, custom commands. One is > imageBarrier that is a specialized version of pipelineBarrier that only > performs a single image layout transition. > There are customized versions of various Draw commands to minimize > copying of parameters. > There are also specialized commands to bind[Graphics|Compute]Pipeline > that have the pipeline type built in to the command. > More custom commands and command data size optimizations will be made > in follow-on commits. > > Bug: angleproject:3136 > Change-Id: I35453cc2656bc8c51f0d84d1adef106900aca9a5 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,syoussefi@chromium.org,jmadill@chromium.org Change-Id: I1c0bfe864ff343eb8ea6c88556523f8715c981d5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3136 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535998 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 2219b18c 2019-03-05T07:06:32 Vulkan:Optimize SecondaryCommandBuffers Optimize performance of SecondaryCommandBuffers and enable them as the default build option. To disable this set angle_enable_custom_vulkan_cmd_buffers=false in your build args. This CL enhances the PoolAllocator to have a "fast" mode that can be enabled at class creation. This mode uses an alignment of 1 byte and enables a fastAllocation() call that avoids some bookkeeping overhead. The SecondaryCommandBuffer uses this fastAllocation() function. Furthermore the fast path of fast allocate, using the current page, is inlined for maximum speed. Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate blocks so that the commands occur linearly in memory. This speeds up processing with improved cache coherency and minimizes overhead when recording commands. Also the core Draw functions and their state updates are all inlined as well as the common functions to initialize commands and to copy command pointer data. This change also includes some new, custom commands. One is imageBarrier that is a specialized version of pipelineBarrier that only performs a single image layout transition. There are customized versions of various Draw commands to minimize copying of parameters. There are also specialized commands to bind[Graphics|Compute]Pipeline that have the pipeline type built in to the command. More custom commands and command data size optimizations will be made in follow-on commits. Bug: angleproject:3136 Change-Id: I35453cc2656bc8c51f0d84d1adef106900aca9a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 134425c7 2019-03-15T17:02:17 Vulkan:Integrate SecondaryCommandBuffers Integrate the custom SecondaryCommandBuffer type into the CommandGraph nodes by adding new ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS define that can be set in the BUILD gn args with angle_enable_custom_vulkan_cmd_buffers set to "true." Initially the custom cmd buffers are disabled by default. This adds some support functions to SecondaryCommandBuffer to make the integration easier by matching the wrapped cmd buffer interface: initialize(), end(), valid(). Bug: angleproject:3136 Change-Id: Ib910554583192550757bb8ce89914e3ea8737988 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1526556 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi d84728e0 2019-02-01T16:28:55 Vulkan: Fix copySubImage to non-cube-complete images. When copying to a non-cube-complete level of a texture we would fail because we would try to get the base level's current format. Instead we can get the format of the level that is being copied to. Bug: angleproject:2911 Change-Id: Ib6a5c5cef67ad9c880c1b76ea71ed9317eb20c97 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1483951 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 76bd848c 2019-02-13T13:00:44 Vulkan: Support ETC, S3TC and BPTC compressed textures Fixes the format table so the correct Vulkan format for the types are generated. Additionally, implements CHROMIUM_copy_compressed_texture as well as other functions relevant to initializing compressed textures. Bug: angleproject:2670, angleproject:2904 Change-Id: I682d36574262525027cddf8f329515f38cd77dc0 Reviewed-on: https://chromium-review.googlesource.com/c/1468048 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@google.com>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 028df5f5 2019-02-13T12:57:10 Vulkan: Implement transfer path for texture copy This is primarily in preparation for compressed texture copy, but has the following side effect: - When transfer is possible, it's faster than draw - When texture format does not support draw (but transfer is possible), it will avoid copying through CPU. Bug: angleproject:2670 Change-Id: I49e1b51e6ccec875db3f971106687c7d48c4916f Reviewed-on: https://chromium-review.googlesource.com/c/1470595 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang eca36cb5 2019-01-18T14:03:52 Vulkan: Support EGL images sourced from cube maps. Store an image array offset and source texture type in ImageVk to select the correct cube face from the source texture. BUG=angleproject:2668 Change-Id: I03ad25feccb769c906dd28fb573ec342e7816863 Reviewed-on: https://chromium-review.googlesource.com/c/1422542 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 4a298703 2019-01-18T10:49:36 Vulkan: Support creating EGL images from non-zero mipmaps of textures. Store a mip offset in TextureVK to apply to all operations on the ImageHelper. There is no need to store the mip offset in RenderbufferVk because it creates the resource with the mip offset on the call to setStorageEGLImageTarget. Store a mipmap level in the RenderTargetVk object so that clear operations will target the correct mipmap of the image. BUG=angleproject:2668 Change-Id: Ie976e3dd3a8de8135a7fbb8c84bd51eec0dddce8 Reviewed-on: https://chromium-review.googlesource.com/c/1422059 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang fe59f6b5 2019-01-16T09:34:30 Vulkan: Implement EGL Images for 2D and Renderbuffer sources. No support for non-zero mipmaps as sources yet. Suppress dEQP tests due to apparent driver bugs with scissored clears on depth or stencil attachments. BUG=angleproject:2668 Change-Id: Idaa5e70ce9b0c91232fbb989cbf4de1b9134aafb Reviewed-on: https://chromium-review.googlesource.com/c/1415010 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang f256339a 2019-01-15T09:50:44 Vulkan: Implement eglBindTexImage Now that vk::ImageHelper is stored as a pointer, it can be shared between an offscreen surface and texture. BUG=angleproject:3073 Change-Id: I91e520259106eef497950b8b2e622fbf910f7444 Reviewed-on: https://chromium-review.googlesource.com/c/1412234 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 4a41914b 2019-02-05T08:50:30 Vulkan: Add trace markers Add systrace markers for various RendererVk::finish paths in order to quickly identify cause of finishes. Also added marker to commandPool destroy which is currently a known hotspot on some devices. Bug: angleproject:2528 Change-Id: I5a2fc741679a58445d71a2edd6204cf9e869d236 Reviewed-on: https://chromium-review.googlesource.com/c/1454277 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7dafe3eb 2019-01-28T11:39:15 Vulkan: optimize image memory barriers Each image was tracking its current layout, but not the pipeline stage it was used. Additionally, the barrier access masks were inferred from the layout. This incurred two inefficiencies: - The src pipeline stage mask often included all stages, causing unnecessarily heavy barriers. - The access masks included all possible accesses by a layout, which in some cases was overkill, like VK_ACCESS_MEMORY_WRITE_BIT for VK_IMAGE_LAYOUT_GENERAL (which will eventually used for compute shader output). This change instead creates an enum where each element represents the layout, the stage and access masks when transitioning into the layout and the stage and access masks when transitioning out of that layout. The image will instead track a value of this enum (instead of VkImageLayout), which allows it to create the layout transition barriers as tight as possible, since it includes all the necessary information. Bug: angleproject:2999 Change-Id: I91535ce06d10530a6fc217ad3b94b7e288521e25 Reviewed-on: https://chromium-review.googlesource.com/c/1440074 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang f3e823db 2019-01-14T12:40:34 Vulkan: Store ImageHelper as a pointer in TextureVk and RenderbufferVk Storing ImageHelper as a pointer allows the storage to be swapped or shared with other objects. BUG=angleproject:2668 Change-Id: I2e51f24737be59ffe9f472e9b0b592774a792cd1 Reviewed-on: https://chromium-review.googlesource.com/c/1409404 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 08f8fa66 2019-01-10T14:25:47 Vulkan: Merge the PixelBuffer logic into ImageHelper. To support EGL images efficiently, the pixel buffer needs to be tightly coupled with the image it will upload data to allowing textures to upload data to EGL images sourced from renderbuffers. The data will be uploaded to the image in the correct order if it comes from multiple sources and the check for pending uploads does not need to traverse EGL image siblings. BUG=angleproject:2668 Change-Id: Iebf59ed1e358ddc76843b8bcfac39b0363f66a3f Reviewed-on: https://chromium-review.googlesource.com/c/1405710 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b5ba549a 2019-01-02T15:19:22 Vulkan: Shader path for texture copy when image is not initialized This change implements staging image/texture copies when the destination image is not yet fully initialized. With this change, CPU readback for glCopyTex[Sub]Image2D and glCopy[Sub]TextureCHROMIUM should happen only if the texture formats don't allow a fragment-shader based copy. Bug: angleproject:2958 Change-Id: I04087e14ea8fb6fbc731598c5493e44651c22c01 Reviewed-on: https://chromium-review.googlesource.com/c/1393909 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 4f3b207d 2019-01-01T14:48:25 Vulkan: Shader path for texture-to-texture copy This change implements glCopy[Sub]TextureCHROMIUM in GPU. As with the previous change implementing glCopyTex[Sub]Image2D, it currently only selects the shader path if the texture is already defined. Bug: angleproject:2958 Change-Id: Ia1b5625f92e6c9f91807c9b601e5c34d2d5e5c30 Reviewed-on: https://chromium-review.googlesource.com/c/1392394 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 29b49417 2019-01-07T14:03:06 Make copy texture test more extensive By doing the copy multiple times, we exercise both paths where the destination is already initialized and when it's not. This adds tests for all combinations of formats and flags. Bug: angleproject:2958 Change-Id: I56afb44496acd1b4d5a8527f4dbee29afbac9c81 Reviewed-on: https://chromium-review.googlesource.com/c/1398643 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi f83a28a6 2018-12-09T03:48:34 Vulkan: Shader path for framebuffer-to-texture copy Part 1 in a series of changes to perform image copies on the GPU. Bug: angleproject:2958 Change-Id: I6264a880865c4738c0866f2dc71af63425fc4118 Reviewed-on: https://chromium-review.googlesource.com/c/1370724 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 96bd8fdf 2018-11-30T14:30:18 Vulkan: Fix format properties queries When querying format properties (in vk::GetFormatProperties), the mandatory feature support table was consulted to check whether a number of texture features are present. If so, the entry from that table was returned. The goal had been to speed up initialization by not issuing device queries if possible. That is, when vk::GetFormatProperties was called on a format, if it supported that select few texture features, the VkFormatProperties entry from the mandatory table would be returned. However, that function found its way to other uses (such as querying buffer format properties, or other image properties beyond the select few). As a result, when the VkFormatProperties from the mandatory table was returned, actual support for these other features was often not tested and assumed false (unless they happened to be mandatory as well). This commit reworks the format feature query functions such that the specific features to be tested are provided when querying the format properties. The mandatory table is consulted as before, and if the entry doesn't contain those features, the device is queried and the results cached. Bug: angleproject:2958 Change-Id: I28d046eb63c3bd5173468aa4cb3e4c63c83e67b1 Reviewed-on: https://chromium-review.googlesource.com/c/1357152 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 654b3c56 2018-12-03T21:59:35 Vulkan: Fix multi-layer image readback The buffer size did not take layer count into account. angleproject: 2828 Change-Id: I94b9294503d785d3e727422550d7e4643eed1917 Reviewed-on: https://chromium-review.googlesource.com/c/1359618 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 254b32cb 2018-11-26T11:58:03 Vulkan: Make DynamicBuffer use BufferHelper This is so that the resulting buffers can be written to by the GPU. Additionally, the class is given the ability to create host-visible or device-local buffers, making map()-on-init() optional. This is in preparation for vertex/index transformations in compute. Bug: angleproject:2958 Change-Id: Ib8f5829e33a1e49fa8f80c70dbde74f313ae49ec Reviewed-on: https://chromium-review.googlesource.com/c/1351113 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0116a99c 2018-11-09T14:51:46 Vulkan: Emulate Luminance/Alpha with R8G8B8A8 TextureVk::copySubTextureImpl uses the format's pixelReadFunction and pixelWriteFunction and was using the angle format (i.e. the format the texture was created with) instead of the texture format (i.e. the actual format used by the backend) to read and write pixels. This was specifically to make Luminance/Alpha formats work. However, this was incorrect for any emulated format. This commit fixes the function to use the texture format. To avoid issues with Luminance/Alpha, this commit patches the pixel read/write changes for these formats before using them. Bug: angleproject:2913 Change-Id: I8981882b98502d869156a879bb7b5994943ecd8e Reviewed-on: https://chromium-review.googlesource.com/c/1330261 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 666818ea 2018-11-14T09:54:33 Use angle::Result in front-end (Part 8) Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi f87bd3dc 2018-11-08T00:30:30 Vulkan: Implement EXT_texture_filter_anisotropic Bug: angleproject:2901 Change-Id: If05b4a5270ac1c0bebc3fc854b2aff710e554ce1 Reviewed-on: https://chromium-review.googlesource.com/c/1325730 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov 27780295 2018-11-09T11:19:49 Vulkan: refactor WrappedObject descendants Methods receive VkDevice instead of Context and return VkResult instead of angle::Result now. Bug: angleproject:2657 Change-Id: I3eca8692ad0b3b6e96e31fd433ed14e04384990e Reviewed-on: https://chromium-review.googlesource.com/c/1330105 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 6f755b21 2018-10-09T12:48:54 Use angle::Result in front-end. (Part 1) This covers most of the hot paths used in draw calls. Gives in the order of a 5% reduction in draw call overhead. Bug: angleproject:2491 Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa Reviewed-on: https://chromium-review.googlesource.com/c/1258149 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 06270c9e 2018-10-03T17:00:25 Vulkan: Safer struct initialization Using x = {}; before filling out each field, we can be sure any missing field is 0 initialized. This in turn helps us not have to specify certain fields that are generally unused (at the moment), such as pNext. Bug: angleproject:2860 Change-Id: Ia1fa2db3ecfb316673a02ac0c5e13e47e055a19f Reviewed-on: https://chromium-review.googlesource.com/c/1259764 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Brandon Jones 4e6f2aea 2018-09-19T11:09:51 Implement ANGLE_copy_texture_3d Extension Adds copyTexture3DANGLE and copySubTexture3DANGLE that adds copy operations on volumetric textures. Bug: angleproject:2762 Test: angle_end2end_tests Change-Id: I0076989c2b7ed69abfc73143c325065bdb06a360 Reviewed-on: https://chromium-review.googlesource.com/c/1207216 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4d422c29 2018-10-02T09:31:40 Vulkan: Move blit mipmap init to ImageHelper. This hides the logic for manipulating the current layout and barriers into the image helper. This will make it easier to implement implicit pipeline barriers. It allows us to remove the updateLayout() hack. Bug: angleproject:2828 Change-Id: I3e59872e66064e6b105c1f398b4212fb3a6be1a7 Reviewed-on: https://chromium-review.googlesource.com/1255506 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill c2116cd3 2018-10-02T09:31:40 Vulkan: Update pipeline barrier interface. This makes the vk::CommandBuffer class closer to an auto-generated wrapper class. Bug: angleproject:2828 Change-Id: I91ba03914a60d5612707dd240fcda25b86cf2c46 Reviewed-on: https://chromium-review.googlesource.com/1255505 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Frank Henigman 1ffad843 2018-09-24T23:40:45 Remove PixelPackState from PackPixelsParams. Only one flag ("reverseRowOrder") from PixelPackState was being used, so instead of including the entire struct in PackPixelsParams, just include the one flag. BUG=angleproject:2718 Change-Id: I32e8b30383d198ecba9bf1719c32dda0938fc969 Reviewed-on: https://chromium-review.googlesource.com/1242210 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com>
Jamie Madill 9d597f8a 2018-10-01T10:15:36 Vulkan: Use copyImageDataToBuffer in Texture mipmap gen. There were two code paths using nearly identical code. Fix this by generalizing the helper method slightly. Refactoring change only. Bug: angleproject:2828 Change-Id: I39caccfaad4880e566e995483b8e8fb46d67d3da Reviewed-on: https://chromium-review.googlesource.com/1249563 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5ddbdbf7 2018-10-01T10:15:37 Vulkan: Fix bugs in glGenerateMipmaps. We had two separate minor bugs. 1) missing a flush of the image data and 2) missing an initial barrier to set the image to TRANSFER_DST. Bug: angleproject:2652 Bug: angleproject:2653 Change-Id: I485aafc5c9055b5efb101cb2bc3ebab0588d2639 Reviewed-on: https://chromium-review.googlesource.com/1249564 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill e8dd0796 2018-09-27T15:04:27 Vulkan: Make vk::FramebufferHelper the graph resource. It seems conceptually easier to understand that a vk::Framebuffer is the resource used in graph. Rather than making the GraphResource be integrated into the FramebufferVk class itself. This means that the only objects that are graph resources are Vulkan objects: Images, Buffers, and Framebuffers. Refactoring change only. Bug: angleproject:2828 Change-Id: I59d60643182287d4b1fcf9730a3c3a0da5b65973 Reviewed-on: https://chromium-review.googlesource.com/1249561 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 2d03ff4a 2018-09-27T15:04:26 Vulkan: Make Buffer/Image be CommandGraphResources. Don't make TextureVk/RenderbufferVk/SurfaceVk/BufferVk own the manipulation of the command graph. Instead put the operations close to the buffers and images used to render. This will lead towards implementing implicit barriers on the command graph resources. Bug: angleproject:2828 Change-Id: I07b742b6792c60285b280d6454f90e963d667e0e Reviewed-on: https://chromium-review.googlesource.com/1246983 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 95bba6e5 2018-08-29T11:02:49 Vulkan: Use automatic row length and image height for texture copies. CopyTextureChromium sometimes failed because of incorrect image dimensions being used in the image copy command. Simply use 0, the images are all tightly packed. BUG=angleproject:2723 Change-Id: I2332561bdc9ee70ba07101bcf2db7ea9f2355844 Reviewed-on: https://chromium-review.googlesource.com/1194907 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e2d2270a 2018-09-19T08:11:48 Vulkan: Merge append/beginWriteResource. The new API is named 'recordCommands'. These two APIs were basically doing the same thing. We don't need to have an understanding of creating a new graph node to know that we want to record some Vulkan commands to a command buffer. The prior design was actually masking a bug where we would allow appending commands to a command graph node that had already started a render pass. Fix this by adding a render pass check to recordCommands. Also removes 'hasStartedWriteResource' since this method wasn't used anywhere. Also renames 'onResourceChanged' to 'finishCurrentCommands'. Bug: angleproject:2828 Change-Id: I00bd5b893fcfc37172b6c1706cb2f5fc57e79f54 Reviewed-on: https://chromium-review.googlesource.com/1235654 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 55e57f96 2018-09-18T11:32:43 Remove some redundant dirty bits notifications. These were already being signaled in the front end. Bug: angleproject:2763 Change-Id: Id78d3d764e80e687c29c08395b59048d314bfbe2 Reviewed-on: https://chromium-review.googlesource.com/1204490 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3f3b358f 2018-09-14T10:38:44 Vulkan: Fix cube map attachment clears and readpixels. These were both missing the correct layer offset. Cache the layer inside the RenderTargetVk for easy access. Bug: angleproject:2470 Change-Id: I690dbf0702d7ec52f44ba0a9429b6ef0e51baf6b Reviewed-on: https://chromium-review.googlesource.com/1225910 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 7f232939 2018-09-12T11:03:06 Run git cl format on several files. Bug: angleproject:2763 Change-Id: Idcb8a714a6dccdff3dd953679e17a7314866a37d Reviewed-on: https://chromium-review.googlesource.com/1214206 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 097d3c0c 2018-09-12T11:03:05 Make SamplerState a contained class. This will more easily allow us to use a cached completeness comparison value. The cached value only gets updated on certain setters. Bug: angleproject:2763 Change-Id: Ib80db8517560617087ae8360f7af69d6c2392b76 Reviewed-on: https://chromium-review.googlesource.com/1171507 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 71bb0267 2018-09-12T11:09:42 Vulkan: Implement cube map render targets. Each TextureVk now stores vectors of RenderTargetVks and ImageViews associated with the image faces. They are initialized lazily when the RenderTarget is queried in getAttachmentRenderTarget. There's still one missing edge case for handling clear with the Framebuffer when using cube maps. Also one additional test failure on Android. Bug: angleproject:2470 Change-Id: Ib959a3434a992cef010a11940cf2ee49e118ac17 Reviewed-on: https://chromium-review.googlesource.com/1220727 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0d0fb43f 2018-09-07T17:43:32 Pass unpack buffer as explicit parameter to texSubImage. This allows us to override it in the incomplete texture init. Any back-end that used incomplete textures was vulnerable to a bug where the unpack buffer would be used to initialize the incomplete texture. Bug: chromium:880906 Change-Id: Ica558e4a4d81de9212f0bc6619ccd812a048ad45 Reviewed-on: https://chromium-review.googlesource.com/1214207 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3e29cf31 2018-08-31T17:19:17 Vulkan: Fix redefining TexStorage after TexImage. This can be easily implemented via a release call. Bug: angleproject:2651 Change-Id: I0adb3ed385284c6342716cd7c347de9966a81bab Reviewed-on: https://chromium-review.googlesource.com/1200368 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4c310831 2018-08-29T13:43:17 Vulkan: Return VkDeviceSize from DynamicBuffer. This obviates many static_casts. More closely represents what Vulkan is doing. One cast remains where we are using uint32_t for dynamic offsets with uniform buffers. Bug: angleproject:2786 Change-Id: I043ebb5d965f46ee6ebbfcb91d75a58508cacfe3 Reviewed-on: https://chromium-review.googlesource.com/1188949 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 522095f7 2018-07-23T14:59:41 Rename "color" functions to "pixel" functions. This extends of the copy, read and write functions to cover depth and stencil formats. Refactoring change only. Bug: angleproject:2673 Change-Id: I4b0b2f4cf8621051cacd95cdbd6d70f94ca612e2 Reviewed-on: https://chromium-review.googlesource.com/1147152 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill db9c69ed 2018-07-18T17:23:47 Make PackPixels take an angle::Format. This removes the format type parameter from places where it isn't needed. It also removes the 'write color' functions map. This map was redundant with the angle::Format write function. Bug: angleproject:2729 Change-Id: I24e4548a89342237d7ed25180fea156fba51ccab Reviewed-on: https://chromium-review.googlesource.com/1142300 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill c685586b 2018-07-18T15:06:54 Vulkan: Fix size_t warning in TextureVk. Bug: angleproject:2740 Change-Id: I5f942e3add90b0cbf82aff7280d3a256ee60ac3b Reviewed-on: https://chromium-review.googlesource.com/1142381 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang d691aeeb 2018-07-11T16:32:06 Vulkan: Implement GL_CHROMIUM_copy_texture with CPU copies. BUG=angleproject:2723 Change-Id: Ic3905531d3e91f94ff0ce10a09ca5dcdf643e21f Reviewed-on: https://chromium-review.googlesource.com/1134084 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Frank Henigman d9618bf4 2018-06-24T19:57:31 Vulkan: prepare for buffer format fallbacks. Generate code for buffer fallbacks as well as texture fallbacks. No functional change. BUG=angleproject:2405 Change-Id: I9f30a2cbb3cd9ba1d18474f99cba434b030b0232 Reviewed-on: https://chromium-review.googlesource.com/1113026 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 21061026 2018-07-12T23:56:30 Vulkan: Use angle::Result error handling. Introduces a vk::Context class to contain an error handler and Renderer pointer. This abtracts the common code path for ContextVk + DisplayVk. Removes vk::Error in favor of the POD angle::Result class. There are a few remaining usages of gl::Error that will have to be cleaned up when we can change the front-end APIs. Bug: angleproject:2713 Change-Id: I5e68f223d595c6c561b59d6a85759e5738ed43c6 Reviewed-on: https://chromium-review.googlesource.com/1128924 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron 1617e69e 2018-07-11T11:08:19 Vulkan: Implement depth/stencil blit with flip of the viewport - This makes all end2end tests pass successfully on Win/Nvidia with viewport flipping enabled. Bug: angleproject:2673 Change-Id: I031c0a0f5fb0aede58b59479e57c2c127bcb964c Reviewed-on: https://chromium-review.googlesource.com/1133703 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill eebe2190 2018-07-11T09:01:18 Vulkan: Clean up Error usage. * Adds a nodiscard to the Error class. * Fixes the places where Error was discard. * Uses more vk::Error instead of gl::Error. This enables the Vulkan back-end Error refactoring. Bug: angleproject:2713 Change-Id: I09606d965e8b7cfd341ad7fb95cf029b9d694ef4 Reviewed-on: https://chromium-review.googlesource.com/1128922 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill dec86230 2018-07-11T09:01:18 Generalize Context scratch buffer errors. This refactor will allow us to generate different error types in different backends. This makes Vulkan happy because it won't have to generate gl::Errors and can stay with vk::Error. Bug: angleproject:2713 Change-Id: I981402450f3b519d4f79851982547695d583355a Reviewed-on: https://chromium-review.googlesource.com/1128921 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill ca2ff38b 2018-07-11T09:01:17 Refactor internal format pixel math methods. This removes the use of the ErrorOrResult class from these methods. This will enable more performant Error handling. Also cleans up the ANGLE_TRY_CHECKED_MATH macro to be more general. Bug: angleproject:2713 Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08 Reviewed-on: https://chromium-review.googlesource.com/1128920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron aa2126c4 2018-07-09T15:36:36 Vulkan: Fix all copyTexImage/copySubTexImage cases with Y flip - Validated by running: -functional_texture_specification_basic_copytexsubimage2d_* -functional_texture_specification_basic_copyteximage2d_* With the flip flag enabled. Bug: angleproject:2673 Change-Id: I5a3041af79f9316256b0650ab7e3fd0e086e46e3 Reviewed-on: https://chromium-review.googlesource.com/1129820 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron c94ba1d5 2018-06-18T11:26:28 Vulkan: Enable a bunch of texture related tests Also adds a small bugfix in PixelBuffer::stageSubresourceUpdateFromFramebuffer where we weren't using the right format for the pack pixels params. The format should be unsized so that the fastcopyfunc / colorwritefunc / colorreadfunc are found correctly if needed when packing pixels. Bug: angleproject:2653 Bug: angleproject:2501 Change-Id: Ie4aacc623ddc9583360ab0c99be19d3db2bdbf44 Reviewed-on: https://chromium-review.googlesource.com/1104395 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron f6e160fa 2018-06-12T10:13:57 Vulkan: Don't use swizzle state when its not needed Enables a bunch of dEQP tests in the functional.fbo.render.* namespace. Bug: angleproject:2597 Change-Id: I1a06b335d5daf2987df52c460903081860887ce9 Reviewed-on: https://chromium-review.googlesource.com/1097596 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 2f3f4141 2018-05-30T08:27:19 Vulkan: Fix texture completeness issues The fix is to skip updates that are queued that are not valid for the current image description. We keep these around in case they are used in a later usage of the same texture but we issue a warning telling the user that memory will be used indefinitely until they use that data. Bug: angleproject:2596 Change-Id: I8c20fffbd473ae8e2e9d2123a49b675b824a9bf6 Reviewed-on: https://chromium-review.googlesource.com/1078913 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron 05cd6dfc 2018-05-24T15:51:29 Vulkan: generateMipmaps with vkCmdBlitImage when possible Bug: angleproject:2502 Change-Id: Ib32a128a453749c59d751e996017a8a6e2a9972e Reviewed-on: https://chromium-review.googlesource.com/1072550 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill c57ee259 2018-05-30T19:53:48 Vulkan: Clean up object releasing APIs. This cleans up the confusing releaseResource/releaseObject pair in the RendererVk class. It also makes getQueueSerial private in ResourceVk but keeps a public isResourceInUse API for external use. Bug: angleproject:2539 Change-Id: I6b4f24db16e36130a85ef03fc2c3b26d8d9e1fba Reviewed-on: https://chromium-review.googlesource.com/1069291 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 5dca651f 2018-05-30T10:53:51 Vulkan: Make Resource's updateSerial private. This simplifies the API from the calling resource classes. This method is called internally instead. beginWriteResource and appendWriteResource both call updateSerial internally. Additionally this removes hasStartedRenderPass and instead returns a boolean from appendToStartedRenderPass indicating success. Bug: angleproject:2539 Change-Id: Idcf72e6a80dde90e83dabc64644051bb536c6b12 Reviewed-on: https://chromium-review.googlesource.com/1066554 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron c20b950e 2018-05-24T09:30:17 Vulkan: Fix clear of specific mip level was clearing all mip levels Bug: angleproject:2502 Change-Id: Iffa012dce14584318c4dfd3d9b3a304291c9cebf Reviewed-on: https://chromium-review.googlesource.com/1070666 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 22695bf5 2018-05-22T15:52:08 Vulkan: Support cube mimaps generation Bug: angleproject:2502 Change-Id: I953d99d04608cec04aad824b8b38f388ed1e4c2b Reviewed-on: https://chromium-review.googlesource.com/1069544 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron c5181706 2018-05-17T09:44:42 Vulkan: generateMipmaps for 2D textures - This implements cpu-only mipmaps generation. To do in the next CLs: - Cube textures support - GPU faster path with vkCmdBlitImage - Find the bug with clearing of level 0 mips. - Investigate the intel linux specific bug. Bug: angleproject:2502 Change-Id: Iecd73cb45ebc9c79ce6291c4529eb27330b51e2c Reviewed-on: https://chromium-review.googlesource.com/1064194 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 316c6065 2018-05-29T10:49:45 Vulkan: Call GraphResource instead of GraphNode. We don't need to use the CommandGraphNode class directly. This CL consolidates our code so we never call the GraphNodes class directly. Instead we call operations on GraphResource. This should simplify the interaction with APIs from the various graph and dependency management classes in the Vulkan back-end. A new concept of 'starting' vs 'appending' commands is introduced. Appending tries to avoid starting new command buffers when possible. Should not change how the graphs are constructed, and mostly be a refactoring change. There may be minor behaviour changes to some commands. Bug: angleproject:2539 Change-Id: Ia971e5cacb1164b9b3b22fa4a0a55b954d81f10e Reviewed-on: https://chromium-review.googlesource.com/1052068 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill bcf467f2 2018-05-23T09:46:00 Vulkan: Encapsulate RenderTargetVk. This makes the members private and adds more functionality. This moves more responsibility out of vk::CommandGraphNode and also makes the RenderPass init in the CommandGraphNode class better encapsulated. Bug: angleproject:2539 Change-Id: Ia16f3f39cf011548c6473805b8b28e284808e856 Reviewed-on: https://chromium-review.googlesource.com/1040279 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 58675016 2018-05-22T14:54:07 Vulkan: Refactor CopyTexImage to use readPixelsImpl. It turns out it won't be easy to just use the RenderTargetVk and CommandBuffer with the Command Graph refactor. Better to use the FramebufferVk directly. Also cleans up a few incidental style issues. Bug: angleproject:2539 Change-Id: I73c2767072a84e9e5042361c7bdf4e9aef0f8ac7 Reviewed-on: https://chromium-review.googlesource.com/1066471 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jeff Gilbert 31d3deb4 2018-05-18T18:32:16 Add `formatType` arg to computeSkipBytes. Fix texture upload format tests: - Format tests should definitely run on ES3 also. - Also set filters to NEAREST since some formats aren't filterable. - Fix RGB9_E5 test reference encoding and add a test for it. - True int/uint textures require i/usamplers. Bug: angleproject:2576 Change-Id: Ia5bac34cdee6554a88db339de443689a71a0cf70 Reviewed-on: https://chromium-review.googlesource.com/1068142 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 534b00db 2018-05-18T08:16:53 Vulkan: readPixels improvement - use DynamicBuffer Reintroduce the change that was previously reverted here: https://chromium-review.googlesource.com/c/angle/angle/+/1064770 This includes a tentative fix the issue on Android that prompted the revert, we need to call invalidate on the mapped memory range before we read it on the host side. Bug: angleproject:2480 Change-Id: Id637bafa2845628ae38483c6fc8e6d7f26ad2d3e Reviewed-on: https://chromium-review.googlesource.com/1066229 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Luc Ferron a9ab0f37 2018-05-17T17:03:55 Vulkan: Fix DynamicBuffer usages, need to use specific alignment The alignment used to allocate VkBuffers in the VkBuffer needs to be at least the size of the nonCoherentAtomSize defined in the limits of the VkDevicePhysicalProperties. The latest roll of the vulkan-validation-layers added that check and caused a bunch of errors. This is fixing them. Bug: angleproject:2565 Change-Id: Ia2ad506dce7966adb6220c52ea891903922c47d0 Reviewed-on: https://chromium-review.googlesource.com/1064950 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron dd565786 2018-05-18T11:39:49 Revert "Vulkan: readPixels improvement - use DynamicBuffer" The tentative fix did not fix the issue on Android Nexus 5x. This reverts commit 8688bf46f1835dbe7fff4480350b1bc0ef02ff78. NOTRY=true Change-Id: If4a517028951a2232a87aeaf1045a5df731d17d3 Reviewed-on: https://chromium-review.googlesource.com/1065578 Reviewed-by: Luc Ferron <lucferron@chromium.org>
Luc Ferron 8688bf46 2018-05-18T08:16:53 Vulkan: readPixels improvement - use DynamicBuffer Reintroduce the change that was previously reverted here: https://chromium-review.googlesource.com/c/angle/angle/+/1064770 This includes a tentative fix the issue on Android that prompted the revert. Bug: angleproject:2480 Change-Id: I04be55d9dead00500adaa5f56458cb93957f2535 Reviewed-on: https://chromium-review.googlesource.com/1065799 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 6c6c76c0 2018-05-17T18:45:06 Revert "Vulkan: readPixels improvement - use DynamicBuffer" This reverts commit 82a420bb9af221e659b9510aed6791a87ac97b25. Reason for revert: breaks readPixels on Android, probably because memory there is not host coherent by default. Original change's description: > Vulkan: readPixels improvement - use DynamicBuffer > > - Instead of using a new Staging image everytime, we now > just use a DynamicBuffer that should be bit less wasteful. > > Bug: angleproject:2480 > > Change-Id: I09edfb16f6ec49a0ca320d9e5dd9ce34e9dbf99e > Reviewed-on: https://chromium-review.googlesource.com/1059452 > Commit-Queue: Luc Ferron <lucferron@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,lucferron@chromium.org Change-Id: Id7c493915ec7131f5202a7224267a79cd53007d2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2480 Reviewed-on: https://chromium-review.googlesource.com/1064770 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Luc Ferron 82a420bb 2018-05-15T12:55:21 Vulkan: readPixels improvement - use DynamicBuffer - Instead of using a new Staging image everytime, we now just use a DynamicBuffer that should be bit less wasteful. Bug: angleproject:2480 Change-Id: I09edfb16f6ec49a0ca320d9e5dd9ce34e9dbf99e Reviewed-on: https://chromium-review.googlesource.com/1059452 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron f299a378 2018-05-14T14:44:54 Vulkan: Implement copyImage and enable all tests for it Bug: angleproject:2500 Change-Id: I9066861ed4db0330754b32995ed82c658d66a590 Reviewed-on: https://chromium-review.googlesource.com/1058034 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron daf7ace5 2018-05-14T13:44:15 Vulkan: Finish implementation of the copySubImage - Enables all dEQP tests left for copySubImage. Bug: angleproject:2501 Change-Id: I8ae301a94e9039f24e0a20b8fd4afdf7e65659f7 Reviewed-on: https://chromium-review.googlesource.com/1057904 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 018709fd 2018-05-10T13:53:11 Vulkan: Basic support of copySubImage - Implement basic path that does a cpu readback for everything and establish conformance for every case except the ones that need conversion. - Enables most copy sub image dEQP tests. Bug: angleproject:2501 Change-Id: Ib67c184894625dde850f320c40fe51fe70ba974f Reviewed-on: https://chromium-review.googlesource.com/1054387 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 2a849bf3 2018-05-10T13:19:11 Vulkan: Pre-work for copyImage/copySubImage features - Add vkCmdCopyImageToBuffer support in CommandBuffer - Add a new function in the PixelBuffer to support staging changes coming from an image. Bug: angleproject:2500 Bug: angleproject:2501 Change-Id: Ic29101391edc6f25a71dcd318bc8a72b2ae1a054 Reviewed-on: https://chromium-review.googlesource.com/1054104 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 90968360 2018-05-04T08:47:22 Vulkan: Incomplete textures support 2D multisample is out of scope since its ES 3 only. Bug: angleproject:2499 Change-Id: Id5f81d713a2882ba2a91b7d3f281d71a3e9289f4 Reviewed-on: https://chromium-review.googlesource.com/1046786 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 61859817 2018-05-09T14:17:39 Vulkan: Fix use-after-free with DynamicBuffer. The implementation of DynamicBuffer before my changes could have some issues in the following use case: - Allocate buffer 1 for Texture 1 (with size as big as the full buffer size) - Allocate buffer 2 for Texture 2 (triggers creation of a new underlying BufferVk and releases the buffer 1 to the Renderer) - Render with Texture 2 (texture 1 hasn't been flushed yet) - swap buffers (causes garbage in the renderer to be cleaned up) - Try rendering with Texture 1, and you'll get an error stating that the buffer we're trying to copy is not valid (because its already been freed). This set of changes: - Add a new test that specifically triggers this case. - enables the texture.filtering.cube* tests in dEQP. - Fixes the issue by adding a manual releasing pattern of the buffers in DynamicBuffer. Bug: angleproject:2505 Change-Id: I207ce4a694016766f008cca67d82b252f460e0df Reviewed-on: https://chromium-review.googlesource.com/1052551 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron 7348fc5b 2018-05-09T07:17:16 Vulkan: Clear to opaque black instead of transparent This is a problem when we emulate RGB8 with RGBA8. Bug: angleproject:2536 Change-Id: I5665e513ef0138bc56f52ba35342378d8392989f Reviewed-on: https://chromium-review.googlesource.com/1051687 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron fa7503ca 2018-05-08T11:25:06 Vulkan: Support EXT_texture_storage This is a prerequisite to support incomplete textures. Bug: angleproject:2536 Change-Id: Ica40bbd185a67253f457148007b08f6735da788c Reviewed-on: https://chromium-review.googlesource.com/1050308 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill b221486a 2018-04-26T07:25:48 Vulkan: Fix TexSubImage2D state change test. Was simply a matter of triggering a new write node in the subImage call. Bug: angleproject:2495 Change-Id: I06334ba6ee816f671e5c599c8e8f079f56adb25e Reviewed-on: https://chromium-review.googlesource.com/1028729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Luc Ferron 1a186b16 2018-04-24T15:25:35 Vulkan: Fix issue with texsubimage2d barriers Also re-enable the Windows AMD tests that were suppressed because of that bug. Bug: angleproject:2492 Change-Id: Ie9b5eb4c5705bbb390c3899fe4c66d3e47eff00d Reviewed-on: https://chromium-review.googlesource.com/1026461 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 10434f67 2018-04-24T10:06:37 Vulkan: Issue when drawing with a texture and rebinding after. Added 2 tests in StateChangeTest.cpp to validate the behavior and reproduce the issue I saw in dEQP. Bug: angleproject:2479 Change-Id: I29c3da0474ec2b13a10fc266284cb19a07675da2 Reviewed-on: https://chromium-review.googlesource.com/1025951 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 33e05bab 2018-04-23T15:12:34 Vulkan: Bugfix in TextureVk::setSubImage and DynamicBuffer Bug 1) The offset wasn't plumbed through for setSubImage. Bug 2) The DynamicBuffer allocation sometime allocates a bit more than requested, but we were using the size requested as the next offset instead of the actual allocated size. This could get us in a situation in certain corner cases where the next allocation would be done on the said buffer instead of using a new allocation as it should. Also enables a bunch of new texture_specification_* tests that were unable to run successfully without these 2 bug fixes. Found a weird issue on WIN AMD only and suppressed these tests for now. Will investigate part of the same bug number as a separate change. Bug: angleproject:2495 Bug: angleproject:2492 Change-Id: I490b1bf2d1795b7a1033365e29eac12a8bc50bff Reviewed-on: https://chromium-review.googlesource.com/1024380 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>