include/platform/FeaturesVk.h


Log

Author Commit Date CI Message
Mohan Maiya f9ade9fb 2022-02-18T15:08:54 Vulkan: Add feature to create pipeline during glLinkProgram Creating the pipeline will trigger the compilation of shaders to byte code thus warming up Vulkan shader caches. Typically most apps call into glLinkPrograms during app loadtime and the goal is to improve cache hit rate and reduce CPU workload during game play. Bug: angleproject:7046 Test: ProgramBinary*CreatePipelineDuringLink* Change-Id: I71351d45a9aa84e220ca38503735e94cff1dcf98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3478354 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Jeff Vigil 51967b4f 2022-02-11T13:01:54 Vulkan: Fix enabling external fences and semaphores These capabilities are Instance extensions need fixed to enable Native fences for Android Bug: angleproject:7009 Change-Id: I9f07dc88cabd52712ebde28ba938662d7773c8b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3457743 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Ian Elliott 5e87ae0a 2022-03-01T12:41:00 Use VK_ANDROID_surfaceless_query for EGLConfig formats That extension allows DisplayVkAndroid::generateConfigs() to query the swapchain formats (but not yet colorspaces) before ANGLE is given any VkSurfaceKHR. This is used for creating EGLConfig's with GL_RGB10_A2 and GL_RGBA16F. Bug: b/203826952 Change-Id: I55302c98641fbce93f7af428087430763676bdb4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3492482 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Trevor David Black <vantablack@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Mohan Maiya 671fcf73 2022-02-16T14:22:38 Vulkan: Add a feature to retain SPIR-V debug info Add a feature to retain debug info in SPIR-V blob. It is enabled when validation layers are enabled. Bug: angleproject:5901 Change-Id: Iccdff31ae0f12fc95d59d20e43e94b6f3d1ae00e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2850388 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Shahbaz Youssefi d285d6a7 2021-11-23T23:12:00 Vulkan: Use VK_EXT_depth_clip_control Bug: angleproject:6679 Change-Id: Iea3b7a2d8db630dcea19836732de8f9e0a7a568f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3298356 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao 419bca3f 2022-01-19T18:22:56 Vulkan: Use Vulkan API directly for BufferPool's buffer allocation There are two motivations in this CL. 1) There are two layers of suballocator right now. BufferPool provides first suballocation. It tries to allocate from one of the buffers in the pool. If that failed, it try to create a new BufferBlock (i.e, a VkBuffer). Right now that calls into VMA which creates another pool to allocate a buffer. We really only need one layer of suballocation. And 2) Because we uses VMA to do actual VkBuffer allocation, we have to use Allocator object. But VMA can not handle external buffers, so we end up having a BufferMemory class just to handle two different cases. This CL attempts to clean up this by let ANGLE calling into vulkan driver directly for the actual buffer allocation, just like we did for VkImages. By doing so, we able to remove BufferHelper::mMemory data member as well as BufferMemory class all together. External memory is now treated exactly the same at BufferHelper. Bug: b/205337962 Change-Id: I7c183ab0fd7d9aceb6cf416b0214c300798bc010 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3402740 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Mohan Maiya 1b9774f5 2022-01-26T13:37:03 Vulkan: Force submit updates to immutable textures Submit immutable texture updates recorded in outside renderpass commands when the following conditions are met - 1. "forceSubmitImmutableTextureUpdates" feature is enabled 2. The texture is immutable This works around a problem that manifests in some applications that do not perform appropriate synchronization of shared contexts. Bug: angleproject:6929 Test: EGLContextSharingTestNoSyncTextureUploads.* Change-Id: I2a237046e2cc53650eb8dc07e3697f7481df9b02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3418138 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Antonio Caggiano ac20272f 2022-01-19T17:13:50 Vulkan: Fix present region rectangles EGL rectangles are specified relative to the bottom-left of the surface, while Vulkan framebuffer space puts the origin on the top-left corner. Bug: angleproject:6933 Change-Id: Ia57eea8601ee724c0a82eb718d831de6b7566472 Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3423770 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 665ddccd 2021-12-09T23:06:39 Vulkan: Emulate dithering Dithering in OpenGL is vaguely defined, to the extent that no dithering is also a valid dithering algorithm. Dithering is enabled by default, but emulating it has a non-negligible cost. Similarly to some other GLES drivers, ANGLE enables dithering only on low-bit formats where visual banding is particularly common; namely RGBA4444, RGBA5551 and RGB565. Dithering is emulated in the fragment shader and is controlled by a spec constant. Every 2 bits of the spec constant correspond to one attachment, with the value indicating: - 00: No dithering - 01: Dither for RGBA4444 - 10: Dither for RGBA5551 - 11: Dither for RGB565 The translator appends code to the shader that, based on the format specified by the specialization constant, adds dithering to each color attachment output. A 2x2 Bayer matrix is used for dithering, indexed by gl_FragCoord.xy % 2. Bug: angleproject:6755 Change-Id: Ib45da5938e299b6626bff921119d63e7357dd353 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3374261 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil e03f1753 2022-01-06T09:48:12 EGL: mutable_render_buffer deferredFlush fix When in SINGLE_BUFFER mode, need to get around deferredFlush and call Swapbuffers to force update This must do status check for OUT_OF_DATE. Bug: angleproject:6878 Change-Id: I34b7381f6799879bf6f6d490aba02feffc5c3748 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3373739 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d6dd0cb5 2021-09-21T15:26:13 EGL: EGL_KHR_lock_surface3 backend Add vulkan implementation Add test: EGLLockSurface3Test Test: angle_end2end_test --gtest_filter=EGLLockSurface3Test Bug: angleproject:6062 Change-Id: Id5bfe37895b550392d11e9e9cc1262c1f0288c42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3174323 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop fa3241b7 2022-01-13T17:56:52 Vulkan: Move shader_framebuffer_fetch to FeaturesVk Per feedback in http://crrev/c/3371244, move the new and existing checks for whether the extension should be enabled. Controlling them based on hardware vendor should be done with FeaturesVK so we can centralize our workarounds. Also remove the envvar-based override for non-coherent extension. It can now be forced using ANGLE's feature system. The new way to force the override is: ANGLE_FEATURE_OVERRIDES_ENABLED=supportsShaderFramebufferFetchNonCoherent or on Android: debug.angle.feature_overrides_enabled=supportsShaderFramebufferFetchNonCoherent Bug: b/201764768 Bug: angleproject:6519 Bug: angleproject:6870 Bug: angleproject:6872 Change-Id: Ie78ebfa94807a156b9e7f704e8a36cd38b85f878 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3389707 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Roman Lavrov 345cdcb0 2022-01-10T22:41:46 Rename features for consistency. supports_custom_border_color -> supportsCustomBorderColor supports_protected_memory -> supportsProtectedMemory Also drop EXT from the end of the variable name as other variables don't have that. Bug: angleproject:6731 Change-Id: I60b20d84387bccbca0c4c1cbc7e341c1f5e8f0ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3378827 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi b7a42c88 2021-12-13T15:53:07 Vulkan: Remove VK_EXT_swapchain_colorspace check We don't make use of this extension since https://chromium-review.googlesource.com/c/angle/angle/+/3208689. Bug: angleproject:2514 Change-Id: I8b8edf5006ac1c3eeeefcadbe77249a5a6a5dda7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3335070 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi d0287552 2021-11-15T08:51:41 Reland "Vulkan: Implement GL_EXT_multi_draw_indirect" This is a reland of 79f9d163b4227115a3e60e027ec4d7dbe0495f64 * Added drawcount > 1 as a condition to fall back to MultiDraw*IndirectGeneral(). * Expanded the tests to include cases with disabled support for multiDrawIndirect. Original change's description: > Vulkan: Implement GL_EXT_multi_draw_indirect > > * Optimized the implementations of multiDrawArraysIndirect() > and multiDrawElementsIndirect() for Vulkan > * Added helper functions to support drawArraysIndirect() and > drawElementsIndirect() as special cases of multiDraw*Indirect > functions. > * Added the flag to enable the multiDrawIndirect feature > (drawCount > 1). The generic implementation is used if the > flag is disabled. > > Bug: angleproject:6439 > Change-Id: Ibc653d93d355657f828de9c33da22428629e450f > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276044 > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6439 Change-Id: I96c015855fabc8abbb87320a5ca71a8d92d61954 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313412 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Ian Elliott 24241724 2021-11-22T13:26:53 Reland: Vulkan: Use vkResetQueryPoolEXT when available This is a reland of 97aa5187ed164f1e9a22b64c966f2a747f651bfb Original change's description: > ANGLE currently uses vkCmdResetQueryPool to reset a query pool. As > reported by Arm, this can cause GPU bubbles. It is better to use > vkResetQueryPoolEXT() when available (either by Vulkan 1.2 or by the > VK_EXT_host_query_reset extension). > > Bug: angleproject:6692 > Change-Id: I650d7d0f55bdf6587b75be43cc7bed2dc3eb935a > Reviewed-on: > https://chromium-review.googlesource.com/c/angle/angle/+/3294061 > Commit-Queue: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> Bug: angleproject:6692 Change-Id: Idff87977bd39ccd1d05684e48929f4cd3fa733c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3313382 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Tim Van Patten 8e6f38e5 2021-12-02T17:24:32 Revert "Vulkan: Implement GL_EXT_multi_draw_indirect" This reverts commit 79f9d163b4227115a3e60e027ec4d7dbe0495f64. Reason for revert: Breaks dEQP-GLES31.functional.draw_indirect* on Pixel devices: https://blackbox.googleplex.com/dashboard/cts-graphics/target/git_master/oriole-userdebug/3/cts-angle-host-test-arm64-v8a/4 Original change's description: > Vulkan: Implement GL_EXT_multi_draw_indirect > > * Optimized the implementations of multiDrawArraysIndirect() > and multiDrawElementsIndirect() for Vulkan > * Added helper functions to support drawArraysIndirect() and > drawElementsIndirect() as special cases of multiDraw*Indirect > functions. > * Added the flag to enable the multiDrawIndirect feature > (drawCount > 1). The generic implementation is used if the > flag is disabled. > > Bug: angleproject:6439 > Change-Id: Ibc653d93d355657f828de9c33da22428629e450f > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276044 > Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:6439 Change-Id: Ia4d54ef3e7652febf4d77fdaf6809f57e8e29127 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3312829 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Ian Elliott 2fa1adf0 2021-11-24T18:29:13 Revert "Vulkan: Use vkResetQueryPoolEXT when available" This reverts commit 97aa5187ed164f1e9a22b64c966f2a747f651bfb. Reason for revert: This apparently caused crbug.com/1273344 Original change's description: > Vulkan: Use vkResetQueryPoolEXT when available > > ANGLE currently uses vkCmdResetQueryPool to reset a query pool. As > reported by Arm, this can cause GPU bubbles. It is better to use > vkResetQueryPoolEXT() when available (either by Vulkan 1.2 or by the > VK_EXT_host_query_reset extension). > > Bug: angleproject:6692 > Change-Id: I650d7d0f55bdf6587b75be43cc7bed2dc3eb935a > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3294061 > Commit-Queue: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Charlie Lao <cclao@google.com> Bug: angleproject:6692 Change-Id: I70d5eeb0b98f016fd262935194f8f4abee2a72b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3300309 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Amirali Abdolrashidi 79f9d163 2021-11-15T08:51:41 Vulkan: Implement GL_EXT_multi_draw_indirect * Optimized the implementations of multiDrawArraysIndirect() and multiDrawElementsIndirect() for Vulkan * Added helper functions to support drawArraysIndirect() and drawElementsIndirect() as special cases of multiDraw*Indirect functions. * Added the flag to enable the multiDrawIndirect feature (drawCount > 1). The generic implementation is used if the flag is disabled. Bug: angleproject:6439 Change-Id: Ibc653d93d355657f828de9c33da22428629e450f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276044 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Vigil 8b60855b 2021-09-15T15:16:10 EGL: implement EGL_KHR_mutable_render_buffer Pass render buffer mode change to WindowSurfaceVk. On mode change trigger OUT_OF_DATE. Then in CreateSwapchain, if new mode, set the Presentation mode and the Image count. OffscreenSurfaceVk ignores mode change. Add MUTABLE_RENDER_BUFFER_BIT to GenerateDefaultConfig. Test: dEQP-EGL.functional.mutable_render_buffer.* Bug: angleproject:3966 Change-Id: I7b59708514bcda10f8d45ce5f9528aa840fcccfa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3171822 Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 97aa5187 2021-11-22T13:26:53 Vulkan: Use vkResetQueryPoolEXT when available ANGLE currently uses vkCmdResetQueryPool to reset a query pool. As reported by Arm, this can cause GPU bubbles. It is better to use vkResetQueryPoolEXT() when available (either by Vulkan 1.2 or by the VK_EXT_host_query_reset extension). Bug: angleproject:6692 Change-Id: I650d7d0f55bdf6587b75be43cc7bed2dc3eb935a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3294061 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi dbc0c646 2021-11-06T01:09:26 Vulkan: Output the reason for RP closure in command buffer To make it easier when viewing the command buffer in a graphics debugger, this change inserts a marker just before closing the render pass that specifies why the render pass was closed. Bug: angleproject:2472 Change-Id: I862e500cd58332d6e199c853315c560fe6a73dc2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3265609 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 5d8a89e4 2021-11-02T19:57:04 Vulkan: Always override surface format GL_RGB8 to GL_RGBA8 If an app requests to create a surface with GL_RGB8, override it to be GL_RGBA8 for Android. This is to workaround an issue with the Android Vulkan loader which limits which formats can be used with swapchains. This CL also adds GL_RGB8 back to DisplayVkAndroid::generateConfigs(), effectively reverting the following CL: https://chromium-review.googlesource.com/c/angle/angle/+/3235466 This is being done with this CL (rather than reverting) since these changes are required to handle surfaces created with GL_RGB8. Bug: angleproject:6277 Bug: angleproject:6651 Change-Id: Iad78ea0d7bdf12e1e309ed6a7181f08fac38b9de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3258143 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi f3d5dac3 2021-08-23T17:25:15 Vulkan: SPIR-V Gen: Drop dependency to glslang The SPIR-V gen path is now made default. Compilation through glslang is still supported for debugging, and is enabled on the GLSL* end2end tests for smoke testing. On release builds, glslang is not supported. To test with glslang, add the following gn arg (only necessary if dcheck is disabled): angle_enable_spirv_gen_through_glslang = true Then enable the generateSPIRVThroughGlslang feature. This can be done by setting an environment variable: ANGLE_FEATURE_OVERRIDES_ENABLED=generateSPIRVThroughGlslang ./angle_deqp_gles2_tests Binary size saving: - 1.3MB on Linux (SPIR-V gen itself: 240KB) - 730KB on Android (SPIR-V gen itself: 140KB) Perf tests: - LinkProgramBenchmark.Run/vulkan_compile_single_thread * Through glslang: truncated mean: 1287033.36 * Direct SPIR-V Gen: truncated mean: 244495.91 (~80% reduction) - LinkProgramBenchmark.Run/vulkan_compile_multi_thread * Through glslang: truncated mean: 4565894.83 * Direct SPIR-V Gen: truncated mean: 1158164.10 (~75% reduction) Bug: angleproject:4889 Bug: angleproject:6210 Change-Id: I486342702977c8114e90073b97183aba115a8b2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3115140 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao ea580484 2021-10-05T13:40:01 Vulkan: Add feature flag to prefer CPU copy instead of staged update For ARM GPU, use GPU to do buffer to buffer copy has performance penalty due to potential bubble in the vertex pipeline. This CL adds a feature flag preferCPUForBufferDataSubData so that we can enable this behavior for ARM GPUs. This CL also tracks if GPU has referenced this BufferVk's storage since it got new storage. Due to sub-allocation, we may get a new sub-range of the same BufferHelper object when allocating new storage. But we currently do not have a way to track GPU progress of the sub-range of a buffer. So we will end up using BufferHelper's queueSerial to decide if it is still GPU busy or not. This CL adds mHasBeenReferencedByGPU boolean variable that will set to false when we got a new allocation and set to true as soon as buffer is been referenced by any GPU command. We use this to avoid checking queueSerial if it never been referenced by GPU. This is a temporary workaround for the bug, the full fix is tracked by https://issuetracker.google.com/201826021 Bug: b/200067929 Change-Id: I231fb0a678b0165a2ce1775d0aa4dbe7512fb4a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3183398 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 4f0e7e7f 2021-10-04T14:50:10 Vulkan: Remove extraCopyBufferRegion workaround. Bug: angleproject:2838 Change-Id: I53ba3cf307f930ae9550d1bfee4650df6e826930 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3202475 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 458389f2 2021-09-02T22:41:40 Vulkan: Support Linux dma-bufs This change adds support for EGL_EXT_image_dma_buf_import and EGL_EXT_image_dma_buf_import_modifiers on top of Vulkan's VK_EXT_external_memory_dma_buf and VK_EXT_image_drm_format_modifier. Bug: angleproject:6248 Change-Id: I581987f88e9ddcf351dc721f499f63912dca05f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3145610 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 371542cd 2021-08-23T23:10:09 Vulkan: Use VK_EXT_load_store_op_none With read-only depth/stencil attachments, ANGLE utilizes storeOp=NONE to optimize memory bandwidth (by avoiding write back of tile memory at the end of the render pass). Simultaneoulsy, this avoids a synchronization hazard with the next write to that depth/stencil image. If a framebuffer contains a depth/stencil attachment but it's unused, ANGLE utilizes loadOp=NONE/storeOp=NONE to effectively remove any memory bandwidth wasted on the attachment. Bug: angleproject:5371 Change-Id: I76cbadbf1194041532ac4b690ffe087298f2de51 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3114232 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 58ec0fbf 2021-09-02T11:47:48 Vulkan: Remove the forceCPUPathForCubeMapCopy workaround This workaround has been disabled since https://chromium-review.googlesource.com/c/angle/angle/+/2594707 Bug: angleproject:2822 Bug: angleproject:3055 Change-Id: Ie9cc12c7616cd9e1801dbd92e21822c63f4d0bef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3140214 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop ef96bde8 2021-08-28T23:59:33 Vulkan: Fix VVL error regarding geometryStreams Addresses new validation error: [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Validation Error: [ VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324 ] Object 0: handle = 0xb400007e8176af60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xf1034461 | pCreateInfos[0].pRasterizationState pNext chain includes VkPipelineRasterizationStateStreamCreateInfoEXT, but geometryStreams feature is not enabled. The Vulkan spec states: VkPhysicalDeviceTransformFeedbackFeaturesEXT::geometryStreams must be enabled (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-VkPipelineRasterizationStateStreamCreateInfoEXT-geometryStreams-02324) The validation was added in this commit: https://github.com/KhronosGroup/Vulkan-ValidationLayers/commit/bdaec8454a27e65dd81f46bbfad1889b7a3e34f6 Test: World of Kings MEC Bug: b/198101940 Bug: angleproject:6339 Change-Id: I3cfacc20d231d246500e83451c9ec6b74d9372f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3127942 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi d0c03ff4 2021-07-22T14:55:51 Vulkan: SPIR-V Gen: Fix lvalues passed to in/inout parameters In GLSL, these values are semantically copied when passed to a function as an in or inout parameter. For example in: bool f(inout vec4 a, inout vec4 b) { a = vec4(0); return all(equal(a, b)); } var = vec4(1); bool result = f(var, var); result is expected to be false. In SPIR-V, every parameter is semantically passed by "reference". glslang conservatively uses temporaries to pass to functions. An optimization in ANGLE didn't create temporaries for unindexed lvalues, which did not take into account the above fact. This optimization is limited to out parameters now. Bug: angleproject:4889 Change-Id: Ie1b4b1cecba847ba63d5810d01d0856823b89ddc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3046103 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d2b659f9 2021-03-25T15:40:58 EGL: implement EGL_EXT_protected_content Context Add Validation check to Contexts and Surfaces Add Vulkan protected memory features and properties Add protected member to Surfaces and Contexts Implement hasProtectedContent in Vulkan Add QueueFamily helper, extent DeviceQueueMap Protected Swapchains always on for Android Add EGLProtectedContentTest Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 31b06f5f 2021-07-12T10:06:04 Vulkan: Account for immutable samplers that need multiple descriptors It is valid for immutable samplers to need more than 1 descriptor count. Account for this possiblity while calculating descriptor pool size. Bug: b/155487768 Bug: angleproject:5033 Bug: angleproject:5773 Bug: angleproject:6141 Change-Id: Ifb0ed3e4b3c01c61d81dd0c628101f31d4c8bd05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3005329 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi 153240b2 2021-06-11T16:36:32 Vulkan: SPIR-V Gen: Support loops Loops are similar to if-else in that they generate a number of blocks where the first block specifies divergence (OpLoopMerge) and the merge block. Differently from if-else, there is a block where the condition is evaluated and a block which `continue;` leads to (this last block is the only one allowed to back-jump to the beginning of the loop). Bug: angleproject:4889 Change-Id: Ic59f4bf3e05fbf93cb5af85acd3bc4b0da8412af Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2957809 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 5b314268 2021-06-15T17:37:45 Vulkan: Support OVR_multiview and OVR_multiview2 Multiview is supported in Vulkan simply by specifying the number of views in the render pass, and creating the appropriate image views. A number of changes to the way image views and render targets are stored are made to support those that don't cover the entire range of layers. One particular detail that is not implemented in this change is the use of queries in combination with multiview. Vulkan specifies that N queries are actually produced (N being the number of views) which must be summed by the application, but this is not currently done. Bug: angleproject:6048 Change-Id: I1d4a9894c232d3a93d7a97c9fa0eedc334e57469 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2967625 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi b6adeb2f 2021-06-21T11:11:30 Vulkan: Use pipeline statistics query to emulate primitives generated The VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT query produces the same result as the GL primitives generated query. One caveat is that in combination with rasterizer discard this query may not work. This is emulated by disabling rasterizer discard when this query is active and applying an empty scissor instead. When VK_EXT_primitives_generated_query is released and supported, a similar issue with rasterizer discard persists so this change will facilitate using that extension as well. Bug: angleproject:5430 Change-Id: Id45b6f058c5cb6837e04aa64b1efde28c104e4cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2976181 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya dd312cc6 2021-05-21T08:49:48 Reland "Vulkan: Add support for EXT_texture_border_clamp" This is a reland of 4b92e089c01e94730fe26c4c743d76d6c935088d Initializes mPadding to 0 in SamplerDesc::update Original change's description: > Vulkan: Add support for EXT_texture_border_clamp > Add support for GL_EXT_texture_border_clamp. This is implemented by > using VK_EXT_custom_border_color. > > Bug: angleproject:3577 > Test: dEQP-GLES31.functional.texture.border_clamp* > Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Bug: angleproject:3577 Change-Id: I8684242c4bce6e1a006dbe926defaa495fcc2282 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911571 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Yuly Novikov 44fabb7b 2021-05-21T00:51:06 Revert "Vulkan: Add support for EXT_texture_border_clamp" This reverts commit 4b92e089c01e94730fe26c4c743d76d6c935088d. Reason for revert: breaks "Linux MSan Tests" bot https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/28489/overview Original change's description: > Vulkan: Add support for EXT_texture_border_clamp > > Add support for GL_EXT_texture_border_clamp. This is implemented by > using VK_EXT_custom_border_color. > > Bug: angleproject:3577 > Test: dEQP-GLES31.functional.texture.border_clamp* > Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Bug: angleproject:3577, angleproject:5996 Change-Id: I6b62f1a4a43fcfe2d0df2c73de24db83606ce430 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2911533 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi 9bc837f6 2021-04-07T15:24:12 Vulkan: Generate SPIR-V directly from the translator; Part 1 This is the first change in a series to generate SPIR-V directly from the translator's AST, instead of the generating text GLSL and feeding it to glslang. This change implements the majority of the work needed to map AST types to SPIR-V types, and declare types and interface variables in SPIR-V. Additionally, it lays the infrastructure to conditionally enabling this path in end2end tests. No tests are currently enabled as the change doesn't actually generate code for function bodies yet. Bug: angleproject:4889 Change-Id: Iacb28b6907fd48c50e4cc5a0e7ad72f6eed241d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2889603 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 4b92e089 2021-05-12T09:20:24 Vulkan: Add support for EXT_texture_border_clamp Add support for GL_EXT_texture_border_clamp. This is implemented by using VK_EXT_custom_border_color. Bug: angleproject:3577 Test: dEQP-GLES31.functional.texture.border_clamp* Change-Id: Ie9fa1eb5dd03b997b5ae182787641a53080a9e51 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830192 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Charlie Lao 09dad082 2021-05-07T17:28:15 Vulkan: Add feature flag to flush at framebuffer boundary Testing shows most app traces seeing performance improved on ARM GPU when we flush at FBO boundary instead of one submit per frame. This likely due to more frequent submission means less chance of GPU starvation. This also helps ANGLE to detect GPU finish at finer grain since the queue serial is per submission. Finer grain detection of object completion means memory gets recycled quicker and mapBufferRange able to hit fast code path more often. With this CL, manhattan 3.1 offscreen score also score improves 7%. This may also helps onscreen performance if frame time is on the edge of 16ms by submit FBO rendering earlier instead of been blocked by vkAcquireNextImage. Bug: b/187993625 Bug: angleproject:5295 Change-Id: I2946a7159231d36019ace89805a69ac8e906ce94 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2888709 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Geoff Lang ccd984ff 2021-04-08T12:06:57 Reland "Add a Vulkan feature to compress float32 vertex formats." This reverts commit 8ace36f8c15877264fb58af7b54baad635899dca. Original change's description: > Revert "Add a Vulkan feature to compress float32 vertex formats." > > Bug: b/167404532 > Bug: b/161716126 > Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011 > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Geoff Lang <geofflang@chromium.org> Bug: b/167404532 Bug: b/161716126 Change-Id: Ic6811fe3a7124e6eb1efe7c72a1a03a120217753 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815260 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Geoff Lang 065c2329 2021-04-08T11:59:43 Reland "Vulkan: Add features to modify sampling parameters" This reverts commit a51b57fa2dc73f8bc8acdf0b818cc0315fb23d75. Original change's description: > Revert "Vulkan: Add features to modify sampling parameters" > > Bug: b/167404532 > Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: b/167404532 Change-Id: I2c756b8eb0f61701ef6e33275e557bc199a4d3b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815259 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Nicolas Capens 15f4925a 2021-04-12T15:38:10 Restore EGL_EXT_buffer_age for SwiftShader Vulkan EGL_EXT_buffer_age was previously disabled for SwiftShader Vulkan because of an Android test timing out on Cuttlefish when the buffer age is queried. aosp/1672445 addresses the root cause of the timeout, so EGL_EXT_buffer_age can be supported again. Bug: b/182521420 Bug: angleproject:3529 Change-Id: I5949f721316855d9138eb9f657a6df4e7b49ed71 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2821750 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
Ian Elliott b17a9317 2021-04-09T14:39:37 Vulkan: damage rectangles must never be pre-rotated Remove the SurfaceVk::present() code that rotated damage rectangles and the feature flag that controlled that rotation. The Vulkan specification was changed so that the rectangles provided to the VK_KHR_incremental_present extension must never be pre-rotated. The spec change requires the same behavior on all platforms (just in case), even though Android is the only platform known to support rotation. FYI: the Vulkan spec change was merge request 4442. Bug: b/182930524 Change-Id: I5128fd76e718f3d964c9091830bcc5886d265543 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2818826 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao e249239c 2021-04-08T09:46:48 Vulkan: Add featue flag to force highp to mediump in fragment shader. Adding feature flag that forces highp in fragment shader to mediump. It is disabled by default. You can enable it for experiment. Bug: b/184850002 Change-Id: I73980be4ad160eb1b17a3a3ecfc09f2e4aeb468c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2815240 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi d1462228 2021-03-09T11:25:36 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled Additionally, makes the emulation path not require independentResolveNone. This was only used to select the NONE resolve mode when the attachment format doesn't have either of depth or stencil aspects, but it's ok to specify the same resolve mode for both aspects even if one aspect is missing. Bug: chromium:1088005 Change-Id: Ifc37cbf5331145179c5927853b996a0d62b871ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743666 Reviewed-by: David Reveman <reveman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Nicolas Capens 135385a1 2021-03-19T00:09:31 Disable EGL_EXT_buffer_age for SwiftShader Vulkan Cuttlefish with SwANGLE failed to pass the android.graphics.cts. BitmapTest#testDrawingHardwareBitmapNotLeaking test, due to a timeout in dequeueBuffer (error = -110) during an EGL_BUFFER_AGE_EXT surface query. This change conservatively works around the issue by leaving EGL_EXT_buffer_age support disabled for SwiftShader. Further investigation is required to check whether this timeout can also occur with other Vulkan drivers, and if it can be addressed robustly. Bug: b/182521420 Bug: angleproject:3529 Change-Id: I54e3767e74bf922f273d8860f9f4cfc8b6589536 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2774030 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Nicolas Capens <nicolascapens@google.com>
Ian Elliott 92db3c68 2021-03-10T15:09:15 Vulkan: Disable rotating damage rectangles on Android This fixes visual problems with Android games that use eglSwapBuffersWithDamageKHR(). In 90/270-degree cases, the damage rectangles are being double-rotated, leaving them 90-degrees out of alignment with the window. On Android, VK_KHR_incremental_present is built on top of the same platform code as eglSwapBuffersWithDamageKHR(). The platform code rotates all damage rectangles (assuming they are application-provided). Therefore, ANGLE should not also pre-rotate damage rectangles. Test: Black Desert Mobile Test: Grand Theft Auto: San Andreas Test: Extreme Car Driving Simulator Bug: b/181796746 Change-Id: I6510e7540bb00afc75863e8ae8a9ea3841d1641d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2744984 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill a8a2a71b 2021-02-01T17:18:18 Vulkan: Support y-flip with no driver support. We can reuse the surface rotation matrix code to do the y-flip. This requires the SPIR-V transformation support. Because not all rotations are encoded into the table we can only support rotation with the driver support for y-flip (currently). Includes some very minimal regression testing. This work is targeted towards supporting vk-portability implementations which are not as up-to-date with Vulkan features. Bug: angleproject:5596 Change-Id: I270fa1efc03267551d28df33ddac9972e1343d60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2665892 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi ea71c6b6 2021-01-12T14:13:35 Vulkan: Emulate R32F images with R32UI GL requires that imageAtomicExchange be supported for r32f formats. However VK_FORMAT_FEATURE_STORAGE_*_ATOMIC_BIT is nearly unsupported everywhere without some Vulkan extension that brings in unnecessary support. This GL feature is emulated by transforming the shader to use r32ui for all images that originally specified r32f. floatToUintBits and uintBitsToFloat is used to maintain correct usage of the image* builtin functions. Bug: angleproject:5535 Change-Id: Ie607089935d3283b3ffa054f4b4385b81fb8f53d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2635453 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 60015ff6 2021-01-14T02:03:07 Vulkan: Redo RewriteStructSamplers This transformation is split into two. The first transformation solely takes out the samplers out of structs, and potentially generates array of array of samplers. A second transformation is added that takes any array of array of opaque uniforms and flattens it. A follow up change will simplify RewriteAtomicCounters which also handles array of arrays (which is no longer possible), and removes dependency on shaderStorageBufferArrayDynamicIndexing. Bug: angleproject:2703 Bug: angleproject:3881 Bug: angleproject:4071 Bug: angleproject:4211 Change-Id: I352bb2bbe65ac49f4d7d753c0ba3160fa3cc925a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2628138 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya da8c2261 2020-12-12T16:39:55 Vulkan: Enable FramebufferVk cache on Apple This effectively reverts ff60aba. The crash no longer occurs on Apple. Bug: angleproject:4442 Change-Id: I4aa745c80a482eb99311f3810e34124afe950cfe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2588429 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Ian Elliott 968fccb2 2020-12-02T13:28:30 Vulkan: Use VK_EXT_device_memory_report extension This CL can enable and use the VK_EXT_device_memory_report extension. This is disabled by default. To enable, link with the required extension, enable one or both of two features, AND build with the following GN arg: angle_enable_trace = true The two added features are: - logMemoryReportStats provides per-swap statistics - logMemoryReportCallbacks provides per-callback logging If either or both of the features are enabled, if the VK_EXT_device_memory_report extension is available, it is enabled. Bug: b/173636655 Change-Id: Ic5cf6c06efdb34f2313ef143853b3cc90f55faa5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2543506 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Anders Leino 4e913d34 2020-11-02T10:44:51 Vulkan: Work around Nvidia depth clamping bug In GL ES, depth is always clamped to [0,1]. The same is true in Vulkan, but not for implementations affected by Nvidia bug 3171019. This patch implements a workaround. The workaround introduced test failures on Linux with Nvidia Quadro P400 and driver version 418.56, so it's only applied conditionally, and as a result the test failure expectations are not removed completely. Bug: angleproject:3970 Change-Id: I0d9f855d7f3df72fea4af9f9b134ae3177cf820d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514377 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 9041ca0c 2020-11-20T16:27:48 Limit testing of in-progress work to ANGLE's build of dEQP A new feature is added, exposeNonConformantExtensionsAndVersions, which is set by ANGLE's build of dEQP to allow exposing ES3.2 or extensions that are not yet entirely conformant. This would allow ANGLE to expose WIP extensions for regression testing without affecting partners that test ANGLE with dEQP's standalone build. Bug: angleproject:3647 Change-Id: Id1e6219f26b41d3f8cdc9763131b8052227761c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2552926 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Sunny Sun <sunny.sun@arm.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 4e5a50b6 2020-11-13T22:56:59 Vulkan: Drop dependency to VK_EXT_shader_atomic_float This VK extension exposes features that are not necessary for GL_OES_shader_image_atomic. Instead, support for necessary features for VK_FORMAT_R32_SFLOAT is used to determine support for this GL extension. Bug: angleproject:5342 Change-Id: Ia504cba69ffe51cfd7da69df28f58563cb1f0744 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2536908 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com>
Charlie Lao 8930f182 2020-11-18T13:12:03 Vulkan: Add feature flag to fallback rotation to use driver uniform It appears that older Qualcomm driver has some serious performance issue with specialization constant. This does not happen with latest development driver. This adds a feature flag to pick driver uniform path for older driver. Bug: b/173636783 Change-Id: Ia494fedbb1e0e69fbd8c44f8457c1bc30bc9fa4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2547809 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Jamie Madill 49c13282 2020-11-08T10:51:54 Vulkan: Merge async command queue features. This merges the 'commandProcessor' and 'asyncCommandProcessing' features into one new 'asyncCommandQueue' features. Conceptually the command processor is asynchronous use of the CommandQueue. This renaming updates the code to reflect the usage. Bug: b/172704839 Change-Id: I1d7ca1187f802eed48823a01b57fb520527f2540 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525144 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill ce7bdd0b 2020-11-08T09:45:30 Vulkan: Merge CommandQueue and TaskProcessor. Bug: b/172704839 Change-Id: I43a40e6a3e1eb00a7ddebfba6e915437aa69aeb6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2525141 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 2e74c452 2020-11-06T16:45:21 Vulkan: Make feature names consistent. This gives the features the exact same name as the member variable. It fixes a bunch of inconsistencies between the variable name and the external string identifier. Ideally these could be auto-generated from JSON. Bug: b/172704839 Change-Id: Id75c01db544672234435c3dd727c927027b9236d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2524541 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 23d1f9b4 2020-11-02T13:00:08 Vulkan: Add support for VK_KHR_image_format_list extension GLES sRGB extensions allows for a texture to be respecified, with say the sRGB_override extension, which will require us to reinterpret the data in the texture in sRGB colorspace (or linear depending on the format of the texture). If the underlying ICD supports VK_KHR_image_format_list extension we create a texture's backing VkImage with the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT enabled since we already know the format we might need to reinterpret the texture as. Bug: angleproject:3609 Bug: angleproject:4561 Bug: angleproject:5281 Change-Id: Ia4bed596ed3000f8af1a8fd73fb8e6c2cb9b5d6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2513110 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang a51b57fa 2020-10-30T10:00:05 Revert "Vulkan: Add features to modify sampling parameters" Bug: b/167404532 Change-Id: Iae19dfe165074e8c01216312bddd744c4fb504a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510012 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 6bc362c4 2020-10-18T19:09:47 Allow single threaded CommandProcessor In replacing the legacy CommandQueue code with the threading capable CommandProcessor it would be good to be able to run the CommandProcessor in a single-thread environment. This CL changes the meaning of the feature flags for the commandProcessor and asynchronousCommandProcessing so that enabling commandProcess only changes the code paths to use the command processor but work it still done as part of the submitting thread (e.g. ContextVk). Enabling asynchronousCommandProcessing will cause a separate worker thread to be spawned which will asynchronously process the commands. This allows us to switch to the CommandProcessor without threading and then enable threading once performance issues are resolved. Bug: b/161912801 Bug: b/170329600 Change-Id: I534862b109a7e7708108190b7c3e894071d4c2ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483580 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Geoff Lang 8ace36f8 2020-10-30T09:51:16 Revert "Add a Vulkan feature to compress float32 vertex formats." Bug: b/167404532 Bug: b/161716126 Change-Id: I95157a006d5c1fd2d3c0c2c2be37fa0403c07f93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510011 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya e895ced6 2020-10-29T09:06:00 Vulkan: Add OES_shader_image_atomic support Add support for shader builtins and enable the extension. Bug: angleproject:3578 Tests: dEQP-GLES31.functional.*image_atomic* Change-Id: Idd45b2ee62efe1474c6c5947c77da64ff2221bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2505540 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b0db7cca 2020-10-23T17:37:41 Vulkan: Initial emulated prerotation support This is currently only supported for end2end tests (those which use ANGLETestBase, excluding those that use WithNoFixture) and Vulkan. Use WithEmulatedPreoration(*_VULKAN(), degree) where degree is either 90, 180 or 270. With emulated prerotation, the window dimensions are physically swapped if 90 and 270 degrees, while the width and height is still reported as requested by the test. In the Vulkan backend, the width and height are swapped after getting queried from the surface, and prerotation is assumed. Bug: angleproject:4901 Change-Id: I294436be4c7015d2a63463c4d61de7b67f38c95d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2495544 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter ed876984 2020-10-03T11:00:36 Vulkan: functionally complete worker thread Working on enhancing worker thread to completely own primary command buffers. This will include not only processing SCBs from main thread into a primary, but also submitting those command buffers to the queue. The CommandProcessor is a vk::Context so it can handle errors in the worker thread. When the main thread submits tasks to the worker thread it also syncs any outstanding errors from the worker. Include asynchronousCommandProcessing feature that will control whether the worker thread task does it's work in parallel or not. If false, we wait for the thread to complete it's work before letting the main thread continue. If true, the thread can execute in parallel with the main thread. Bug: b/154030730 Bug: b/161912801 Change-Id: I00f8f013d6cbb2af12a172c4f7927855db2f0ebf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2328992 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Hyunchang Kim d9a88d63 2020-09-28T17:58:31 Vulkan: Support OES_texture_cube_map_array extension Add support for GL_OES_texture_cube_map_array to the Vulkan backend if the underlying ICD supports creation of of cube array ImageViews Bug: angleproject:3584 Test: dEQP-GLES31.functional.fbo.color.texcubearray.* Change-Id: I636cbf347d718abfc1600119b312578370b8e02e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2437989 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao df6b7298 2020-10-12T13:39:09 Vulkan: Use StoreOp_None_QCOM for read only depth stencil buffer For read only depth stencil buffers, there is no need to store depth or stencil value. But we can not use DontCare for storeOp because vulkan core spec says DontCare indicates data is undefined after this. VK_QCOM_render_pass_store_ops extension introduces a new store op that will leave data defined but skip the store. This CL utilize this if the extension is available. Bug: angleproject:5055 Change-Id: I104f3d01eb342a2d0cc900f342430e901bde1bff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2462604 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi a3b16c6b 2020-08-28T16:14:30 Vulkan: Workaround vkCmdClearAttachment bug on Pixel Adds a workaround to use draw calls to clear color instead of vkCmdClearAttachment when the clear happens in the middle of render pass. On Pixel phones, vkCmdClearAttachment races with the previous draw calls in the render pass. Bug: b/166809097 Change-Id: I8c96b87793da191757635658ad4ee2c3a7875aca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2382416 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi a76b6836 2020-09-17T22:40:42 Vulkan: Support MSRTT depth/stencil resolve VK_KHR_depth_stencil_resolve is used by this change to resolve depth/stencil multisampled-render-to-texture renderbuffers. This extension is not widely supported yet. If it's not present, the depth/stencil resolve operation is silently ignored and the renderbuffer acts as a normal multisampled one. This is not correct, but our primary user (Chrome), and most applications don't care for the resolved depth/stencil data. In fact, it's recommended for the depth/stencil attachment to be invalidated after rendering. Exposing EXT_multisampled_render_to_texture even in the absence of depth/stencil resolve allows the majority of the applications to still take advantage of MSRTT color attachments. Bug: angleproject:4836 Change-Id: I6ba4187344a0c9330d2c77bdc5e2c6fc5483c299 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2417645 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang f0b02054 2020-08-06T20:55:05 Add a Vulkan feature to compress float32 vertex formats. Use the vertex conversion pipeline in VertexArrayVk to detect static vertex data and convert float32 vertices to float16. This feature is useful for determining if an allication is vertex bandwidth bound and seeing what gains could be had by using smaller attributes. This feature could be implemented in ANGLE's frontend but new infrastructure for converting and storing the converted attributes would need to be added to gl::VertexArray. Our backends already have the functionality needed to handle unsupported attribute formats and this can be repurposed for compressing vertex formats. Bug: b/167404532 Bug: b/161716126 Change-Id: I9a09656a72e8499faa4124adf876d7261c8341c9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342285 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 49f01a53 2020-09-18T11:38:14 Vulkan: Add features to modify sampling parameters Add features to optionally increase the LoD offset of all sampling operations or disable linear filtering. These can be used to compare performance without recompiling ANGLE. These features could be potentially implemented in the frontend it is more difficult because the features are not available at texture initialization time. Bug: b/167404532 Change-Id: Ifcf56fbcf130c24c54834737733bbffa5ade3959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2411475 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 68c424fe 2020-09-17T10:34:07 Vulkan: Workaround oldSwapchin bug on Android When vkCreateSwapchainKHR is called with a valid oldSwapchain, the Android framework destroys the images in oldSwapchain. This is not correct, as it should be deferred to the actual vkDestroySwapchainKHR call performed later by ANGLE. This is because rendering to the oldSwapchain could still be in progress. While this issue affects all of Android, currently only ARM shows any symptoms. A workaround is added for ARM to vkDeviceWaitIdle before recreating the swapchain if oldSwapchain is valid. Bug: angleproject:5061 Change-Id: I308e4798c6418d7891d880218b0ebcfd7a795643 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416238 Reviewed-by: Sunny Sun <sunny.sun@arm.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao c03c4490 2020-08-28T11:03:20 Vulkan: Defer glFlush issued in middle of renderpass to endRenderpass Manhattan is calling glFlush in middle of a renderpass. This CL defers the flush that issued in the middle of renderpass to the end of renderpass. Bug: b/166475273 Change-Id: I6baa3898d5efc456e2205c44e13c64f3d79d1464 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2381942 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
David Reveman 9a19a996 2020-08-26T09:00:50 Vulkan: Use 4 MB as preferredLargeHeapBlockSize for allocator. This reduces preferredLargeHeapBlockSize from the default value of 256 MB to 4 MB, which reduces the initial block size from 32 MB to 512 KB. 4 MB is the same size as used by Chromium and Skia. It seems to be a good compromise of not wasting unused allocated space and not making too many small allocations. This change is limited to non-Qualcomm GPUs as a number of tests are failing on Qualcomm after this change and the initial investigation indicates a potential driver bug. See http://anglebug.com/4995 for more details. Bug: chromium:1122718 Bug: fuchsia:58959 Change-Id: Ifdaf863ef38e72098a04ee57dec46ee71cab6ac3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2376891 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: David Reveman <reveman@chromium.org>
Shahbaz Youssefi c7645886 2020-08-24T16:47:21 Vulkan: Remove the flipViewportY feature This was featurized as a workaround for Intel/Windows drivers that did not render flipped in comparison to GL per Vulkan spec. This issue has long since been fixed, and due to missing parentheses the feature was accidentally unconditionally true for a long time already. Bug: angleproject:4896 Change-Id: I1db55d298bd47df649ff1f03d287d0cfa7453ea7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372632 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 682f9141 2020-08-18T10:57:40 Remove feedback loop support from back-end. Front-end detection still in place and will be removed in a follow-up. Removes the Vulkan feature and the special clear handling. Bug: angleproject:4959 Change-Id: I5d44c3f7dbdb49d8aa0375f54b7148df09732ba2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363208 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 1dcb3eb2 2020-08-06T15:02:34 Vulkan: Don't expose MSRTT on Mac/SwiftShader Frequently causes failures as such: [...:ERROR:drawing_buffer.cc(854)] Initialization failed to allocate backbuffer. [...:INFO:CONSOLE(197)] "Unable to initialize webgl context.", source: (197) Bug: chromium:1112986 Bug: angleproject:4937 Change-Id: I5058f78434c0ac49345fe1167043f2dca759b1b9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341350 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao cf49403e 2020-07-21T11:40:56 Vulkan: Increase default uniform buffer size to 64K Since these are per context, we can increase it (and subject to the driver maxUniformBufferRange limit) to reduce the amount of descriptor set allocated. Bug: b/161391337 Change-Id: I89e5cf16ee377735c412e9a9a22c651e1c677ded Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2310910 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Shahbaz Youssefi 8adc5469 2020-07-02T10:15:17 Vulkan: Generate mipmap in compute An initial implementation based on AMD's FFX SPD (Single Pass Downsampler). Apart from requiring STORAGE_IMAGE support for the image format, the following limitations are in place due to FFX SPD: - Image must be 2D or 2D array (including cube maps) - Image must be single-sampled The following _can_ be supported, but not yet implemented: - sRGB formats - Integer formats - depth/stencil formats Bug: angleproject:4551 Change-Id: Ibc4d5cea701cca31e55e3d651540872bbd3b473f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278713 Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Courtney Goeltzenleuchter f61272fb 2020-06-17T11:38:37 Add support for VK_KHR_sampler_ycbcr_conversion This adds ability for applications to import Android Hardware Buffers (AHBs) as OpenGL images which in turn can be sampled from and/or written. This was specifically tested with the common use case of importing a buffer created by an media decoder and using that as a texture source to include that video content on the screen. Tested with: - Angry Birds 2 video player (for ads) requires YUV conversion. - Basic Media Decoder example: https://github.com/android/media-samples/tree/master/BasicMediaDecoder Bug: b/155487768 Change-Id: I9255450f81aa4daa2aace7205d4f6c3f225abcca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2175103 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya 62ff54eb 2020-05-12T13:27:21 Vulkan: Featurize shadow buffers Shadow buffers help reduce the latency of glMap* operations at the cost of CPU overhead. It might not be desirable to incur such an overhead for all usecases. Featurize it but enable it by default. Bug: angleproject:4339 Change-Id: I6374618bf99677eef55fd50a139fb86f5ea70791 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278102 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Ethan Lee 209cf8fa 2020-05-27T16:23:57 GGP: Check and enable VK_GGP_frame_token Bug: angleproject:4668 Change-Id: I9ecbdf37e206cb6eb93699091bbff70ad898040f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219032 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 02fa7313 2020-05-05T17:01:18 Vulkan:Initial worker thread disabled by default Created new CommandProcessor class that can be run as a worker thread. Running CommandProcessor within RendererVk as a worker thread that takes a CommmandBufferHelper (CBH) ptr as the interface and processes that CBH into a primary command buffer. Main thread has a queue of CBH to draw from. After submitting a CBH to the worker, it pulls next CBH from the queue. Worker thread releases CBH back to the main thread queue when done. Synchronization goes two ways: 1. Work submitted to worker thread is managaed with a mutex and condition variable based around the work queue. 2. Available CBH ptrs for the main thread have a mutex and condition variable that manages the CBH queue. The worker thread is disabled by default, and, when enabled, it will currently behave and perform as the non-threaded code. This is because the kNumCommandBuffers const in ContextVk.h is set to 2. With only 2 command buffers, they will be assigned to the inside and outside RenderPass command buffers respectively. Then, as soon as one is submitted, the main thread will stall waiting for it to be completed and put back into the queue mentioned in #2 above. The next step is to move command submission to the worker thread and update the number of command buffers so that processing/submission will occur in parallel with the main thread. Right now there is a race condition issue when attempting to run in parallel because the main thread updates and submits the same primary command buffers that are used in the worker thread, which is in violation of the Vulkan spec. The follow-on CL will fix this issue as the main thread will only touch SecondaryCommandBuffers and the worker thread will be the only thread touching the primary command buffers. Bug: b/154030730 Change-Id: Ib0c518bbd7ca9a3a7e789f4e1f2f7131ddc0509e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174719 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 258d94f6 2020-05-18T16:21:50 Vulkan: Add workaround for nvidia to always merge barriers into one vkCmdPipelineBarrier call Nvidia preferes one barrier call than multiple calls with fine grained stage dependency information. They do not care much about stage dependency. This adds a feature flag that sets to true on nvidia and will merge all barriers into one call. Bug: angleproject:4633 Change-Id: I204484aa4c5989655f74d70a0eaa235c3c83f548 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2207635 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Antonio Maiorano 4f343f3e 2020-05-13T14:11:51 Reland "Add support for GL_CHROMIUM_texture_filtering" This is a reland of 38780ae3921d2570316119a881adfb9520e7e296 modulo the changes to disable VK_VALIDATION_FEATURE_DISABLE_UNIQUE_HANDLES_EXT, as this was causing problems. With this landed, the extension will not work on SwiftShader until we find a way to allow this extension through the validation layers. Bug: b/146423360 Bug: b/154620295 Change-Id: Ie09fc507c01a47be3bb227bc78771660170ba5d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2199639 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tim Van Patten 3b82fdcf 2020-05-12T23:44:07 Revert "Add support for GL_CHROMIUM_texture_filtering" This reverts commit 38780ae3921d2570316119a881adfb9520e7e296. Reason for revert: Breaks SWANGLE-VK: 05-12 23:42:28.612 22836 22861 D libEGL : dlopen_ext from APK (libEGL_angle.so) success at 0x79f4485a10 05-12 23:42:28.617 22836 22861 D libEGL : dlopen_ext from APK (libGLESv1_CM_angle.so) success at 0x79f4485eb0 05-12 23:42:28.619 22836 22861 D libEGL : dlopen_ext from APK (libGLESv2_angle.so) success at 0x79f4485c60 05-12 23:42:28.624 14223 14223 D StatusBar: disable<e i a s b h r c s > disable2<q i n > 05-12 23:42:28.633 14014 14057 V DisplayPowerController: Brightness [0.19986142] reason changing to: 'automatic', previous reason: 'automatic [ dim ]'. 05-12 23:42:28.635 22836 22861 D vulkan : searching for layers in '/data/app/~~0AfWfBsFEO78tqKlnanevg==/org.khronos.gl_cts-NOs3SGclHqlbcqe-08gHrw==/lib/arm64' 05-12 23:42:28.635 22836 22861 D vulkan : searching for layers in '/data/app/~~0AfWfBsFEO78tqKlnanevg==/org.khronos.gl_cts-NOs3SGclHqlbcqe-08gHrw==/base.apk!/lib/arm64-v8a' 05-12 23:42:28.632 22836 22836 W .khronos.gl_cts: type=1400 audit(0.0:218): avc: denied { ptrace } for scontext=u:r:zygote:s0 tcontext=u:r:untrusted_app_25:s0:c512,c768 tclass=process permissive=0 b/77925912 app=org.khronos.gl_cts 05-12 23:42:28.636 14014 14034 I EventSequenceValidator: Transition from ACTIVITY_LAUNCHED to ACTIVITY_FINISHED 05-12 23:42:28.637 22836 22861 F SwiftShader: external/swiftshader/src/Vulkan/libVulkan.cpp:425 vkCreateInstance TRACE_ASSERT: pCreateInfo->pNext sType = 1000247000 --------- beginning of crash 05-12 23:42:28.637 22836 22861 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 22861 (.khronos.gl_cts), pid 22836 (.khronos.gl_cts) Original change's description: > Add support for GL_CHROMIUM_texture_filtering > > Chromium enables a custom extension, GL_CHROMIUM_texture_filtering, when > using SwiftShaderGL, to enable high precision filtering. This change > makes it so ANGLE also handles this same extension when using the > SwiftShaderVK backend, by enabling the new > VK_GOOGLE_sampler_filtering_precision custom extension. > > Bug: b/146423360 > Bug: b/154620295 > Change-Id: I69cafc1ccf5970a3d220ac7e13ec3c8fdd4a9643 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185822 > Commit-Queue: Antonio Maiorano <amaiorano@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,amaiorano@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: b/146423360, b/154620295 Change-Id: I803d7a7baac81cf178b59c4bf2789346ec1d3f87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197168 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Antonio Maiorano 38780ae3 2020-05-06T16:05:02 Add support for GL_CHROMIUM_texture_filtering Chromium enables a custom extension, GL_CHROMIUM_texture_filtering, when using SwiftShaderGL, to enable high precision filtering. This change makes it so ANGLE also handles this same extension when using the SwiftShaderVK backend, by enabling the new VK_GOOGLE_sampler_filtering_precision custom extension. Bug: b/146423360 Bug: b/154620295 Change-Id: I69cafc1ccf5970a3d220ac7e13ec3c8fdd4a9643 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185822 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jeff Vigil e20f36f4 2020-04-21T15:45:44 EGL: Implement EGL_ANDROID_native_fence_sync on vulkan Check the following - 1. Vulkan ICD supports VK_KHR_external_fence_fd 2. ExternalFenceProperties and ExternalSemaphoreProperties support Android FD. eglCreateSync - if FD was provided import to VkFence, else create VkFence with new FD and then flush and submit VkFence on next vkQueueSubmit. eglGetSyncAttrib - for status call vkGetFenceStatus. eglDupNativeFenceFdANDROID - return FD from vkGetFenceFD call. eglClientWaitSync - call vkWaitForFences. eglWaitSync - dup FD, create VkSemaphore and import FD, then flush() and add VkSemaphore to next vkQueueSubmit as a waiting semaphore. Extended end2end test suite with nativefence test cases. Bug: angleproject:2517 Test: angle_end2end_tests --gtest_filter=EGLSyncTest.AndroidNativeFence_* Change-Id: I8f6a6f4c3d71d83007f662b78377aa015a740035 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026177 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mohan Maiya b7d6949b 2020-04-17T13:36:14 Vulkan: Enable persistently mapped buffer objects The VMA allocator has a handy feature where during memory allocation we can request persistently mapped memory. This saves IOCTL overhead for apps that update buffers frequently. Bug: angleproject:2162 Change-Id: I870d880033beec343efae6de06f1c5935de4c2c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2155131 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill d03b15b2 2020-03-26T17:22:18 Vulkan: Mask out Depth/Stencil RTs in feedback loops. This should enable some cases of limited support for feedback loops with depth/stencil buffers. For example with Manhattan and the Vulkan back-end. Increases the number of RenderPasses in Manhattan slightly. This will regress performance slightly until we can work out a better solution that is also conformant with the spec. Bug: angleproject:4517 Change-Id: I2758e6b4c2a930474c09cdc0950f3b6c34541089 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2106670 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Tobin Ehlis 1a5c7a16 2020-02-25T12:02:31 Reland "Vulkan:Include precision qualifier in GLSL" Currently still ignoring precision qualifiers for Vulkan shaders by default, but have added feature "enablePrecisionQualifiers" that can be enabled in order to include precision qualifiers. With this initial implementation, it's possible to get precision qualifier mis-matches in the generated GLSL 4.50. According to the spec this is allowed. From GLSLangSpec 4.50 section 4.7 "Precision and Precision Qualifiers": For the purposes of determining if an output from one shader stage matches an input of the next stage, the precision qualifier need not match. However, when converted to SPIR-V and run through the shader validation any mismatches will cause shader validation errors. Initially just ignoring those errors with this commit. Bug: angleproject:3078 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057749 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com> Change-Id: Ieecca604bb2c834c9b1c2bcab85279d1f8755dfa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2086280
Xiaoxuan Liu f8b28678 2020-02-26T19:12:39 Vulkan: Add support for VK_EXT_index_type_uint8 Enable VK_EXT_index_type_uint8 Vulkan extension if supported by VkDevice. Bug: angleproject:4405 Change-Id: I84d030497898c5944a36d9a88a31e7377ccd5e9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2082391 Commit-Queue: Xiaoxuan Liu <xiaoxuan.liu@arm.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis ff60abaf 2020-02-28T14:06:07 Vulkan:Disable FramebufferVk cache on Apple Currently hitting a crash on Apple so disabling FramebufferVk cache. Bug: angleproject:4442 Change-Id: I3824252210aeeaf9919c8d17730395b394a50862 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2080661 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Ian Elliott e488d8b8 2020-02-26T16:11:29 Vulkan: Implement Android pre-rotation As an Android GLES driver on top of Vulkan, ANGLE must pre-rotate rendering on behalf of the application. This involves modifying the vertex shader to multiply gl_Position with a mat2 "rotation matrix". Not doing so means that SurfaceFlinger (SF) will perform a costly rotation blit before presenting every image. Setting WindowSurfaceVk::mPreTransform to mCurrentTransform tells SF to not do the blit. When the surface is rotated 90 or 270 degrees, the width and height must be swapped for: - The swapchain images, and for any depth, stencil, and/or multisample attachments used with the swapchain image. - The viewport, scissor, and render area. Because the Metal back-end shares the TranslatorVulkan, it will define the same preRotation (mat2) DriverUniform that is used for Vulkan. Bug: angleproject:3502 Change-Id: I968dbe8869ba0f50de18dd41f1195e847c06b545 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2038272 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 660c0dd6 2020-02-25T13:30:33 Vulkan: Fix padding out Buffer allocations on AMD. We would often pad incorrectly given the constraints of the max stride. We shouldn't really be rounding up the buffer size, but we should instead be adding the max alignment size to the end of the buffer. Bug: angleproject:4428 Change-Id: Id2afc572c85985548a18f60b42cdc388d83d5c4c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2071235 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Michael Spang c4197713 2019-06-03T19:23:02 Implement glImportMemoryZirconHandle & glImportSemaphoreZirconHandle Implement import of fuchsia external objects passed by zircon handle. This works exactly the same as with file descriptors. Bug: angleproject:3492 Change-Id: I4d46917dfc5902f00c94550158a9f8073097f0a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642334 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>