src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.cpp


Log

Author Commit Date CI Message
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>
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>
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>
Shahbaz Youssefi d134581b 2021-10-07T16:09:25 Vulkan: Remove SyncHelper::mEvent Now that inserting a sync object incurs a flush, we can use the serial to perform synchronization. Bug: angleproject:6464 Bug: angleproject:6481 Change-Id: I8c82a12855b6497861ce34854d165af82956b384 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3212573 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 2f1d503b 2021-09-16T21:49:14 Vulkan: Fix Vulkan secondary command buffers This change abstracts initialization, begin/end, reset and recycle of command buffers such that both Vulkan and ANGLE secondary command buffers are supported. Bug: angleproject:6100 Change-Id: I8c79764ac98b599fda08fe45cf8c4f0a6573f0f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987873 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 851fbedb 2021-06-10T21:27:01 Vulkan: Switch viewport and scissor to dynamic state Heavily based on http://crrev/c/1316888 Some apps are creating a large number of viewport combinations and are running out of graphics memory. This CL drops their graphics pipeline use from tens of thousands to tens. Performance testing shows little impact to application traces. Bug: b/190026813 Bug: angleproject:3143 Change-Id: Ib7415be1128f8fedae4a7ca72e067b2815201223 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2954925 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2c8bc1b7 2020-11-26T16:06:24 Vulkan: Clean up render pass query code In preparation for support of primitives generated queries. Bug: angleproject:5404 Change-Id: Ic123aaff33f8903994ff8fcc9158954ac023ec13 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562126 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi dd4b6445 2020-10-09T15:15:01 Vulkan: Boilerplace for vkCmdSetScissor Bug: angleproject:4836 Change-Id: I4fa5355fc3e7fcf3ecd091d299c5c0c8d3a74732 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2463984 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 29b1f07f 2020-09-08T13:52:49 Vulkan: Boilerplate for vkCmdNextSubpass Bug: angleproject:4881 Change-Id: I5c46c07e8c7865ef2bfd8aff0d3f8b5ba3ecd750 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2399181 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Tobin Ehlis 428e4415 2020-04-27T12:27:00 Vulkan: Migrate trace events and occlusion queries Moved GPU trace event and occlusion query commands that were on the primary command buffer to the SecondaryCommandBuffer (SCB). Putting these commands on outside render pass SCB and flushing those commands to primary on-demand as needed to maintain ordering of commands. For resetQueryPool command used by occlusion query, allow the SCB to queue up that command for inside RenderPass SCB. This avoids ending a renderPass prematurely and allows all outstanding reset commands to be executed before the beginRenderPass command since the resets must occur outside of a renderPass. This is groundwork to simplify the hand-off of SCBs from the main thread to a worker thread. Long-term we'd like a single SCB that can handle both inside and outside renderPass commands at the same time to pass to the worker thread for processing into a primary CB. Bug: b/154030403 Bug: angleproject:4603 Change-Id: Ic1023ae27a9b14435743549ea9933edf1c4b318b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2168114 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 45bb2b9c 2020-04-22T17:09:41 Vulkan: Add debug label commands to SecondaryCommandBuffer Add begin/end/insert DebugUtilsLabel commands to SecondaryCommandBuffer. Switch use of these commands to the outside renderpass command buffer instead of directly in the primary command buffer. This change should maintain the exact same sequence of commands but avoids some direct use of the primary command buffer. This is desirable for the threaded refactor where a worker thread will process the SecondaryCommandBuffer into a primary and the main thread will no longer use the primary command buffer directly. Note that because the debug utils label has an arbitrarily long string that we need to adjust the command allocation to allow for the string size exceeding the default allocation size. In this case we just make a single larger allocation to accommodate the command with the large string. Bug: b/154030403 Change-Id: Iab7832ffc3d38ce168da2d624bd5b5d5b33ec11b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2161955 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Tobin Ehlis 764d572b 2020-04-21T11:15:41 Vulkan: Refactor SecondaryCommandBuffers class A strictly cosmetic change to move code into alphabetical order. In working with SecondaryCommandBuffer commands in separate CLs, it can be difficult/annoying to track which commands are already in place as some of them are out-of-order. This change puts the command enums, functions, and processing in alphabetical order to simplify searching and adding new commands. Bug: b/154030403 Change-Id: I6dba4cf48d6f27c056585ac633c694e083b1a263 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2158816 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jian Li 943c3bc1 2020-04-16T11:25:02 Vulkan: Fix transform feedback on AMD platform Make sure pCounterBufferOffsets is never a null pointer when counterBufferCount is greater than zero. Bug: angleproject:3206 Change-Id: If161473239b53d2a65b1cccaaf1426a4fefd243a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2152030 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jian Li d5ba916d 2020-04-07T17:59:08 Vulkan: Change to record transform feedback related APIs per spec Fix not to record vkCmdBindPipeline and vkCmdBindTransformFeedbackBuffers during transform feedback is active. Initiated by Hyunchang Kim hckim.kim@samsung.com https://chromium-review.googlesource.com/c/angle/angle/+/1971953 Pause Transform feedback on binding graphics pipeline and end of render pass. Set a new dirty bit to indicate transform feedback may need resume when invalidate graphics pipeline. Test: dEQP-GLES3.functional.transform_feedback.* Test: angle_end2end_tests --gtest_filter=TransformFeedbackTest* Bug: angleproject:3206 Change-Id: I6c70ef461a31dcd618058b167835ac278a21d04a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2139474 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3352d492 2020-02-19T17:41:24 Vulkan: Add command stream diagnostics when graph is disabled. Very simple diagnostics that prints out the command stream. Since there is very little deferral right now the graph itself became quite a bit simpler. Also fills in some missing values in the switch that prints the command name string. Bug: angleproject:4029 Change-Id: Ib64a7fed6f9f56ce406cc7dbc6cc993ed510e2cb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065530 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Hyunchang Kim caa6eccd 2019-10-27T13:46:56 Vulkan: Implement Transform Feedback support via extension Implemented transform feedback extension path. Where VK_EXT_transform_feedback is supported, extension path will be taken over an emulation path. Extension path has advantages in terms of performance. BUG=angleproject:3206 Test: dEQP-GLES3.functional.transform_feedback.* angle_end2end_tests --gtest_filter=TransformFeedbackTest* Change-Id: Ia07c23afb289d9c67073469a97b714ec96f5265a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1882767 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 9601a548 2019-11-23T23:44:52 Vulkan: implement external semaphore barriers glWaitSemaphoreEXT and glSignalSemaphoreEXT functions optionally request buffer and image barriers to be performed by the implementation. If any barriers are present, a single global memory barrier is inserted to take care of memory accesses. In both functions, buffer and image memory barriers are used to perform queue ownership transfers to ANGLE's queue (glWaitSemaphoreEXT) or the EXTERNAL queue (glSignalSemaphoreEXT). In glWaitSemaphoreEXT, the given layouts are information regarding how the external entity (the caller) has modified the images' layouts, and is used to update ANGLE's internal state tracking. Bug: angleproject:3289 Bug: 1026673 Change-Id: Ic478a8813df727c89413c8ae2adf42b5c1d06069 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1933016 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Ethan Lee a825eb70 2019-11-21T11:37:17 Implement BaseVertex draw calls for Vulkan, OpenGL, NULL contexts. This adds support for the following functions: - glDrawElementsBaseVertex - glDrawRangeElementsBaseVertex - glDrawElementsInstancedBaseVertex Bug: angleproject:3582 Bug: angleproject:3402 Bug: angleproject:4166 Change-Id: I83770f62e3a918c0965fd4ca8c7d9e598b8b4154 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929083 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 3c2a5230 2019-09-23T11:07:18 Vulkan: 8bit index support for DrawElementsIndirect Add partial support for DrawElementsIndirect. This supports all primitives types except lineloop. Includes a compute shader for converting 8bit index buffers to 16bit index buffers where the index buffer range is defined in a GPU buffer. Test: dEQP.GLES31/functional_draw_indirect_* Bug: angleproject:3564 Change-Id: Ibe9c55323e46a398f0b703cd8597a72ba6790570 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1792948 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 7c8e276c 2019-09-23T11:06:39 Vulkan: Add support for DrawArraysIndirect Add partial support for DrawArraysIndirect. This supports all primitives types except lineloop. Test: dEQP.GLES31/functional_draw_indirect_* Bug: angleproject:3564 Change-Id: I065417a848390070c9f116db6fd3f90c12fb3886 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1811873 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Shahbaz Youssefi 050b124d 2019-06-30T03:26:18 Reland "Vulkan: Debug overlay" This is a reland of e54d0f90d1a165404236fd7abd1b05ddd041a686 This was reverted due to a build failure as a result of a missing virtual destructor in the widget base class. Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:3757 Change-Id: I47915d88b37b6f882c686c2de13fca309a10b572 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1780897 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Corentin Wallez fc58af47 2019-09-02T07:46:44 Revert "Vulkan: Debug overlay" This reverts commit e54d0f90d1a165404236fd7abd1b05ddd041a686. Reason for revert: causes compile failure on Linux CFI bot. Sample build: https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI/14810 Sample log: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8903575125463586160/+/steps/compile/0/stdout?format=raw Original change's description: > Vulkan: Debug overlay > > A debug overlay system for the Vulkan backend designed with efficiency > and runtime configurability in mind. Overlay widgets are of two > fundamental types: > > - Text widgets: A single line of text with small, medium or large font. > - Graph widgets: A bar graph of data. > > Built on these, various overlay widget types are defined that gather > statistics. Five such types are defined with one widget per type as > example: > > - Count: A widget that counts something. VulkanValidationMessageCount > is an overlay widget of this type that shows the number of validation > messages received from the validation layers. > - Text: A generic text. VulkanLastValidationMessage is an overlay > widget of this type that shows the last validation message. > - PerSecond: A value that gets reset every second automatically. FPS is > an overlay widget of this type that simply gets incremented on every > swap(). > - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an > overlay of this type. On every vkQueueSubmit, the number of nodes in > the command graph is accumulated. On every present(), the value is > taken as the number of nodes for the whole duration of the frame. > - RunningHistogram: A histogram of last N values. Input values are in > the [0, 1] range and they are ranked to N buckets for histogram > calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay > widget of this type. On vkQueueSubmit, the memory waste from command > buffer pool allocations is recorded in the histogram. > > Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py > processes to create an array of bits, which is processed at runtime to > create the actual font image (an image with 3 layers). > > The overlay widget layout is defined in overlay_widgets.json which > gen_overlay_widgets.py processes to generate an array of widgetss, each > of its respective type, and sets their properties, such as color and > bounding box. The json file allows widgets to align against other > widgets as well as against the framebuffer edges. > > Two compute shaders are implemented to efficiently render the UI: > > - OverlayCull: This shader creates a bitset of Text and Graph widgets > whose bounding boxes intersect a corresponding subgroup processed by > OverlayDraw. This is done only when the enabled overlay widgets are > changed (a feature that is not yet implemented) or the surface is > resized. > - OverlayDraw: Using the bitsets generated by OverlayCull, values that > are uniform for each workgroup (set to be equal to hardware subgroup > size), this shader loops over enabled widgets that can possibly > intersect the pixel being processed and renders and blends in texts > and graphs. This is done once per frame on present(). > > Currently, to enable overlay widgets an environment variable is used. > For example: > > $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste > $ ./hello_triangle --use-angle=vulkan > > Possible future work: > > - On Android, add settings in developer options and enable widgets based > on those. > - Spawn a small server in ANGLE and write an application that sends > enable/disable commands remotely. > - Implement overlay for other backends. > > Bug: angleproject:3757 > Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jmadill@chromium.org Bug: angleproject:3757 Change-Id: Ib08e2e7b1a9449ca097673acb11655df5d2bbf31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778862 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Shahbaz Youssefi e54d0f90 2019-06-30T03:26:18 Vulkan: Debug overlay A debug overlay system for the Vulkan backend designed with efficiency and runtime configurability in mind. Overlay widgets are of two fundamental types: - Text widgets: A single line of text with small, medium or large font. - Graph widgets: A bar graph of data. Built on these, various overlay widget types are defined that gather statistics. Five such types are defined with one widget per type as example: - Count: A widget that counts something. VulkanValidationMessageCount is an overlay widget of this type that shows the number of validation messages received from the validation layers. - Text: A generic text. VulkanLastValidationMessage is an overlay widget of this type that shows the last validation message. - PerSecond: A value that gets reset every second automatically. FPS is an overlay widget of this type that simply gets incremented on every swap(). - RunningGraph: A graph of last N values. VulkanCommandGraphSize is an overlay of this type. On every vkQueueSubmit, the number of nodes in the command graph is accumulated. On every present(), the value is taken as the number of nodes for the whole duration of the frame. - RunningHistogram: A histogram of last N values. Input values are in the [0, 1] range and they are ranked to N buckets for histogram calculation. VulkanSecondaryCommandBufferPoolWaste is an overlay widget of this type. On vkQueueSubmit, the memory waste from command buffer pool allocations is recorded in the histogram. Overlay font is placed in libANGLE/overlay/ which gen_overlay_fonts.py processes to create an array of bits, which is processed at runtime to create the actual font image (an image with 3 layers). The overlay widget layout is defined in overlay_widgets.json which gen_overlay_widgets.py processes to generate an array of widgetss, each of its respective type, and sets their properties, such as color and bounding box. The json file allows widgets to align against other widgets as well as against the framebuffer edges. Two compute shaders are implemented to efficiently render the UI: - OverlayCull: This shader creates a bitset of Text and Graph widgets whose bounding boxes intersect a corresponding subgroup processed by OverlayDraw. This is done only when the enabled overlay widgets are changed (a feature that is not yet implemented) or the surface is resized. - OverlayDraw: Using the bitsets generated by OverlayCull, values that are uniform for each workgroup (set to be equal to hardware subgroup size), this shader loops over enabled widgets that can possibly intersect the pixel being processed and renders and blends in texts and graphs. This is done once per frame on present(). Currently, to enable overlay widgets an environment variable is used. For example: $ export ANGLE_OVERLAY=FPS:VulkanSecondaryCommandBufferPoolWaste $ ./hello_triangle --use-angle=vulkan Possible future work: - On Android, add settings in developer options and enable widgets based on those. - Spawn a small server in ANGLE and write an application that sends enable/disable commands remotely. - Implement overlay for other backends. Bug: angleproject:3757 Change-Id: If9c6974d1935c18f460ec569e79b41188bd7afcc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1729440 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi d3b31037 2019-08-29T13:45:43 Vulkan: DispatchIndirect in graph dump output Bug: angleproject:3601 Change-Id: Ib7e5abea3a9fced88f415c6395a3f790aadafdaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776008 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
shrekshao cd31f286 2019-06-25T14:22:41 Implement Draw base vertex and base instance functions This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Workaround for OpenGL driver on Mac: gl_VertexID on Mac with AMD GPU doesn't include baseVertex value. So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any. Workaround for Vulkan GLSL: gl_InstanceIndex on Vulkan includes baseInstance. So replace gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when angle_BaseInstance is declared. Bug: chromium:891861, angleproject:3402 Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Dong 02407743 2019-07-22T10:56:35 Vulkan: implement indirect dispatch Implements indirect dispatch for Vulkan backend. Layout of dispatch structure is the same as OpenGL, so we pass in the buffer directly. Test: ./angle_deqp_gles31_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES31.functional.compute.indirect_dispatch.*' Bug: angleproject:3601 Change-Id: I94c6b1a86d3c24c1ca1bb6a78529b38909a2b91f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1710024 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: James Dong <dongja@google.com>
Shahbaz Youssefi 998a37c9 2019-07-15T22:13:14 Vulkan: merge bindGraphics/ComputeDescriptorSets The two called bindDescriptorSets with a fixed GRAPHICS or COMPUTE bind point enum value. The differentation however would result in unnecessary code duplication with upcoming compute support. Bug: angleproject:3562 Change-Id: Ica4400c573a90fda168c64ad777d87aa83256e48 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1703524 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0fd917a2 2019-06-23T00:50:44 Vulkan: Remove unnecessary same-layout transitions Previously, only read-only layouts skipped same-layout transition. This is extended to color attachment and depth/stencil attachment layouts as well. On Nvidia+Linux, this does reduce the number of barriers in the Draw* benchmarks, though there's no visible CPU-side performance difference. GPU time is not measured in these tests, but it's possible that the driver already skips such transitions (i.e. this only saves us from recording an ineffective transition). Additionally, transfer dst and shader write same-layout transitions are turned into an execution barrier instead of a memory barrier to avoid an unnecessary flush. Currently, this particularly affects texture upload, and shows a 10% improvement in TextureUploadSubImageBenchmark. Note that this optimization is temporarily disabled due to a bug in the windows AMD driver. Bug: angleproject:3347 Change-Id: I7dc9d0b5dd2ad87ec19ae13277b330438038519f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1659149 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9d275db4 2019-06-18T15:37:22 Vulkan: Add vkCmdFillBuffer support Implemented as part of an experiment. Allows easier buffer-related testing by providing a quick way of filling the buffer with dummy data. Bug: angleproject:3205 Change-Id: Ice8cfd0c2566c91a5fb10aaea57985d671d0e7b7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1665351 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi b16d69c3 2019-05-13T16:28:27 Vulkan: Add support for surface multisampling A multisample image is created for the surface if multisampling is enabled. Prior to present, this multisample image is resolved into the swapchain image. FramebufferVk::readPixelsImpl similarly has got the ability to resolve the region of interest into a temporary image prior to readback. Tests are added to render a point, line and a triangle on a 4x multisampled surface. Bug: angleproject:3204 Change-Id: I34aca502fa1918b5cbf000ff11521c350372e051 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610188 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c7565353 2019-04-03T14:03:56 Vulkan: break dependency to the depthClamp feature Image clear's masked clear path using a draw call was using this feature to clear the depth buffer, but this feature is not available on ARM and some Qualcomm devices. This change adds a push constant to the vertex shader used in this call to export the depth clear value, removing the need to rely on depth clamping. Bug: angleproject:3241 Change-Id: I565cd5f731c441820e0702e51dfdf02d0bc7de06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1551522 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi e810ad90 2019-03-26T16:19:17 Vulkan: dump summary of commands in digraph This is possible thanks to SecondaryCommandBuffer. Makes life easier when debugging by not just showing resource type in the nodes, but actual stream of commands recorded in each. Bug: angleproject:3136 Change-Id: I125a32ec2966a55330e60930ca088d1a3673a8ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1538832 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis e18ff25d 2019-03-21T08:41:08 Vulkan:Refactor SecondaryCommandBuffers A bunch of changes to rework and improve SecondaryCommandBuffers. Inlined all of the command functions and moved them into the header. Created new specialized commands for updating Compute/Graphics DescriptorSets and setting a memoryBarrier. Updated all of the pointer storage to be inferred rather than explicitly stored in order to save space. Also removed various params that are fixed in ANGLE to save space. Bug: angleproject:3136 Change-Id: I994bb70d5e4db6d9e71d38ac62451aaec780a5e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535704 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi 2660b503 2019-03-21T12:08:40 Vulkan: Restore CommandBuffer to namespace vk Moved vk::CommandBuffer and vk::SecondaryCommandBuffer to vk::priv:: and aliased vk::CommandBuffer to one or the other. This allows the rest of the classes to continue seeing vk::CommandBuffer as they used to do. Used a special alias for the primary command buffer that gets submitted (vk::PrimaryCommandBuffer). Bug: angleproject:3136 Change-Id: I61236fd182230991db7395d05e3da3be5e3f45be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1534456 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis a8ff8814 2019-03-05T07:06:32 Vulkan:Optimize SecondaryCommandBuffers RELAND of this commit. Had to fix fuzzer build errors. Optimize performance of SecondaryCommandBuffers and enable them as the default build option. To disable this set angle_enable_custom_vulkan_cmd_buffers=false in your build args. This CL enhances the PoolAllocator to have a "fast" mode that can be enabled at class creation. This mode uses an alignment of 1 byte and enables a fastAllocation() call that avoids some bookkeeping overhead. The SecondaryCommandBuffer uses this fastAllocation() function. Furthermore the fast path of fast allocate, using the current page, is inlined for maximum speed. Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate blocks so that the commands occur linearly in memory. This speeds up processing with improved cache coherency and minimizes overhead when recording commands. Also the core Draw functions and their state updates are all inlined as well as the common functions to initialize commands and to copy command pointer data. This change also includes some new, custom commands. One is imageBarrier that is a specialized version of pipelineBarrier that only performs a single image layout transition. There are customized versions of various Draw commands to minimize copying of parameters. There are also specialized commands to bind[Graphics|Compute]Pipeline that have the pipeline type built in to the command. More custom commands and command data size optimizations will be made in follow-on commits. Bug: angleproject:3136 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Change-Id: I621d8f8893308fca240b32390928e8ba0036cf06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535385 Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 896e7811 2019-03-22T14:56:33 Revert "Vulkan:Optimize SecondaryCommandBuffers" This reverts commit 2219b18c984ed69251f3db3c7b5fd69a2fa68c77. Reason for revert: Failing to compile on ASAN builders: https://ci.chromium.org/p/chromium/builders/try/linux-libfuzzer-asan-rel/134782 Currently blocking roll. Original change's description: > Vulkan:Optimize SecondaryCommandBuffers > > Optimize performance of SecondaryCommandBuffers and enable them as the > default build option. > To disable this set angle_enable_custom_vulkan_cmd_buffers=false in > your build args. > > This CL enhances the PoolAllocator to have a "fast" mode that can > be enabled at class creation. This mode uses an alignment of 1 byte and > enables a fastAllocation() call that avoids some bookkeeping overhead. > The SecondaryCommandBuffer uses this fastAllocation() function. > Furthermore the fast path of fast allocate, using the current page, > is inlined for maximum speed. > Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate > blocks so that the commands occur linearly in memory. This speeds up > processing with improved cache coherency and minimizes overhead when > recording commands. > Also the core Draw functions and their state updates are all inlined > as well as the common functions to initialize commands and to copy > command pointer data. > > This change also includes some new, custom commands. One is > imageBarrier that is a specialized version of pipelineBarrier that only > performs a single image layout transition. > There are customized versions of various Draw commands to minimize > copying of parameters. > There are also specialized commands to bind[Graphics|Compute]Pipeline > that have the pipeline type built in to the command. > More custom commands and command data size optimizations will be made > in follow-on commits. > > Bug: angleproject:3136 > Change-Id: I35453cc2656bc8c51f0d84d1adef106900aca9a5 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,syoussefi@chromium.org,jmadill@chromium.org Change-Id: I1c0bfe864ff343eb8ea6c88556523f8715c981d5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3136 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535998 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 2219b18c 2019-03-05T07:06:32 Vulkan:Optimize SecondaryCommandBuffers Optimize performance of SecondaryCommandBuffers and enable them as the default build option. To disable this set angle_enable_custom_vulkan_cmd_buffers=false in your build args. This CL enhances the PoolAllocator to have a "fast" mode that can be enabled at class creation. This mode uses an alignment of 1 byte and enables a fastAllocation() call that avoids some bookkeeping overhead. The SecondaryCommandBuffer uses this fastAllocation() function. Furthermore the fast path of fast allocate, using the current page, is inlined for maximum speed. Jamie Madill also updated the SecondaryCommandBuffers to pre-allocate blocks so that the commands occur linearly in memory. This speeds up processing with improved cache coherency and minimizes overhead when recording commands. Also the core Draw functions and their state updates are all inlined as well as the common functions to initialize commands and to copy command pointer data. This change also includes some new, custom commands. One is imageBarrier that is a specialized version of pipelineBarrier that only performs a single image layout transition. There are customized versions of various Draw commands to minimize copying of parameters. There are also specialized commands to bind[Graphics|Compute]Pipeline that have the pipeline type built in to the command. More custom commands and command data size optimizations will be made in follow-on commits. Bug: angleproject:3136 Change-Id: I35453cc2656bc8c51f0d84d1adef106900aca9a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1497418 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 134425c7 2019-03-15T17:02:17 Vulkan:Integrate SecondaryCommandBuffers Integrate the custom SecondaryCommandBuffer type into the CommandGraph nodes by adding new ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS define that can be set in the BUILD gn args with angle_enable_custom_vulkan_cmd_buffers set to "true." Initially the custom cmd buffers are disabled by default. This adds some support functions to SecondaryCommandBuffer to make the integration easier by matching the wrapped cmd buffer interface: initialize(), end(), valid(). Bug: angleproject:3136 Change-Id: Ib910554583192550757bb8ce89914e3ea8737988 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1526556 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis e3981cf7 2019-02-27T11:05:15 Vulkan:Add SecondaryCommandBuffer class SecondaryCommandBuffer is a CPU-side command buffer construct intended to delay allocation/construction of GPU-side command buffers until absolutely necessary. Initially ANGLE was batching commands into Vulkan secondary command buffers and then submitting those command buffers when rendering was required. On at least some devices we saw two areas of overhead that SecondaryCommandBuffers are intended to reduce: 1. Commands in secondary cmd buffers taking longer than equivalent commands in a single primary cmd buffer. 2. Allocation/free/reset overhead of the secondary command buffers was a hotspot for some workloads. Bug: angleproject:3136 Change-Id: Ife8ffe2968eee423d89ff433d62596c432156661 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1492016 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@google.com>