src/libANGLE/renderer/vulkan/FramebufferVk.cpp


Log

Author Commit Date CI Message
Charlie Lao d59bccb5 2020-09-23T10:20:35 Vulkan: updateRenderPassDesc may lose color attachment data FramebufferVk::updateRenderPassDesc() is resetting entire mRenderPassDesc, which may lose color unresolve attachments. This CL makes sure that when we toggle depth stencil buffer's read/write access, we do not reset the whole mRenderPassDesc. Instead we only update the depth stencil attachment's access. Bug: b/168953278 Change-Id: Ia9df2d8ac81ebf2da8a360ba1293faf6c14b2738 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2426468 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>
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>
Mohan Maiya 9e2953c2 2020-09-23T07:57:22 Vulkan: Enable OES_texture_storage_multisample_2d_array The implementation for OES_texture_storage_multisample_2d_array already exists. This patch just enables the appropriate capability flag only if the underlying Vulkan ICD supports standardSampleLocations Bug: angleproject:3583 Tests: angle_end2end_tests --gtest_filter="*TextureMultisampleArrayWebGLTest*Vulkan" dEQP-GLES31.functional.state_query.internal_format.texture_2d_multisample_array.* dEQP-GLES31.functional.state_query.texture_level.texture_2d_multisample_array.* Change-Id: I2ea89041d9aa8c7d94c9ba732f12528c809807ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416979 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi f39e0f01 2020-09-07T23:07:37 Vulkan: Use subpass to unresolve render-to-texture attachments GL_EXT_multisampled_render_to_texture allows singlesampled textures to be used with multisampled framebuffers in such a way that the final resolve operation is automatically done. In Vulkan terminology, the render-to-texture GL attachment is used as a Vulkan subpass resolve attachment with an implicit (ideally-)lazy-memory multisampled image as the color attachment. This extension expects that if the texture is drawn to after the automatic resolve, the implicit multisampled image would take its fragment colors from the singlesampled image. In other words, the opposite of a resolve operation should be automatically performed at the start of the render pass. This change refers to this operation as "unresolve". The goal of this extension is to allow tiling GPUs to always keep multisampled data on tile memory and only ever load/store singlesampled data. The latter is achieved by using a subpass resolve attachment and setting storeOp of the multisampled color attachment to DONT_CARE. This change achieves the former by using an initial subpass that uses the resolve attachment as input attachment, draws into the multisampled color attachment and sets loadOp of said attachment to DONT_CARE. Bug: angleproject:4881 Change-Id: I99f410530365963567c77a7d62fc9db1500e5e3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2397206 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi edc0d2ee 2020-09-15T16:02:05 Vulkan: Disallow loadOp=LOAD for MSRTT depth/stencil textures EXT_multisampled_render_buffer2 specifies that depth/stencil textures are expected to be in a perpetual state of invalidated, except during rendering. This change makes sure that they never use loadOp=LOAD. Additionally fixes a bug where clears applied to MSRTT depth/stencil textures didn't take effect because they were applied to the multisampled image (since the resolved image was not given to the render target). Bug: angleproject:4836 Bug: angleproject:5063 Change-Id: I4506f4de415dca6c222111a1ae62017d2fb1e2b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2412848 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 5f8af83f 2020-09-17T11:06:08 Vulkan: Add perf warning for mid-RP clear Bug: angleproject:3461 Change-Id: Id80ccc81db3cb66438b6b5e6d504eda613f481d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416244 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 1c79e9ea 2020-09-17T09:50:46 Vulkan: Delay vkAcquireNextImageKHR till later Currently, ANGLE calls vkAcquireNextImageKHR() immediately after calling vkQueuePresentKHR(), which can cause the process to stall (even with multi-threading). Delay it until it is absoluately needed. Test: angle_end2end_tests --gtest_filter=*EGLPreRotationSurfaceTest*/* Test: angle_white_box_tests --gtest_filter=VulkanPerformanceCounterTest.*Invalidate*/* Test: angle_deqp_egl_tests --gtest_filter=dEQP.EGL/functional_query_context_get_current_display_rgba8888_window* --use-angle=vulkan Test: angle_perftests --gtest_filter=GenerateMipmapBenchmark.Run/vulkan_webgl Bug: angleproject:5064 Bug: b/162082698 Change-Id: I466df9237136dd59a9556faa8cf2dbad94e076fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2399509 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Amy Liu 83c7e1ae 2020-09-17T16:42:19 Fix the regression of color blit. Move the offset aligning code to stencilBlitResolveNoShaderExport to avoid affecting color blit. Test: dEQP-GLES3.functional.fbo.blit.default_framebuffer.*_linear_* Bug: angleproject:5044 Change-Id: Ic2ebef94091853146424d567b0035161611ba32d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2416008 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 22d30378 2020-09-15T23:19:48 Vulkan: Change VK suffix to Vk For consistency with the rest of the backend. Level index variables were using the VK suffix while color index variables used Vk. Bug: angleproject:4881 Change-Id: I0c2799da34cdfe19cb04adbebba042ac8876af96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2413155 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Charlie Lao 71e7a5a6 2020-09-14T13:56:19 Vulkan: Move mAttachedColorBufferMask to FramebufferState This moves the bit mask of attached color buffer to front end. No function change is expected. Bug: b/167301719 Change-Id: I4eec3a419560b91875260b812a036ceaaeb6b5bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2410790 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 06b4fb92 2020-09-11T21:24:46 Vulkan: Fool proof packed attachment index to vulkan and from OpenGL ANGLE packs FBO attachments from OpenGL and uses packed attachments to create VkFramebuffer and renderpass. When we use attachment index into the attachment array, we must be very careful to use packed index for vulkan objects. It is easy to make mistakes here and introduce hard to debug bugs. This CL defines a PackedAttachmentIndex class that uses that to index into vulkan attachments and pass around APIs so that compiler would catch the error when wrong index is used. This also introduces PackedClearValuesArray that stores clear value in packed attachment index so that it is impossible to mix it with ClearValuesArray that stores clear value in GL attachment index. Bug: b/167301719 Change-Id: I68680522c60beeb5096e5211eaef89da28c7097e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2410366 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao e4e2a016 2020-09-01T11:23:09 Vulkan: Use color mask to handle draw buffer disabled case When draw buffers set to GL_NONE, instead of remove the attachment from renderpass which breaks renderpass, we force vulkan's per buffer color mask to false while keep the disabled draw buffer attached. This CL also always create FrameBuffer with all color attachments regardless it is enabled or not. Bug: b/167301719 Change-Id: Ice9fca9aacf774a47d13b749f822b222cc050174 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2389007 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Amy Liu b3c7d39a 2020-09-03T15:51:02 Align the sample position in blitResolveStencil compute shader The input coordinates of blitResolveStencil compute shader start from 0,we need to align the sample position to start from 0 if x/y is flipped. Test: dEQP-GLES3.functional.fbo.invalidate.*.unbind_blit_msaa_* Bug: b/159995959 Change-Id: If0c9f5b7cacddbe1a2d7062469a757a63bcc1378 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2392162 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 4a41204d 2020-09-02T05:04:33 Vulkan: Improve invalidate for depth/stencil Improve state tracking when the depth and/or stencil attachments are invalidated. Since no draw-time tracking is done, we use the number of command-buffer commands to determine when an attachment is drawn to. That allows all cases to be handled for store ops. Still need to handle mContentDefined at endRP time (we have the data, just not the plumbing). Test: angle_white_box_tests --gtest_filter=VulkanPerformanceCounterTest.*Invalidate*/* Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_* --use-angle=vulkan Bug: b/167276207 Change-Id: Iae10857dbb4d43b934c51ad7e400b71ae0db4f55 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378670 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi cba9bbbe 2020-09-02T09:55:31 Vulkan: Fix resolve-with-subpass retaining resolve attachment The temporary resolve attachment used to optimize blit was not removed from the framebuffer and render pass descriptions, resulting in subsequent draws to be resolved again. Bug: b/159903491 Change-Id: I9a9c90d25cb07ba9a25999f808b164f9085387d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390441 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi b2944fcf 2020-09-02T11:10:00 Vulkan: Don't break the RP on masked/scissored clears Bug: b/166809097 Change-Id: Iedd10a6528808e859c5693a2d30c98aca1a1159c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390862 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi d701eae2 2020-09-02T12:23:21 Vulkan: Fix resolve with different formats vkCmdResolveImage and subpass resolve attachments cannot be used if the source and destination formats aren't identical per Vulkan spec: vkCmdResolveImage: > srcImage and dstImage must have been created with the same image > format VkSubpassDescription: > each resolve attachment that is not VK_ATTACHMENT_UNUSED must have the > same VkFormat as its corresponding color attachment Bug: chromium:1123524 Change-Id: Iaf7182dbcad0420483ac2c23d0acf8c109688565 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390781 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Nicolas Capens <capn@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 543a3962 2020-09-02T09:40:10 Vulkan: Fix resolve-with-subpass with non-zero read attachment The draw framebuffer's color index was used to get the read buffer of the source framebuffer. Bug: b/159903491 Change-Id: I7a1626e6732367c14d46f1e1be4057998fdbf011 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2390440 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a0d048a4 2020-08-27T12:03:02 Vulkan: Fool-proof usage of GL and VK level indices Using boxed types, this change allows the compiler to catch errors when a level index in one space (e.g. GL) is mistakenly used in another space (e.g. VK). This change uncovered a number of bugs due to such mistakes which are fixed. Mistakes are still possible when the index is explicitly extracted, for example to be given to a Vulkan command, or when it's created, for example when retrieved from gl::ImageIndex::getLevelIndex. Future work can include using gl::LevelIndex in gl::ImageIndex directly to alleviate the latter at least. Bug: angleproject:4880 Change-Id: I6427c68c3bc096f771402f51c8554d8171758aa9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2380232 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Courtney Goeltzenleuchter a08495d9 2020-08-27T13:47:19 Revert "Vulkan: restore mContentDefined at endRP()" This reverts commit 53ee431e3d36692cbe50a96ebbf0ff898ec4d523. Bug: chromium:1122621 Change-Id: Ifd63aa0694e00ed6ef74b385466b874604355e79 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2380610 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Ian Elliott 53ee431e 2020-08-21T12:40:03 Vulkan: restore mContentDefined at endRP() CommandBufferHelper will keep a pointer to the depth-stencil RenderTargetVk, and use this to set RenderTargetVk::mContentDefined to true at the end of a render pass. Test: angle_white_box_tests --gtest_filter=VulkanPerformanceCounterTest.InvalidatingAndUsingDepthDoesNotBreakRenderPass/* Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_* --use-angle=vulkan Bug: b/163854287 Change-Id: I891381825ee01e141dfa4f9099d07d9ffc943f77 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2368194 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi 295d2ccd 2020-08-24T14:46:31 Vulkan: Generate perf warnings on suboptimal paths Using KHR_debug features, this change creates a performance-warning-generation macro and employs it in a handful of locations to provide useful feedback to application developers. The warnings added in this change are not exhaustive. Bug: angleproject:3461 Bug: angleproject:4900 Change-Id: Id62435d170d90c5be9c1c5cab2d6779ccb58345e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2372628 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Ian Elliott ba1e049f 2020-08-21T13:13:54 Vulkan: Fix compilation error Two commits conflicted and the bots didn't catch it somehow Bug: b/163854287 Change-Id: Idb4d7802eec71b2112b11e4553e609b532cee070 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2369261 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Ian Elliott 296d3bfd 2020-08-21T10:38:32 Vulkan: do not end render pass when invalidating Initially, FramebufferVk::invalidateImpl() was very conservative and always ended a render pass (if the framebuffer is part of the current render pass). This adversely affects PUBG Mobile, which invalidates the depth buffer every frame, causing the render pass to be split. Test: PUBG MOBILE on Android Test: angle_white_box_tests --gtest_filter=VulkanPerformanceCounterTest.InvalidatingAndUsingDepthDoesNotBreakRenderPass/* Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_* --use-angle=vulkan Bug: b/163854287 Change-Id: I343dee1db3ebaf039ff92557f9ef25b24bcdcc93 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2352627 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
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>
Jamie Madill d3e800e9 2020-08-15T17:26:04 Vulkan: Restart RenderPasses in DS read-only mode. We can combine an initial RenderPass with a read-only RP if the first RP never writes to depth. We can check the depth-write tracking in CommandBufferHelper and substitute in a new Framebuffer/RP Desc in this case as well as issue new layout barriers. We need to disable barrier merging in this special case. This reduces the RenderPass count in the Manhattan trace from 15->13. The performance on the Pixel 4 benchmark goes to ~82% of native for the on-screen version and ~88% for off-screen. There's also a ~5% bump in speed for the desktop trace. Bug: angleproject:4959 Change-Id: I70241824f75eaa1e11b50370f826abc36e91686e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358772 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill e689d316 2020-08-14T22:51:03 Vulkan: Don't end RenderPass on DS feedback loops. Instead of always switching the Framebuffer to mask out depth/stencil loops we now switch the RenderPass to a "read-only" depth/stencil mode. Reduces the RenderPass count in Manhattan from 18->15. There are still a couple extra RenderPasses inserted that we can get rid. We can merge a few RenderPasses by retroactively changing a started RenderPass to "read-only" when there are no prior recorded depth writes or clears. Also adds a test to count the number of RenderPasses ANGLE generates in DS feedback loop situaions. Bug: angleproject:4959 Change-Id: I1855a45959655fc27ccd47a3469c1c672fc8fd9e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2357973 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten dff47d5f 2020-07-14T19:10:12 Vulkan: Optimize MSAA using subpass resolve attachments If a user is performing a blit to resolve a multisample color buffer into a single attachment, ANGLE can use subpass resolve attachments to resolve directly into the destination buffer as part of the render pass. This allows the data to remain in tiler memory and reduce the extra bandwidth required to write the multisampled data back to perform the copy. This work also requires restoring/reopening a render pass if it has been finished already, assuming the finished render pass was started and for the framebuffer that is the source for the blit command. Other objects that were created when the render pass was started need to be updated as well, such as the source FramebufferVk's resolve attachment, the CommandBufferHelper's vk::Framebuffer and vk::RenderPassDesc, etc. While this is better than performing vkCmdResolveImage(), there is still another major part of optimizing MSAA using resolve attachments not implemented here: discarding the multisampled image rather than writing it to GMEM, which requires the user to invalidate the read FBO after the blit. This CL was verified with AGI to make sure there are no explicit blits to resolve the multiple sampled image. Bug: b/159903491 Test: FramebufferTest_ES31.*Blit* Test: VulkanPerformanceCounterTest_ES31.MultisampleResolveWithBlit Change-Id: I320a26088d8f614a295e7feec275d71310391806 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2298663 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 594e0e14 2020-08-15T16:35:55 Vulkan: Add DS ReadOnly mode to Framebuffer/RP caches. Allows ANGLE to create Framebuffers and RenderPasses with a read- only depth/stencil layout. Also allows us to transition our Images to this new DepthStencilReadOnly layout. Internal code redesign. No functional change to our command stream. Bug: angleproject:4959 Change-Id: I9b80063bdaec8f5d6c89037e0618c85e1c11b78d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2354280 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill eb85c021 2020-08-05T15:07:15 Vulkan: Refactor Context CommandBuffer query. getOutsideRenderPassCommandBuffer returns the command buffer directly since it's now stateless and cannot throw an error. All the RenderPass begin/end and flushing are done by the dependency functions (buffer/ image read/write). Bug: angleproject:4911 Change-Id: I5e7806be9d0e1b5e358524bd485298d660fac942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2339544 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill d201ed8b 2020-08-02T16:29:35 Vulkan: Track used Images in RenderPass. Adding a simple ImageSerial tracking map in our RenderPass allows us to know when we do or do not need to close the RenderPass on a new Image access. This simple tracking scheme improves Manhattan performance by up to 25% on Android. The improved perf comes from reducing our RenderPass count (23->18 RenderPasses in our capture scene). Adds a FastUnorderedSet class to manage the used RP Image serials. Updates the Query helpers to explicitly flush the RP before inserting queries. Bug: angleproject:4911 Change-Id: I0c34fc8e307514ebdf3e81e08d8e5aedb70ebe8f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2334346 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 5559351c 2020-08-11T14:23:32 Vulkan: Correctly determine mip level in resolveColorWithCommand() FramebufferVk::resolveColorWithCommand() is currently using the wrong mip level value by using the GL index value, rather than calculating the VK value from (index value - the base level). Bug: angleproject:4753 Test: FramebufferTest_ES31::MultisampleResolveIntoMipMapWithBlit() Change-Id: I8ddaeb21c4957b46880f5ef5f6a78242c04b4dcd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2349951 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Jamie Madill 5921a040 2020-08-06T17:39:56 Vulkan: Refactor image dependency commands. Uses commands similar to the Buffer APIs. Also updates docs. Bug: angleproject:4911 Change-Id: I1f2ec9bdd1d725d4ec3d6601e63bcb0c045e2121 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2342287 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 3d17084d 2020-08-06T17:53:36 Vulkan: Simpify check for started RenderPass + FB. We can check the RenderPass CB helper directly instead of caching a separate variable. Bug: angleproject:4911 Change-Id: Ic953c101c64fd5142e2dedfd06e3fea287331fd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2341761 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 81370214 2020-07-29T12:54:02 Pass the Command when sync'ing dirty objects A new enum is being created that contains command types, which are then passed to each dirty object when they are synced. This allows the syncState() methods to perform special handling for each command type. This change is in preparation for optimizing resolving multisample images with glBlit, since the render pass needs to be updated before it's ended. Bug: angleproject:4753 Change-Id: I77701f79418d35cff689e864c8a8b47b6fca0255 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2327335 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 23daea2f 2020-08-06T10:40:00 Vulkan: Rename CommandBuffer get method. This method will no longer end the RenderPass in a following CL. Renaming it in a split CL makes the review diff simple. Bug: angleproject:4911 Change-Id: Id48257884dccb7c86f7de2cc9ca95e651fb68df7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2340788 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill adc250c3 2020-07-31T21:11:05 Vulkan: Refactor ImageViewHelper serials. Instead of storing a dictionary of serials to specific image views we now store a single 32-bit serial combined with subresource info. The serials combined with a subresource info (level/layer) gives a unique identifier for each ImageView in the ImageViewHelper for the descriptor set cache and the Framebuffer cache. Also moves ImageView serial allocation to initialization and release. This means we no longer need to use "getAssign" methods and instead we use a few init methods to ensure the serials stay allocated. Bug: angleproject:4911 Change-Id: Ia6af76ae16b3ff5d4a83974bde05cc704064b079 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2333395 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi f776eb9c 2020-08-01T23:45:24 Vulkan: EXT_multisampled_render_to_texture2 support The previous change that implemented EXT_multisampled_render_to_texture already provisioned this extension in the Vulkan backend. This change implements the front-end for this extension and enables it in the Vulkan backend. Bug: angleproject:4836 Change-Id: I7080260972e61727c5716051c236f635668cb67b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2330510 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Shahbaz Youssefi 47207e42 2020-08-01T23:43:43 Vulkan: Fix blit/resolve of mixed-samples framebuffers A framebuffer could contain a mixture of multisampled and multisampled-render-to-texture attachments. When used as the source of a glBlitFramebuffer operation, the former requires a resolve while the latter is a blit. This change fixes this use-case. Bug: angleproject:4836 Change-Id: I1d39bf25f54df9f8b68304058596a2d1c975f9ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2333987 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 22e6fc03 2020-07-31T15:58:28 Vulkan: Move Resource Serial gen into Renderer. Putting Serial allocation in the Renderer allows the Helper classes to manage allocating its own Serial. The init functions for ImageViewHelper only have access to a vk::Context/RendererVk, not a ContextVk. This will be updated in a future CL. Re-uses the Serial Type X-Macro to do more code generation. Serial allocation now uses an atomic because of its now Renderer shared location. Bug: angleproject:4911 Change-Id: I2d5d3d0bbf613d5468de795a700f66164291bc79 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2332884 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Charlie Lao 4e1abc75 2020-07-24T10:38:40 Vulkan: Set depthStencil loadOp to DontCare when not used and stored If depth stencil buffer is disabled during entire renderpass, and at the end of renderpass we are not storing the data back to memory, then force the loadOP to DontCare to avoid unnecessary depth stencil load or clear. Bug: b/162080462 Change-Id: I30905a6d45bec038de68e7f363ec699eb2be09ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2317726 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao dae77893 2020-07-30T11:57:40 Vulkan: Avoid clearWithClearAttachment if RP command buffer is empty If renderpass has started but no command has been issued, we should chose to use loadOp to do clear instead of clearWithClearAttachment. Bug: b/162521656 Change-Id: Ia681fc96442c7916b4b92c48e970d9ed239a28c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2330225 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Shahbaz Youssefi dcc56215 2020-07-19T01:12:09 Vulkan: Implement GL_EXT_multisampled_render_to_texture This change allows the use of resolve attachments in the Vulkan backend. GL_EXT_multisampled_render_to_texture is implemented using this feature. The infrastructure for specifying resolve attachments is designed with eventual support for GL_EXT_multisampled_render_to_texture2 in mind as well as optimizations to glBlitFramebuffer() and multisampled backbuffers. Proper support for glRenderbufferStorageMultisampledEXT is still missing from this change. All tests use this for the depth/stencil attachment and don't read back the data. Currently, the depth/stencil attachment is created as a normal multisampled image. Bug: angleproject:4836 Change-Id: I110a7f63312ae61a657b6094adf7d97c92bd5843 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2304170 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 68791f89 2020-07-20T17:42:23 Vulkan: Fix sub invalidate marking render targets undefined When glInvalidateSubFramebuffer is called, the framebuffer is only partially invalidated. FramebufferVk::invalidateImpl was nevertheless marking the render targets as undefined, which would lead the subsequent render pass have loadOp=DONT_CARE. This is not correct, as the rest of the framebuffer is expected to still be valid. Bug: angleproject:4859 Change-Id: I2e64baa32b1fc84beb8008411b564cd7619af962 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2309111 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi f6659b3d 2020-07-20T15:55:52 Vulkan: Fix invalidate + deferred clear Imagine the following scenario: 1. Clear draw framebuffer 2. Invalidate draw framebuffer 3. Copy from read framebuffer into texture that is attached to draw framebuffer 4. Draw again into draw framebuffer At step 2, FramebufferVk::syncState is called which extracts the clear and stores it in mDeferredClears, but since the framebuffer description hasn't changed, a new render pass is not started. At step 3, the texture attached to the draw framebuffer is used as copy destination, but its clear which is stored in the (apparently irrelevant) draw framebuffer is not flushed. At step 4, a new render pass is started which clears the draw framebuffer, trampling the copy in step 3. This change makes sure invalidate results in a flushDeferredClears(). With glInvalidateFramebuffer() (not glInvalidateSubFramebuffer()), the deferred clears for invalidated framebuffers are discarded first. It is unknown whether there are similar situations where syncState gathers deferred clears, but they are not flushed before the attachments are updated outside the framebuffer. To catch similar bugs in the future, assertions are added to FramebufferVk::syncState such that if a dirty bit is set for the contents of an attachment, we can make sure there are no prior deferred clears stored for that attachment. Bug: angleproject:4862 Change-Id: Idb1a08b53e7f011f0fc9a54d478289030b6d77a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2308034 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Courtney Goeltzenleuchter 93eb633c 2020-07-07T15:41:38 Inline depth/stencil clear if in middle of renderpass Some apps have a pattern where they clear the depth & stencil buffers in the middle of the frame which causes the Vulkan backend to stop the existing render pass and start a new one. This causes more loads & stores of buffer contents than if we inline that clear with a draw. Bug: b/159808300 Bug: angleproject:4695 Change-Id: I7a15af22f47a81051fa33fa19eaa123d8b66597c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2289945 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi d9818fd6 2020-07-19T00:37:21 Vulkan: Improve RenderTargetVk's getImage interface Prior to this change, RenderTargetVk had getImage() and getImageForWrite(). This change introduces getImageForCopy() and renames getImage() to getImageForRenderPass(). Currently, all three functions do the same thing. However, with upcoming changes the semantics will be different: - getImageForRenderPass(): This is the image used as the non-resolve attachment. When resolve attachments are introduced, there will be a corresponding getResolveImageForRenderPass(). - getImageForCopy(): When GL_EXT_multisampled_render_to_texture is implemented, this will return the image that owns the data. - getImageForWrite(): Similar to getImageForCopy(), but should set mContentDefined. This is currently missing, and is a bug that will be resolved in a follow up. This split change gets the mechanical rename out of the way to make future changes simpler. Bug: angleproject:4836 Bug: angleproject:4859 Change-Id: I5f7657cc049c0e1772a7c510e74289e685ba93c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2306516 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi d8ce865b 2020-07-19T00:20:17 Vulkan: Make room in RenderPassDesc for resolve attachments Data in RenderPassDesc is packed better to make room for resolve attachments (9 bits made available; 8 for color and 1 for depth/stencil). mColorAttachmentRange contains values in [0, 8). The right side of the range is made inclusive (i.e. [0, 7]) so it will fit in 3 bits. The number of samples is always a power of 2, and below 128 (for the foreseeable future), so its log is stored instead in 3 bits. This change doesn't add support for resolve attachments yet, but is split off the one that does to simplify it. Bug: angleproject:4836 Change-Id: I2856286d5239499d0ab0c78b8154881c003309bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2306515 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Ian Elliott 7e2a9820 2020-07-20T12:38:05 Vulkan: Make explicitly-[non-]rotated get methods Split FramebufferVk::getCompleteRenderArea() into 2, [non-]rotated, explicitly-named methods. Simplify the uses of these methods, and fix some rotation cases. Also explicitly-name FramebufferVk::getScissoredRenderArea(). Bug: b/151111296 Change-Id: I1754ec2796fd8625b916a2dba2e723e70ecba419 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2305389 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi cd5489ad 2020-07-19T00:05:21 Vulkan: Faster FramebufferDesc compare Objects of this class are used as keys to a hash map and contain 10 serials. Prior to this change, operator== would compare all 10 serials. This change tracks the maximum index set and only compares up to that many serials. To make sure this maximum index stays low in the presence of depth/stencil attachment, this class stores the depth/stencil attachment's serial before the color attachments. The update API of the class is improved so this implementation detail is not leaked. This is in preparation for supporting resolve attachments, which would add another 8 serials to the class. With this change, the performance of cases that don't use resolve attachments won't be affected. Bug: angleproject:4836 Change-Id: Ia4874ab79163901fb86f5bee4120e9f19babdc09 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2306514 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Ian Elliott bcec11c2 2020-07-16T18:28:17 Vulkan: FramebufferVk::clearImpl() break-RP fix FramebufferVk::clearImpl() needs to potentially rotate the results of getCompleteRenderArea(), so that it can be compared with the results of getScissoredRenderArea(). Bug: b/151111296 Change-Id: Iad1fbdcb1943bae00835d31863d32ee85dbc7c2d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2303606 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Charlie Lao 67980f13 2020-07-08T08:51:02 Vulkan: add Buffer/Texture/ImageViewSerial class In a few places we need a unique ID to represent that object and use that to compute hash key. Right now we are using Serial for that purpose but it creates confusion with QueueSerial which we are using Serial to track GPU progress. This CL changes these usage of Serial to TextureSerial, SamplerSerial, ImageViewSerial type so that compiler can perform type checking. It also adds BufferSerial in preparation for next CL. Bug: b/159457348 Change-Id: I8e2da69c2029e4ddbcf163981ae46f85e19f751b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2287426 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 95bfb3e5 2020-07-08T23:07:48 Vulkan: Fix resolve draw path If the draw path is taken for resolve, the internal shader previously calculated (1+sum(sample.a))/sampleCount instead of sum(sample.a)/sampleCount. Additionally, due to a typo, the result was rounded. This change also fixes a number of off-by-one errors when calculating src/dst offsets in blit/resolve path. Tests are added to resolve from default to FBO and vice versa to exercise the draw path which was otherwise never invoked for color buffers. Bug: angleproject:4746 BUg: angleproject:4092 Change-Id: I4b9c181339b89af44b27d61d27a6b3d88cde2eea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2288224 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Courtney Goeltzenleuchter b31a1939 2020-06-25T08:13:20 Vulkan: Implement invalidate for color buffers This will set the color buffer load_op to DONT_CARE if the application has invalidated the color buffers prior to drawing. Will also set load_op to DONT_CARE for depth & stencil, though this isn't likely a common use case. Tests: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_* --use-angle=vulkan angle_end2end_tests --use-angle=vulkan --gtest_filter=StateChangeRenderTestES3.InvalidateNonCurrentFramebuffer/ES3_Vulkan Bug: b/150458520 Bug: angleproject:4444 Change-Id: I6ce3d20fc1e9f4ab7ba3af9755c5ddc544f58ddd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2267057 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Ian Elliott da3e6451 2020-06-25T23:49:22 Vulkan: Fix fbo_invalidate tests for pre-rotation The BlitFramebuffer path wasn't properly supporting stencil and MSAA paths for pre-rotation: 1) The stencil path on Android isn't going through UtilsVk::blitResolveImpl, but requires changing UtilsVk::stencilBlitResolveNoShaderExport for rotation. 2) MSAA resolves requires rotating clippedSourceArea. Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\* Bug: b/158337857 Change-Id: I092cab302c247ff9b2e262b12de3d1a56a257f8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2269499 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Manh Nguyen d4874cb3 2020-06-25T10:49:32 Reformat Framebuffer::readPixels Reformat Framebuffer::readPixels and its overriding methods to the following method signature angle::Result readPixels(const Context *context, const Rectangle &area, GLenum format, GLenum type, const PixelPackState &pack, Buffer *packBuffer void *pixels); This will allow capture replay tool to use its own PixelPackState to read pixels from framebuffer without having to set the global states Bug: angleproject:4787 Change-Id: Idc64179d8e8f6b5163ef0747f239cd5172a2491b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2267417 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 70e706f4 2020-06-22T18:14:44 Vulkan: Fix glBlitFramebuffer() for pre-rotation This involves cases of blitting to/from a rotated default framebuffer, potentially with scaling in one or both dimensions. Various adjustments are needed at different times in the stack, including in the custom BlitResolve fragment shaders. Various tests are affected, including the following: Test: angle_end2end_tests --gtest_filter=*EGLPreRotationLargeSurfaceTest.OrientedWindowWithBlitFramebuffer Test: angle_deqp_gles3_tests --gtest_filter=dEQP.GLES3/functional_fbo_invalidate_\* Bug: b/158337857 Change-Id: Ibb176e4215784e85c0f34e6e1c22ba662517fed2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2242359 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Tobin Ehlis 34ca1ac7 2020-06-16T12:05:12 Vulkan: Fix FramebufferVk cache Migrate Serial from Image to ImageView. Imageviews are what are utimately used in FramebufferVk, so move the Serials into the ImageViewHelper class. Since that class also knows the level/layer of the imageView, we can revert to using a single Serial per ImageView instead of the AttachmentSerial that included the layer and level. ImageViewHelper caches Serials per layer/level combo. Bug: angleproject:4651 Change-Id: I3741d7d03523eada84295cb712c1cc1e6e3c3867 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2248203 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Antonio Maiorano 13816d2d 2020-06-16T14:27:04 Move vulkan_headers/entry_points to common/vulkan This will allow us to move common headers, such as extension headers, to common/vulkan. Bug: b/159027603 Bug: b/154620295 Change-Id: I1ff73dc5b7ee8f7dfb3ac0c5f30bd4b3a8183aeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2248205 Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao d87927c1 2020-06-10T17:40:28 Vulkan: Initialize stencil ops with DontCare for color attachments Even though they shouldn't matter for color attachment, but Qualcomm's performance validation layer is producing tons of this warning message. This basically always set to DontCare even for color attachment. Bug: b/158708100 Change-Id: Iaba39e099c9cc4716548f337ded74fa5f29bb654 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2240498 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Tobin Ehlis b50541b2 2020-01-14T09:07:03 Vulkan:Adding key perf trace markers Adding trace markers in performance-critical functions. Primary areas of interest are command buffer processing and cleanup and memory mapping. Bug: b/156403378 Change-Id: Icba53024771711d79f7eee7085bf4dae0e033e63 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002689 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi 3d2de99e 2020-06-09T01:14:42 Vulkan: Fix RTs attached to textures with non-0 mip Cleared confusion between GL level indices and VK level indices by adding the corresponding suffix to variables and function arguments. A handful of places that sent one index and expected the other are fixed. The conversion between the two is given by: levelIndexGL = levelIndexVk + baseLevel; Bug: angleproject:4695 Change-Id: I84ecbaf867d00a40fb39b6db7ad79658016f4d9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2235362 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott a91dcb62 2020-06-05T09:46:56 Fix FramebufferVk::getScissoredRenderArea() for pre-rotation This fixes cases where pre-rotation wasn't occuring for small scissors used with glClear(). There are around 1000 tests that do this. Test: angle_deqp_gles2_tests --gtest_filter=dEQP.GLES2/functional_fragment_ops_depth_stencil_* Bug: angleproject:4431 Bug: b/157933235 Bug: b/157933198 Change-Id: I469d51975e3bc3a7bfc9521a3817c919e809f7dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2228211 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Ian Elliott d0146e07 2020-05-12T14:47:11 Vulkan: Rename SurfaceRotationType to SurfaceRotation Follow-on CL per request in https://chromium-review.googlesource.com/c/angle/angle/+/2191425/3/src/libANGLE/renderer/renderer_utils.h#48 Bug: angleproject:4436 Change-Id: I2ee8c65a0dbcf2eee4c9c7f4252abf16a578cad3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197614 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill d705f18f 2020-05-11T13:53:13 Vulkan: Add immediate scissored clears. This allows us to avoid using draw commands with pipelines for scissored clears. This prevents some tests from generating large numbers of VkPipelines. Bug: angleproject:4517 Bug: angleproject:4617 Change-Id: Id4a44000078098a60aa89233cfef30b75727d108 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2194473 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Ian Elliott e9dcffb1 2020-05-11T17:36:33 Vulkan: Enhance ReadPixels to deal with pre-rotation Depending on the orientation, the source image may be row-major or column-major; with positive or negative x/y-axis pitches. Regardless of the orientation, the destination remains row-major. Bug: angleproject:4436 Bug: b/150329975 Change-Id: Ia1287f7036f07548d35128f1761feadf721cd78a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2191425 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill d657e1d7 2020-04-24T13:13:18 Vulkan: Defer framebuffer clears. This works by storing the deferred clears in the ImageHelper's staging buffers. We apply the deferred clears onto the RenderPass right before we begin to draw. Storing the clears in the ImageHelper solves problems where we clear GL Textures in a Framebuffer and then unbind the Textures and sample from them. Or do other commands like CopyTexImage. Note that because the staging buffer clears only handle full-image clears we need to immediately apply some scissored clears where before we would use the RP. This should be a pretty rare occurrence and it is possible to optimize that in the future. Reduces the RenderPass count in the Manhattan "frame 10" trace from max 22 to max 20. May improve perf slightly on Android or may have effects too small to measure. Should not regress performance. Bug: angleproject:4517 Change-Id: I02150d531022afb903f1058f070937ec6337bd88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2142711 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fbc2f063 2020-04-24T13:00:11 Vulkan: Refactor AttachmentOpsArray. Will allow for more flexibly setting ops when we defer clears. Bug: angleproject:4517 Change-Id: I7d9116bc92e90eb41a1030fea242eadf1cc74562 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165629 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jonah Ryan-Davis 3cb9c4be 2020-03-13T13:56:47 Statically link vulkan-loader on Mac Disable angle_shared_libvulkan on Mac since we are the only client. Re-add codepaths to support this. Bug: angleproject:4477 Change-Id: Ie128c83adaae741636541bbfd6105d160d874a8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102954 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Charlie Lao 03c18fbd 2020-04-13T16:01:01 Vulkan: Skip load if depth/stencil value are undefined EGL1.5 spec says depth/stencil data are undefined after swap. This CL will track the depth/stencil data and mark it as undefined and skip the load if it is undefined. Bug: b/153885625 Change-Id: Ifb3d88d442da547fa78c1eae091cbae08a20d0ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2148179 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 8c67c079 2020-04-16T14:42:15 Vulkan: store ImageLayout in PackedAttachmentOpsDesc The layout in the PackedAttachmentOpsDesc only have 5 bits, not enough for raw VKImageLayout enums. This change will store vk::ImageLayout which are ANGLE defined and packed for 5 bits and able to handle the extension bits of VKImageLayout. Bug: b/153885625 Change-Id: Ida268a974094188d8aeee39c61019eef30a60507 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2153845 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1033d55d 2020-04-07T14:01:24 Pass binding enum to Framebuffer::syncState. Will allow us to determine if we're clearing the read or draw FBO. Then we can stash clears for the draw FBO only and issue them immediately for the read FBO in the Vulkan back-end. Bug: angleproject:4517 Change-Id: Ifc043317d6156a75749b13f9d2c44a17e14ee378 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2139997 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c916fe8a 2020-04-02T16:57:49 Don't call syncState inside FBO queries. This prevents a syncState ordering issue that was confusing FBO sync when robust resource init is enabled. Also cleans up some redundant format processing for the half float extensions. Bug: angleproject:4517 Change-Id: Ieb13fc5203cf824a3e8affda96ea5cbbd89d78ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134411 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dd00f16b 2020-04-02T14:04:44 Vulkan: Fix FBO cache when updating disabled attachments. Fix this by consistently checking if the attachment is enabled when we update the serials. Also includes a regression test and more ASSERTs. Bug: angleproject:4540 Change-Id: I154d23cad71f1674d893390f923f45c643a58925 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134409 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Alexis Hetu b83b0f5e 2020-01-31T15:09:17 Add support for NV_read_depth, NV_read_stencil and NV_depth_buffer_float2 extensions This cl adds the ability for the ReadPixels function to read other attachments than the color attachment. Checks were added for both depth and stencil attachments. A new test was added (DepthStencilFormatsTest.DepthStencilReadback) to test this new functionality. As the name mentions, it's used to test reading from the depth and stencil attachments using ReadPixels. Bug: angleproject:4295 Change-Id: I6fe9be11f05d6055a5883b4315f870e7c0ac41ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2031702 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
Jamie Madill 13c139e7 2020-03-21T15:25:50 Support masking out DS feedback loops in RenderTargetCache. Currently this is a pure refactor and doesn't change any functionality. In a follow-up we can us this bit to mask out DS RTs when Manhattan and other apps render with feedback loops. Bug: angleproject:4517 Change-Id: I80ccd022d90a781506791110d11be195db8cd3e9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112936 Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 6fead375 2020-03-21T14:06:19 Vulkan: No-op redundant FB state changes. This uses a trick by comparing the prior to the updated FB description to filter out rendundant changes. Will allow the front-end syncState to sometimes noisily report state changes when there aren't any in the back-end. Ideally we wouldn't generate any updates when there aren't real changes. However because Manhattan often transitons between a few zero states it gets a bit difficult to determine in the front-end. Also adds a no-op for redundant samples changes in the front-end. Fixes a regression in the number of RenderPasses in Manhattan from work to support rendering feedback loops. Bug: angleproject:4490 Change-Id: Ibf83d584107a4561da7ad47a2d3fb543e63e31f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2112935 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4fb3c28f 2020-03-19T19:10:45 Vulkan: Fix Framebuffer cache depth/stencil issue. The DrawBuffers resetting logic didn't update the depth/stencil serial. Fix this and add a regression test that would crash in this situation. Note that the Manhattan benchmark could trigger this under some cases. Bug: angleproject:4322 Bug: angleproject:4490 Change-Id: Ie4b24efeb5991ecaa85bf8f964f77476bd6f167d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2111333 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tobin Ehlis 175227ba 2020-03-06T14:30:06 Vulkan:FramebufferVk cache draw buffer handling Dirty draw buffers are causing cache clears on Manhattan. Instead of clearing out the entire FramebufferVk cache when draw buffers are dirty, reset the cache signature and regenerate it. This change also contains a fix to make sure that we're not generating serials for a draw buffer that's disabled. Thanks Jamie Madill! Bug: angleproject:4442 Change-Id: I0d48a2d6d95e74898a11bdde0fedbce77c82a3a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2091862 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill 5d7ccc30 2020-03-09T14:24:30 Revert "Vulkan: Fix store ops with linear command recording." This reverts commit a61e273ac3ca88cb95b7bebac0d31a62644049a0. Reason for revert: Causes rendering artifacts in "Aztec Ruins". Bug: angleproject:4444 Original change's description: > Vulkan: Fix store ops with linear command recording. > > DiscardFramebuffer was being ignored in the new linear path. Fix this > by using the correct APIs. Also cleans up some of the access to the > "RenderPassCommandBuffer" struct in ContextVk. Add a new accessor that > returns the RenderPass without a flush that ensures it is only called > when a RenderPass is already started. > > Bug: angleproject:4029 > Change-Id: Ibd199f3a371c0f91b448a0b34c8752dc8b76c284 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057329 > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,jmadill@chromium.org,cclao@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4029 Change-Id: I7d925b88c438a20ebe4a48634568addda7a64d60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2093157 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: 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>
Jamie Madill aa09ca69 2020-02-24T13:33:30 Vulkan: Update ContextVk command buffer access methods. Use the following names: - flushAndBeginRenderPass - endRenderPassAndGetCommandBuffer - flushAndGetPrimaryCommandBuffer This clarifies that a flush is part of the method. Bug: angleproject:4029 Change-Id: I6c870761339ea7aa39c83142200781ba39ad6a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2068129 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill a741abb9 2020-02-21T16:37:37 Vulkan: Rename CommandGraphResource to Resource. Also renames the h and cpp files to ResourceVk (to keep distinct from other resource.h/cpp files) and renames 'onResourceAccess' to 'retain'. Cleans up a few remaining mentions of the command graph in comments. Bug: angleproject:4029 Change-Id: Ifc8e880c8cea3fc48a4aec4730191c88aa35a076 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill d3aad0f4 2020-02-20T08:59:58 Vulkan: Remove command graph size overlay widget. No longer applicable without the command graph. Bug: angleproject:4029 Change-Id: If75e3aca56eb18567074e14ceb23b3fd7a0afb3d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065919 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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>
Tobin Ehlis cf2ec3b1 2020-01-31T16:55:50 Vulkan:Add FramebufferVk cache This adds a FramebufferVk cache. Cache signature is based on unique Serial values that are assigned to ImageHelper objects backing all color and DS rendertargets as well as level/layer values unique to the imageView. Update the Serials and cache signature at FramebufferVk::syncState() time. L0 cache is a currently active framebuffer. L1 cache retrieves previously created framebuffer from new cache. If neither of those hit, create new FramebufferVk and add to L1. Bug: angleproject:4322 Change-Id: I3f585271798ddfb9e5f194020adca8cf8a6b19dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033869 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill a61e273a 2020-02-19T14:51:40 Vulkan: Fix store ops with linear command recording. DiscardFramebuffer was being ignored in the new linear path. Fix this by using the correct APIs. Also cleans up some of the access to the "RenderPassCommandBuffer" struct in ContextVk. Add a new accessor that returns the RenderPass without a flush that ensures it is only called when a RenderPass is already started. Bug: angleproject:4029 Change-Id: Ibd199f3a371c0f91b448a0b34c8752dc8b76c284 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057329 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao ef599fb0 2020-02-11T18:19:16 Vulkan: Fold glClear into draw call when command graph is disabled This sets ContextVk::mRenderPassCommandBuffer properly when glClear get called so that it wonr end up start anotyer render pass during setupDraw call. Bug: angleproject:4395 Change-Id: Id2110719ad4d70b4c410062466d32381fb5e1f88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2050966 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3c066404 2020-02-05T12:43:12 Vulkan: Command graph linearization (Step 4). Implements GLES 3.0 functionality for the new command recording style. Tested with angle_end2end_tests. dEQP/CTS testing will come later. Bug: angleproject:4029 Change-Id: Ibdc4f1355a7b880946699ec227fd9807f4a27af9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040197 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20b1259a 2020-02-05T17:08:05 Vulkan: Command graph linearization (Step 2). ES 2.0 is feature complete. Passes all of the angle_end2end_tests with the new linear command recording method. Also runs the T-Rex benchmark without any obvious glitches. Likely has issues with creating too many RenderPasses. ES3 is mostly untouched. Bug: angleproject:4029 Change-Id: Ic5acf3d768495fbffd07b07bf0a6f2b5787c51f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2012900 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 71153201 2020-01-29T14:42:30 Vulkan: Disable restartRenderPassAfterLoadOpClear workaround This workaround was added due to qualcomm driver bug b/129281932. But this has been fixed with recent drivers. Removing the WR here so that it will not negatively affect performance. Bug: angleproject:4344 Change-Id: Iea2ec86082a0ced64bfe843bf916c6bdb2aea60b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2029210 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 3712b2e4 2020-01-24T17:08:30 Vulkan: Command graph linearization (Step 1). This initial prototype introduces a new feature to the Vulkan back-end that disables the deferred command recording. The intent is to have a lower CPU overhead during submission calls which currently walk a DAG. The feature is not complete. Currently it only passes the ANGLE SimpleOperationTests. Moreover it is extremely simple and only allows use of one command buffer at a time. In the future we'll allow open command buffers for recording outside and inside render pass commands at the same time. We'll also support collapsing RenderPasses together for some use cases. Currently the prototype only passes "SimpleOperationTest". There are quite a few unimplemented features like queries, XFB, etc. Bug: angleproject:4029 Change-Id: I82760986683f55e37ac4ea559de6f4cffb6ef84e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953485 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 579c5940 2020-01-17T13:20:21 Vulkan: Rename onGraphAccess to onResourceAccess. Clarifies the function for the upcoming command graph linearization. Bug: angleproject:4029 Change-Id: Ib50997c007053757de533f69c155a92d7555e0b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2003235 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 441b72f0 2020-01-16T14:48:39 Vulkan: Make ContextVk own ResourceUseList. This moves the resource use tracking functionality out of CommandGraph. Making the list a separate class helps the implementation avoid tricky circular include problems. Bug: angleproject:4029 Change-Id: I3288fc685b21e949f12b0796109a2b7bb117c249 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002931 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4ff1651e 2020-01-16T12:42:27 Vulkan: Add ResourceUseList helper. This abstracts away the ResourceUse tracking from CommandGraph. Pulling it out will allow us to more easily swap resource use tracking into ContextVk. The command graph is eventually going away so we need to move functionality out of CommandGraph. Bug: angleproject:4029 Change-Id: Icc3bcc824510b03e91f8ff010a82751a81516bfa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002930 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis 5fd73782 2019-08-09T11:46:46 Vulkan: Use volk to load vk* func ptrs Thanks to Jamie Madill for some fixes to get all CI test passing w/ volk. This change updates all ANGLE targets that use Vulkan to dyanmically link all of the VK entrypoints using the volk OSS library from https://github.com/zeux/volk. It's only two source files so baking them directly into ANGLE repo. Also it's used in both the tests and libANGLE trees so added to src/common/third_party/volk dir. Updated volk and the renderer to track latest instance and device that were loaded and renderer will refresh vk* function pointers if the current and previous device and/or instance don't match. This prevents errors in the test framework as we transition between backends, especially between VK HW & SwiftShader ICDs. This change rolls the Vulkan Loader forward to use the latest loader version which no longer allows static linking but requires dynamic linking. Bug: angleproject:3740 Bug: angleproject:4092 Bug: angleproject:4162 Bug: angleproject:4210 Bug: angleproject:4225 Change-Id: I8a0b7d24c9545bbfdfaa4b9357a9bfe6793e0140 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965640 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott 4576f1d0 2019-12-05T10:10:48 Vulkan: Implement multisample textures This functionality is exercised by running angle_deqp_gles31_tests with the following sets of command arguments: --gtest_filter=dEQP.GLES31/functional_texture_multisample* --use-angle=vulkan --gtest_filter=dEQP.GLES31/functional_state_query_texture_level_texture_2d_multisample* --use-angle=vulkan --gtest_filter=dEQP.GLES31/functional_state_query_texture_texture_2d_multisample_texture_immutable* --use-angle=vulkan The following are some high-level design notes: - Texture::setStorageMultisample() handles converting the "requested number of samples" to the actual number of samples used (e.g. converting 3 to 4), supported by the underlying back-end). The actual number used is stored in gl::TextureState::mImageDescs, for use by other GLES commands. - ANGLE uses the Vulkan standard sample locations/positions. If the underlying Vulkan driver's VkPhysicalDeviceLimits::standardSampleLocations is false, ANGLE limits itself to GLES 2.0 (i.e. before GLES 3.0 which adds multisample renderbuffers). - The Vulkan specification currently doesn't support ANGLE providing support for GLES 1-sample textures, because of the following Vulkan specification statement: - If the image was created with VkImageCreateInfo::samples equal to VK_SAMPLE_COUNT_1_BIT, the instruction must: have MS = 0. - At least one Vulkan driver returns different VkPhysicalDeviceLimits::*SampleCounts for different formats. Because of this, ANGLE does a logical-AND of all values in order to only support the commonly-available numbers of samples. The detailed design document is located at: https://docs.google.com/document/d/1NiM8gAR74iGGXGTE6IP1ChdDUZjhtXRuJdtEp_wGFEM/edit?usp=sharing Bug: angleproject:3565 Bug: angleproject:4103 Bug: angleproject:4104 Bug: angleproject:4196 Bug: angleproject:4197 Bug: angleproject:4198 Change-Id: I28921badf9568427799b0af347198b5df06c2db0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1919982 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill bb35bb4e 2019-10-29T17:17:04 Vulkan: Implement simple case ANGLE_get_image. A couple cases are left unimplemented: Incomplete/unused Textures. This leads to a slightly more tricky implementation. Since we need to read back from the staging buffer we will need to flush the Image contents to a temporary buffer. Depth/stencil readback. Requires a more complex pixel packing step. 3D/Cube/2D Array readback. Also requires a more complex packing step. Bug: angleproject:3944 Change-Id: Ic5d9a606177ba7e3e5ab945feb5f555afa11741f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879964 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 96ba0f12 2019-10-28T13:51:42 Vulkan: Move readPixels logic to ImageHelper. This logic will be shared with ANGLE_get_image. Cleans up some of the graph access logic so it can work easily with TextureVk/RenderbufferVk. Bug: angleproject:3944 Change-Id: If069528f27b2c291d52de892c707562875b95227 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879962 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>