src/libANGLE/renderer/vulkan/vk_cache_utils.cpp


Log

Author Commit Date CI Message
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>
Antonio Maiorano bd2f2575 2019-12-06T09:44:13 Update comment to reflect changes in ea0dcd4bda188 Bug: angleproject:4087 Change-Id: I3c26fae4fde24308fa877256c190a5bb47fe1a82 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954568 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi b36e46ab 2020-01-08T15:49:18 Vulkan: Line raster emulation through specialization constant In preparation for compiling shaders early at link time, this change reworks line raster emulation such that it uses specialization constants instead of a preprocessor condition. This means drawing both triangles and lines with this program will still result in a one-time shader compilation. The compilation is still done at draw time in this change. Bug: angleproject:3394 Change-Id: I0bf91398868d7f7147456533b728906b505192b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1992365 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Ian Elliott c8d7f047 2020-01-07T10:06:07 Vulkan: Update number of samples when changing draw framebuffer This fixes a crash (preceeded by Vulkan validation errors) when running the following test: --gtest_filter=dEQP.KHR_GLES31/core_texture_storage_multisample_FunctionalTests_blitting_multisampled_depth_attachment* --use-angle=vulkan The problem is that GraphicsPipelineDesc::updateRasterizationSamples() is rarely called (e.g. glBindFramebuffer). The above dEQP test changes between draw attachments that do and don't have multisampling enabled. The number of samples is set (the first time) to have multisampling enabled, and never changed, even though other attachments don't have multisampling. FramebufferVk::syncState() now calls updateRasterizationSamples(). That fix uncovered a latent problem: when an application destroys all framebuffers (including the draw framebuffer), the ContextVk still points at the old draw framebuffer's FramebufferVk (now freed). This is fixed with new plubming to clean-up ContextVk::mDrawFramebuffer. Bug: angleproject:4240 Change-Id: I151ec40ab821efc07c26323c34275c9165ad2ed5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1983393 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@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>
Antonio Maiorano ea0dcd4b 2019-11-29T15:51:14 Use Vulkan rectangle lines to emulate OpenGL multisampled lines SwiftShader recently added support for multisampled Bresenham lines to be spec compliant with Vulkan, so now Angle must explicitly request non-Bresenham lines when multisampling is enabled. Bug: angleproject:4087 Change-Id: Ie854746144894e3e0a68622e985cbd4ba7781ac3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1944529 Commit-Queue: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Alexis Hetu 5e6be1d6 2019-10-11T11:29:22 Provoking vertex feature support enabled Added support in ANGLE for the provoking vertex feature, which allows to choose the provoking vertex convention (first or last) for flat shading. Just copying the vk_ext_provoking_vertex.h file into ANGLE src tree for now. When the extension lands in the vulkan header we'll migrate to that and remove this file from ANGLE. With this, all these tests pass with SwANGLE: dEQP-GLES3.functional.fragment_out.* (fixes 526 failures) dEQP-GLES3.functional.rasterization.flatshading.* (fixes 6 failures) dEQP-GLES3.functional.shaders.linkage.varying.* (already passing before, still passing) Bug: angleproject:3430 Bug: angleproject:3677 Bug: angleproject:4063 Change-Id: Icc361f567072c12472398e37a94a61d7f95007ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1855681 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Alexis Hétu <sugoi@chromium.org>
Jamie Madill a6206854 2019-10-24T12:55:09 Enable "-Wmissing-field-initializers". This is another warning required by Skia. This one didn't find anything that surprising. Enabling the warning does help enforce code consistency and avoids a bit of possible undefined behaviour. Bug: angleproject:4046 Change-Id: Ifec7f4afad49cd820bf3c0a79df3f46559473ee2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1877477 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis be1fa7d8 2019-10-16T16:34:57 Vulkan: Enable VK_EXT_line_rasterization Plumbing to make ANGLE use VK_EXT_line_rasterization extension when available. Bug: angleproject:3981 Change-Id: I12913c20bff69ab0b7c16462c10b8b5fd8e1c2a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1865027 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Alexis Hétu <sugoi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill beacd8c8 2019-10-17T14:34:02 Vulkan: Rename format fields. Renames 'angleFormat' to 'intendedFormat'. Also renames 'bufferFormat' and 'imageFormat' to 'actualImageFormat' and 'actualBufferFormat'. This renaming should make it clearer to the reader what the meaning of the different format fields are. Intended format is the front-end format and the actual formats are the formats we pass to Vulkan. Also updates the documentation. Bug: angleproject:4009 Change-Id: If61bf7250e88f7ed3d452718574c963d718e27b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866077 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 71c1138d 2019-08-16T12:23:04 Vulkan: Emulate instanced attrib divisor This sets instancedArrays[ANGLE|EXT] extenstions as always supported regardless of underlying Vulkan HW's max vertex attrib divisor. Then detect instances where app sets a divisor that isn't supported by hardware and emulate those cases. Emulations is accomplished by copying the instanced attribs to a new buffer where each attrib is present once per instance, using the attrib divisor value as a factor to replicate the attribs, and then setting the actual divisor value for the draw to "1". Also, we only store 8 bits for the divisor used in the PSO, so this code also handles emulation of the case where divisor is > 255. This is passing all of the drawInstanced/Elements dEQP tests where divisor has to be emulated. Also enabled end2end InstancingTestES3 for Vulkan backend. Bug: angleproject:2672 Change-Id: I9932f9eab49b16a19e8bbd35dacaf3b5a27a213f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1758689 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jaedon Lee a0159c03 2019-09-02T14:49:07 Vulkan: Implement basic geometry shader feature Enable the default behavior of the geometry shader Bug: angleproject:3571 Test: dEQP-GLES31.functional.geometry_shading.input.basic_primitive.points dEQP-GLES31.functional.geometry_shading.input.basic_primitive.lines dEQP-GLES31.functional.geometry_shading.input.basic_primitive.line_loop dEQP-GLES31.functional.geometry_shading.input.basic_primitive.line_strip dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangles dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangle_strip dEQP-GLES31.functional.geometry_shading.input.basic_primitive.triangle_fan Change-Id: I65708d19bbfe6a0ad8ca392a1d6b3609b1410ef4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1793753 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b540da89 2019-09-19T14:19:12 Vulkan: Use ResourceUse to track object lifetime. With the new resource tracking scheme the CommandGraph, tracking a "Context serial" aka "current" serial is no longer necessary for CommandGraphResources. Serial tracking has been moved to the shared ResourceUse struct that gets updated on a command submission. Thus we don't need to store the serial as a current separate piece of info in BufferHelper/ImageHelper. Will lead to further redesign for the multi-threading support for Vulkan. Bug: angleproject:2464 Change-Id: I1ae4bcc27fcfb93422b4ab4c9682a458e482f295 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785990 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tobin Ehlis 197005d8 2019-09-18T12:58:31 Vulkan: Pass ContextVk to various helpers This is groundwork for some upcoming changes where data from ContextVk is needed in GraphicsPipelineDesc::initializePipeline(). Passing ContextVk ptr all the way down instead of the reduced vk::Context ptr. Bug: angleproject:2672 Change-Id: I29f580c3503777085355f1b79f4ae4552a394557 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1811433 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 1d83e1e8 2019-08-21T09:00:33 Vulkan: Handle new validation errors With updated validation layers Vulkan backend is hitting two new errors. This CL fixes one and works around (WA) another. Fixes issue where a Buffer used in vkCmdDispatchIndirect() did not have VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT set so now setting that usage bit for all buffers. WA issue where invalid topologies enabled primitiveRestart so ignoring that VUID initially until complete fix is implemented. Bug: angleproject:3832 Change-Id: Ie3f681eaf9e2051c27bdf00a35dc50d8ad4a2528 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1763196 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Fei Yang 4346c8b1 2019-04-09T14:50:23 Vulkan: pipeline cache not populated as blob cache is not set 1. Use vkMergePipelineCaches to recreate pipeline cache after blob cache callbacks are set after eglInititalize. 2. Use a more proper way to save the cache data to disk. Bug: angleproject:3318 Change-Id: Ied1fb572813198b51e02ed9629cbf34e2d9159b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1683807 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Darpinian 7e48c9eb 2019-08-06T17:17:19 Add explicit integer casts WebKit uses the -Wshorten-64-to-32 flag which warns on these cases. Bug: 3439 Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tobin Ehlis 4c833efb 2019-07-11T11:29:35 Vulkan: Enable sampler objects This is the initial implementation to get GLES3.0 Sampler Objects working on the Vulkan backend. When samplers are dirty, a corresponding Vulkan sampler object will be created with associated state and textures are flagged as dirty anytime sampler bindings change. Then when handling textures dirty, any bound sampler objects are pulled from active texture units. When sampler objects are bound, their state is used instead of the built-in texture's sampler state. This change also adds a test that uses the same texture object with different sampler objects to test a corner case that dEQP misses. Bug: angleproject:3208 Change-Id: I643d9c9d5cb92fecc02dad815a07bcf349534c70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706897 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jiacheng Lu 758b12fa 2019-07-17T14:55:38 Filter out redundant depth&stencil state updates 1. Compare updating values with active ones at frontend when depth&stencil related gl call happens and do not set any unnecessary dirty bits. 2. Remove d3d and gl backends' checking of depth&stencil states when detect any dirty bits, as it is now being done at frontend. 3. Modification to graphics pipeline description update, make sure it syncs with gl::State initial value. 4. Change gl_vk::CullMode return type to VkCullModeFlagBits, as it only represents single value. Bug: angleproject:3700 Change-Id: Id3aa5186455ee3a10a9c147edad13944e3e41098 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1706903 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jiacheng Lu 7a5f35c4 2019-07-15T09:21:11 Filter out redundant glDepthRange calls 1. Compare depth range with active config in frontend when glDepthRange is called. It avoids triggering unnecessary backend update. Also remove depth range checking in D3D and GL backends as they are now done in frontend. 2. Change the clamp on far and near plane to ASSERT statement in vulkan backend, as clamp already been applied in frontend. Bug: angleproject:3696 Change-Id: I52ad420dc446d685b98d53690637a19553372873 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1702284 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
James Dong a9ec8749 2019-07-11T11:31:47 Vulkan: override format for mismatched attribs Prevents Vulkan validation error by replacing the input format for any mismatched vertex attributes with a format compatible to what the shader expects. Bug: angleproject:3436 Change-Id: Ia52f29c084d82bbc4e9149102cd4b5fc25ccb9b3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1698567 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
James Dong 9917988a 2019-07-10T13:47:32 Vulkan: change packed attrib to ANGLE format ID This prevents later issues with some VkFormat values being over 256, as well as providing more information to pipeline creation. A preliminary step towards handling mismatched vertex attributes. Bug: angleproject:3634 Change-Id: Idb15a14088a2d73b43b4b92d3cfdb12587c5f711 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1696212 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 29fba5e0 2019-07-04T17:08:41 Vulkan: Prepare for variable-stage pipelines Compute (single-stage pipeline) is upcoming, but this change prepares GlslangWrapper to handle any number of stages (mostly). Additionally, this change binds each resource to each stage based on whether it's active, so that we don't hit the per-stage limit of resources by binding every resource to every stage. Bug: angleproject:3633 Bug: angleproject:3562 Change-Id: Ifebf691482846e0371c6e314f514226a4cfee258 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1689330 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop 7d6923de 2019-07-01T03:22:42 Revert "Vulkan: pipeline cache not populated as blob cache is not set" This reverts commit 134d6eed2a7d1f148a42c78c8e5da3cfc2df288e. Reason for revert: glmark2 is unable to start on Android-Q when using ANGLE as the driver. Original change's description: > Vulkan: pipeline cache not populated as blob cache is not set > > 1. Use vkMergePipelineCaches in eglSetBlobCacheFuncsANDROID as > blob cache callbacks are set after eglInititalize. > 2. Use a more proper way to save the cache data to disk. > > Bug: angleproject:3318 > Change-Id: Ieb5d10ab93e7afb2aab4446b387d7f36c878a686 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1559671 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=syoussefi@chromium.org,jmadill@chromium.org,fei.yang@arm.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:3318 Change-Id: I51e49bf103142e80b2c9028b3af6d3bb58cf6348 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1683820 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Fei Yang 134d6eed 2019-04-09T14:50:23 Vulkan: pipeline cache not populated as blob cache is not set 1. Use vkMergePipelineCaches in eglSetBlobCacheFuncsANDROID as blob cache callbacks are set after eglInititalize. 2. Use a more proper way to save the cache data to disk. Bug: angleproject:3318 Change-Id: Ieb5d10ab93e7afb2aab4446b387d7f36c878a686 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1559671 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 371d95b8 2019-06-18T15:39:20 Vulkan: Handle 0-sized viewports Issue exposed by a transform feedback test. Since we already create a scissor to match the viewport (be it 0-sized or not), we can create the Vulkan viewport with a small width/height if they are 0, as that's not allowed by Vulkan. Bug: angleproject:3205 Change-Id: Ib23d8b9f5e84447be2c4b7e8aff805e7d9e57323 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1665352 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
James Dong 2806a898 2019-06-07T12:10:46 Vulkan: implement primitive restart Implements ES 3.0 feature GL_PRIMITIVE_RESTART_FIXED_INDEX, which allows the application to use a fixed "restart" index to restart the primitive during a single draw call. This change does't handle GL_LINE_LOOP primitives, which requires a bit of special handling. Bug: angleproject:3215 Change-Id: I2388852683fd17328a6a76c48d70a24d67ce8b67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1650301 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 88596bea 2019-06-13T14:17:48 Vulkan: Implement a texture descriptor cache. We noticed a significant hotspot in vkAllocateDesctiptorSets. The app was repeatedly cycling through a few combinations of active textures. For each state change in ANGLE we were allocating a new desctiptor set. This in turn would trigger internal driver memory allocation and cause jank. Using a cache avoids allocations entirely since the application is rotating through a stable set of textures. The descriptor cache is stored in each program. It is indexed by a set of 32-bit serials. Each texture generates a unique serial for every combination of VkImage and VkSampler that the texture owns. The texture descriptor is refreshed every time a texture changes or is rebound. The descriptor cache is accessed via an unoredered map with the texture serial sets as the hash key. We also store the maximum active texture index in the cache key so we don't need to hash and memcmp on all 64 active textures. This will currently fail if more than MAX_UINT serials are generated. But that number is high enough that it shouldn't be possible to hit in practice in a practical amount of time. Requires shifting the texture sync to ContextVk so we can get the new serial after the textures are updated. And to make sure to update the image layouts even if the descriptors are not dirty. Improves performance of the T-Rex demo. Also improves the score of the texture state change microbenchmark by about 40%. Bug: angleproject:3117 Change-Id: Ieb9bec1e8c1a7619814afab767a1980b959a8241 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1642226 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 70642e42 2019-06-05T14:55:49 Vulkan: Implement ES 3.0 rasterizer discard Rasterizer discard is a feature that allows the graphics pipeline to skip the fragment shader stage. Implementing rasterizer discard in Vulkan is as easy as not binding a fragment shader binary. Tests for rasterizer discard live in dEQP-GLES3.functional.rasterizer_discard.*. Bug: angleproject:3214 Test: dEQP-GLES3.functional.rasterizer_discard.* Change-Id: I0815df3b70f6f9cdc6c8c87ec4813bb629d8bd5f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1646692 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi ed65dc43 2019-06-03T11:21:00 Vulkan: implement glSampleCoverage Emulated by applying a mask on top of the mask from glSampleMask. Bug: angleproject:3204 Change-Id: I4c80ab0a3261cbf1b8a43c270fe13c2a247ea663 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1639749 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f2a1c384 2019-05-21T16:32:49 Vulkan: Implement multisampled framebuffers Simultaneously implements ANGLE_framebuffer_multisample and ES3 multisampled framebuffers. Additionally, implements ES3 framebuffer blitting where multisampled framebuffers are involved. Bug: angleproject:3203 Bug: angleproject:3204 Bug: angleproject:3200 Change-Id: I5694a30f71168e807688a9568e3742b81d907918 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1622667 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang ee244c77 2019-05-06T10:30:18 Vulkan: Move command graph and garbage to ContextVk. To support multithreading, contexts should manage their own command graphs and garbage. This allows safe access to vulkan resources such as command pools without thread synchronization. BUG=angleproject:2464 Change-Id: I930149bc9f0793028761ee05ab50b8c0a4dec98a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516515 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Minkyu Jeong 431ef2fd 2019-05-21T17:13:08 Add support for EXT_blend_minmax This is to add additional modes (MIN, MAX) to "BlendEquation". - add cases for "GL_MIN" and "GL_MAX" into "PackGLBlendOp()" in vk_cache_utils.cpp - add enabling "blendMinMax" codes into vk_caps_utils.cpp And, AUTHORS and CONTRIBUTORS are updated. BUG=angleproject:2897 Tests: dEQP-GLES3.functional.fragment_ops.blend.*min* dEQP-GLES3.functional.fragment_ops.blend.*max* Change-Id: I13a1d6d28a104b18e21697f9f23d77e4eda2d1a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1621582 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi fb8e1b25 2019-05-17T13:18:40 Vulkan: Fix multisampled clear UtilsVk::clearFramebuffer was not setting the sample count. Bug: angleproject:3204 Change-Id: Iab7d385ec58b12f21d888c5dfc9e94b7846ac40c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1616858 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
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 6a4cad87 2019-05-01T13:04:00 Vulkan: Tighten descriptor stage usage hints Per-stage uniform buffers are marked with the specific stage. Program uniform buffers and images are specified to be used in all graphics stages. Descriptors used in internal shaders are marked for use in either compute or fragment stages. Bug: angleproject:3220 Change-Id: Ifcac36a1224f0392ba5fba50660514e498256401 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595439 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi 9fa248e1 2019-05-06T14:55:18 Vulkan: Implement EXT_draw_buffers In GLES, color attachments are referenced by their indices. These indices match between the API and GLSL. For example, if a shader has: layout(location=0) out color; layout(location=3) out roughness; Then GLES would bind and enable GL_COLOR_ATTACHMENT0 and GL_COLOR_ATTACHMENT3. In Vulkan, the framebuffer object and the corresponding renderpass define the color attachments, and they don't allow gaps in color attachments as GLES does. A render subpass creates the mapping between the color attachments as defined in the framebuffer and the attachments used by the shader (with possible gaps). This change packs the enabled GL color attachments for the sake of the framebuffer, and sets the subpass up in such a way that the shaders continue to use the same color output indices as GLES. In the example above, we have the attachment indices as follows: Status | GLES | GLSL | RenderPass | Subpass enabled 0 0 0 0 disabled 1 - VK_ATTACHMENT_UNUSED disabled 2 - VK_ATTACHMENT_UNUSED enabled 3 3 1 1 That is, the array of color attachments in the Vulkan framebuffer/renderpass is: [0] = GL color attachment 0 [1] = GL color attachment 3 And the array of color attachment references in the Vulkan render subpass is: [0] = 0 (index 0 of the renderpass attachment array) [1] = VK_ATTACHMENT_UNUSED [2] = VK_ATTACHMENT_UNUSED [3] = 1 (index 1 of the renderpass attachment array) Bug: angleproject:2394 Change-Id: Ib6cd2b60882643ea152986eee453270d09cd4aed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595442 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 216f73d0 2019-04-12T13:32:30 Vulkan: add uniform buffer object support Support for layout qualifiers in interface blocks are added. All interface blocks are adjusted to either be in std140 or std430. In the Vulkan backend, a new descriptor set is added for UBOs. A dirty bit is added for UBO updating and pipeline layouts and descriptor bindings are updated. Bug: angleproject:3199, angleproject:3220 Change-Id: I271fc34ac2e1e8b76dee75e54a7cff0fe15fe4ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565061 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0631e19b 2019-04-18T16:09:12 Vulkan: Rename Vulkan "Texture" format to "Image" Also adds some comments to vk_format_utils.h. Bug: angleproject:3372 Change-Id: I529b9b189e4cdfd400c3c981a47139727d9954ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 f6c937f8 2019-04-02T17:04:08 Vulkan: fix masked stencil clear Previously, masked stencil clear was done by clearing every stencil bit to the ClearValue & Mask. The correct behavior as implemented in this change is to clear only the bits that are set in Mask. This can only be done through a draw call, with ClearValue as the stencil reference, and Mask as the stencil write mask. Note: this change relies on the depthClamp Vulkan feature which is not available on ARM. Bug: angleproject:3241 Change-Id: I0a181c32f881ee813f144e7bdd6f42c8ea6f1966 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1548442 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi 43997017 2019-03-30T23:24:01 Vulkan: fix non-float clear with draw Instead of using one draw call that clears all attachments, multiple draw calls are issued that clear a single attachment each. This allows us to have a manageable number of variations for the ImageClear.frag shader, now that non-float format support is introduced. Bug: angleproject:3187 Change-Id: Ic0c1067a396250bd80f31d00cad5a272acff8be8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1545523 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f9f18ef0 2019-04-03T10:07:18 Vulkan: Allow vertex-only pipelines This allows issuing draw calls which only manipulate depth/stencil. Bug: angleproject:3241 Change-Id: I62ab18a185ea5b234d3559f30c5b2b8ecb317bbb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1550900 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi db4ed317 2019-03-29T00:32:45 Vulkan: glClearBuffer* implementation Refactors FramebufferVk::clear such that specific render targets could be cleared, with clear values not necessarily set through glClearColor etc. FramebufferVk::clearWithRenderPassOp is modified so that loadOp and clear values are set after the render pass has been registered in the graph. This allows multiple glClearBuffer calls to coalesce into the same render pass. glClearBuffer calls are then implemented simply as calls to the refactored clear function with the appropriate parameters. Bug: angleproject:3187 Change-Id: I2fdfcbea5bf244f63ec981b91caca47f5ee3cd3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1545204 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 0c128e15 2019-03-25T23:50:14 Vulkan: Use render pass ops to clear images when possible On tiling GPUs, render pass loadOp and stencilLoadOp can be used to very cheaply clear an image as it is being render to. This change uses this feature to clear render targets when possible. Bug: angleproject:2361 Change-Id: Ic4bdc908873f4802760d549f4893f84a47beac0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1500576 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 0516e8a5 2019-03-27T12:21:29 Vulkan: Fix subpass declaration for depth/stencil-only FBOs If an FBO only has a depth/stencil attachment, the attachment index will be 0, but that value was incorrectly being used as a flag for no depth/stencil attachment. Bug: angleproject:2361 Change-Id: I4ee803a392a29f7b261bc0cfabf9f2507dc7b178 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1541670 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi d838178d 2019-03-04T11:07:47 Vulkan: Rename vk::Shared* to vk::RefCounted* To be specific regarding what being "shared" entails. Also, avoids confusion w.r.t to an upcoming vk::Shared class. Bug: angleproject:2464 Change-Id: Ib9c112bbb822ae30dab39c75a8cde25dd79b2258 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1499693 Reviewed-by: Jamie Madill <jmadill@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Frank Henigman 52047de4 2018-11-13T17:22:36 Vulkan: support instanced draws. (reland) Enable instanced draws with the Vulkan backend. So far it only works when Vulkan has VK_EXT_vertex_attribute_divisor. BUG=angleproject:2672 Change-Id: Ib6655625776344305911a1a742c85f17638cee8f Reviewed-on: https://chromium-review.googlesource.com/c/1469263 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Shahbaz Youssefi 341304d8 2019-02-12T20:58:54 Revert "Vulkan: support instanced draws." This reverts commit 199a9f385f5489b957fe1e42bf08f3f40edd38ca. Reason for revert: Causes a validation error when the extension is not present. See failures here: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win-angle-rel/693 Original change's description: > Vulkan: support instanced draws. > > Enable instanced draws with the Vulkan backend. > So far it only works when Vulkan has VK_EXT_vertex_attribute_divisor. > > BUG=angleproject:2672 > > Change-Id: I9445ba64282fa00a6eaee207b15efa2c7a9abbd3 > Reviewed-on: https://chromium-review.googlesource.com/c/1334973 > Commit-Queue: Frank Henigman <fjhenigman@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=fjhenigman@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: Iffccc2cca259bcd19c068a87a415d4e196901f45 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2672 Reviewed-on: https://chromium-review.googlesource.com/c/1468201 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Frank Henigman 199a9f38 2018-11-13T17:22:36 Vulkan: support instanced draws. Enable instanced draws with the Vulkan backend. So far it only works when Vulkan has VK_EXT_vertex_attribute_divisor. BUG=angleproject:2672 Change-Id: I9445ba64282fa00a6eaee207b15efa2c7a9abbd3 Reviewed-on: https://chromium-review.googlesource.com/c/1334973 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c09ae15c 2019-02-01T14:16:32 Enable -Wextra-semi and -Wextra-semi-stmt. This will prevent users from accidentally making semicolon errors in the future. Bug: chromium:926235 Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9 Reviewed-on: https://chromium-review.googlesource.com/c/1446493 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 7403dd2c 2019-01-16T13:27:17 Vulkan: Inline transition query. Slight speed improvement in the Vulkan vertex array state change test. Bug: angleproject:3014 Change-Id: I4a5cd26849cd247b7e67cd6bda083aabeb4e34c0 Reviewed-on: https://chromium-review.googlesource.com/c/1406890 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ab2bfa81 2019-01-15T19:06:47 Enable Chromium clang style plugin for libANGLE. This fixes a few style warnings: * auto should not deduce to raw pointer type * inlined virtual methods are not allowed * non-trivial constructors and destructors should be explicit * inlined non-trivial constructors should not be in-class * missing override keywords Bug: angleproject:3069 Change-Id: I3b3e55683691da3ebf6da06a5d3c729c71b6ee53 Reviewed-on: https://chromium-review.googlesource.com/c/1407640 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 633d5e69 2018-12-23T19:58:01 Vulkan: Put viewport and scissor back in pipeline desc. Turns out this is much faster than using dynamic state. When we support multiple viewports it might be easier to use dynamic state since we won't need to make an overly large pipeline description. We could support both methods using a flag to indicate the viewport and/or scissor regions are invalid. Until then we can remove the pipeline and scissor dirty bits. Improves perf by about 15% in the Vulkan VBO state change test. Bug: angleproject:3013 Change-Id: I4572250626a9a0f0ca3451b17e8f0de186416cae Reviewed-on: https://chromium-review.googlesource.com/c/1390359 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2450d8dd 2019-01-11T14:41:04 Vulkan: Squash Vertex Pipeline info. Instead of using 8 bytes per vertex we can reduce the space used for the divisor to 8 bytes. For larger values than 255 we can emulate the divisor by unrolling the draw call. We will likely need to do this in any case for instanced draws when the instancing extension isn't available. The tighter packing will allow for us to move the viewport and scissor back into the pipeline description. It seems this is much faster than using dynamic state. Every state change that would pull in a new Pipeline would need the viewport and scissor re-applied. It seems these driver calls are costly. Does not improve perf significantly but enables future improvements. Bug: angleproject:3013 Change-Id: I1a41c3acadc6fbd47c7a7b961c706e82f78de936 Reviewed-on: https://chromium-review.googlesource.com/c/1390358 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 3f0c4a56 2019-01-10T10:20:35 Vulkan: Faster state transitions. Implements a transition table from Pipeline Cache entry to state change neighbouring Pipeline Cache entries. We use a 64-bit mask to do a quick scan over the pipeline desc. This ends up being a lot faster than doing a full hash and memcmp over the pipeline description. Note that there could be future optimizations to this design. We might keep a hash map of the pipeline transitions instead of a list. Or use a sorted list. This could speed up the search when there are many transitions for cache entries. Also we could skip the transition table and opt to do a full hash when there are more than a configurable number of dirty states. This might be a bit faster in some cases. Likely this will be something we can add performance tests for in the future. Documentation is also added in a README file for the Vulkan back end. This will be extended over time. Improves performance about 30-35% on the VBO state change test. Bug: angleproject:3013 Change-Id: I793f9e3efd8887acf00ad60e4ac2502a54c95dee Reviewed-on: https://chromium-review.googlesource.com/c/1369287 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 80766cfa 2019-01-10T10:20:34 Vulkan: Update individual VAO attribs when dirty. This simplifies the dirty state updates in VertexArrayVk. It also lets us use a smaller dirty bit mask when a single attribute is marked dirty in a vertex array. Improves performance by about 1-2% in the VBO state change test. Will allow for better performance using a pipeline transition table. Bug: angleproject:3013 Change-Id: I25c5172b3f41b7abac6b8273c8f9cd42eb46cc9f Reviewed-on: https://chromium-review.googlesource.com/c/1403958 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dbc605ce 2019-01-04T16:39:14 Vulkan: Optimize VBO state changes. Also has some minor optimizations for the front-end. 12% improvement on the Vulkan VBO change test. Bug: angleproject:3014 Change-Id: I38e1a8194edfc14bfe57424be348cb9688e928f4 Reviewed-on: https://chromium-review.googlesource.com/c/1369286 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi b51eb09f 2018-11-29T10:48:36 Vulkan: Allow bindings to compute stage Includes both binding of resources and updating push constants on the compute shader stage. Bug: angleproject:2958 Change-Id: I5686cbac81e0dd83d0e938cb40f9f9ac7d2ef48a Reviewed-on: https://chromium-review.googlesource.com/c/1355500 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 823d8973 2018-11-13T10:52:40 Vulkan: Internal Compute support While this is not exposed to the front end yet, this commit adds support for creating Compute pipelines for internal usage. Bug: angleproject:2959 Change-Id: I976eae1ce0f736c257b7b4ae0d1c3b2d9f4da5bb Reviewed-on: https://chromium-review.googlesource.com/c/1333972 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill dc65c5bd 2018-11-21T11:07:26 Vulkan: Cache pipelines with Shader Programs. This allows for a few nice things. First and foremost it reduces the size of the PipelineDesc, which is now 232 bytes. It also allows us to completely forego pipeline caches for compute shaders. We also allow sharing vertex and fragment shaders among multiple programs for internal shaders. This is good for memory savings. To allow this we keep the shaders as ref counted objects. Bug: angleproject:2522 Change-Id: I2322be5061979d9669a0b25c152359561eeb80ee Reviewed-on: https://chromium-review.googlesource.com/c/1344449 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi c30f45d3 2018-11-12T16:37:59 Vulkan: Rename PipelineDesc/Cache to Graphics& PipelineDesc describes a Vertex-Fragment pipeline and PipelineCache (not to be confused with vk::PipelineCache) implements a cache of such pipeline objects. In preparation for Compute support, these data structures are prefixed with Graphics. Bug: angleproject:2959 Change-Id: I9181586fb946b787216ca0b2ad6340f90c3ab55f Reviewed-on: https://chromium-review.googlesource.com/c/1333971 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuly Novikov 27780295 2018-11-09T11:19:49 Vulkan: refactor WrappedObject descendants Methods receive VkDevice instead of Context and return VkResult instead of angle::Result now. Bug: angleproject:2657 Change-Id: I3eca8692ad0b3b6e96e31fd433ed14e04384990e Reviewed-on: https://chromium-review.googlesource.com/c/1330105 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill bc5834cd 2018-11-06T11:13:50 Vulkan: Use dynamic state for Viewport and Scissor. This reduces the size of the pipeline cache descriptor under 256 bytes. Further improves the speed of cache query. Has the minor cost of needing more state application during a new command buffer or render pass. Bug: angleproject:2522 Change-Id: I3d71e457a36084ac4748d04fe3c9bab4caad503c Reviewed-on: https://chromium-review.googlesource.com/c/1316888 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 77b2436e 2018-11-05T22:39:29 Vulkan: Reduce PipelineDesc size. This packs the desc into 288 bytes. Down from over 400. The hashing and memcmp functions are sped up considerably. Improves performance in the VulkanPipelineCachePerf test by 50% and also improves performance in the state changing draw call test by 20%. Bug: angleproject:2522 Change-Id: I72ed191a93721b875684f647f806c09be4e66821 Reviewed-on: https://chromium-review.googlesource.com/c/1308460 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 502d2e21 2018-11-01T11:06:23 Vulkan: Crunch RenderPassDesc. This reduces the size of the RenderPass desc from 64 to 12 bytes. Bug: angleproject:2522 Change-Id: Iff2df87ba65be0bd976bba81c76c285cb0fa1ceb Reviewed-on: https://chromium-review.googlesource.com/c/1308459 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 06270c9e 2018-10-03T17:00:25 Vulkan: Safer struct initialization Using x = {}; before filling out each field, we can be sure any missing field is 0 initialized. This in turn helps us not have to specify certain fields that are generally unused (at the moment), such as pNext. Bug: angleproject:2860 Change-Id: Ia1fa2db3ecfb316673a02ac0c5e13e47e055a19f Reviewed-on: https://chromium-review.googlesource.com/c/1259764 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 996628a4 2018-09-24T16:39:26 Vulkan: Add support for VkPipelineCache The cache is initialized from the application's blob cache and is occasionally written back to it for disk storage. Bug: angleproject:2516 Change-Id: I4cba4b00a7b9641c2983ef07159bc62cd10a5519 Reviewed-on: https://chromium-review.googlesource.com/1241373 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 89e82979 2018-08-28T11:32:53 Vulkan: Allow gaps in vertex attributes by packing them. Work around restrictions with setting null vertex buffers on command buffers by binding ranges of non-null buffers. Enable VertexAttributeTest on ES2/Vulkan BUG=angleproject:2792 BUG=angleproject:2797 Change-Id: Ief9db1e60c8c9045a4101abe859302d529decbcb Reviewed-on: https://chromium-review.googlesource.com/1194282 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman d731ff82 2018-08-13T18:18:51 Vulkan: support depth offset. Update pipeline description with depth offset state. Enable test. BUG=angleproject:2353 Change-Id: Ib087bbff8e145b0e6e862eb6616a4943a989a7b2 Reviewed-on: https://chromium-review.googlesource.com/1173447 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang c16f518e 2018-07-18T10:40:03 Vulkan: Disable the depth/stencil states when there are no depth/stencil buffers We sometimes emulate depth-only or stencil-only buffers with depth-stencil buffers. Disable depth-stencil states that allow reading or writing to these buffers that should not exist. BUG=angleproject:2739 Change-Id: I4f54800404f340eb53f04176e208f19a83a2899c Reviewed-on: https://chromium-review.googlesource.com/1141932 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 21061026 2018-07-12T23:56:30 Vulkan: Use angle::Result error handling. Introduces a vk::Context class to contain an error handler and Renderer pointer. This abtracts the common code path for ContextVk + DisplayVk. Removes vk::Error in favor of the POD angle::Result class. There are a few remaining usages of gl::Error that will have to be cleaned up when we can change the front-end APIs. Bug: angleproject:2713 Change-Id: I5e68f223d595c6c561b59d6a85759e5738ed43c6 Reviewed-on: https://chromium-review.googlesource.com/1128924 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron b70ad524 2018-07-09T16:06:26 Vulkan: Fix all depth/stencil related failures due to Y flip - Fixes all deqp functional_fragment_ops_depth_stencil_* with Y flipping enabled. Bug: angleproject:2673 Change-Id: I94a4225dec8adf9113309e8b8b2c8aa61f6a2bb9 Reviewed-on: https://chromium-review.googlesource.com/1129857 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 1a135adc 2018-07-04T10:35:31 Vulkan: Fix how the viewport is calculated with Y flip - This fixes all ViewportTest.* and MipmapTest.* - Tests left to fix in end2end: - BlitFramebuffer* - MaxTextureSizeTest.* - PointSpritesTest.* Every other test in angle_end2end_tests are working. Bug: angleproject:2673 Change-Id: I162083bc847c15fa5490ab524ad4c22747d232ea Reviewed-on: https://chromium-review.googlesource.com/1126333 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron bf6dc379 2018-06-28T15:24:19 Vulkan: Flip viewport on y for the backbuffer only - Hide the implementation behind a feature flag, currently disabled permanently as I'm working on fixing the different failures. - SimpleOperationTest.* passing Bug: angleproject:2673 Change-Id: Ic86520c3cc478d62bebbaeaf4c6b33c439a67b0f Reviewed-on: https://chromium-review.googlesource.com/1119089 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 5fd3693e 2018-06-19T14:55:50 Vulkan: Mask the alpha channel for draw when needed When the angleFormat we have has no alpha channel, but the actual texture underneath has one, we shouldn't be drawing over the alpha channel, so we apply a mask on it when we're in this situation. Bug: angleproject:2597 Change-Id: Ia7110709e6ee32bb61988d08f5049e4e80e7e24e Reviewed-on: https://chromium-review.googlesource.com/1106759 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d668be9c 2018-06-13T16:54:06 Vulkan: Use push constants in PipelineLayoutCache. This removes the internal pipeline layout for the masked clear shaders. Instead use the PipelineLayoutCache. Bug: angleproject:2462 Change-Id: I8f8365b866098ece3e964fd12447dfdea55c20ba Reviewed-on: https://chromium-review.googlesource.com/1090758 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill c7918ceb 2018-06-13T13:25:31 Vulkan: Add PipelineLayout and DescriptorSetLayout caches. This will be necessary to support more than one PipelineLayout per instance of ANGLE. Sampler array handling requires different layouts for different sampler uses. Bug: angleproject:2462 Change-Id: I1d8b4919eed1a589002ad1898b05186f420061c7 Reviewed-on: https://chromium-review.googlesource.com/1089806 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Jamie Madill aaca96ee 2018-06-12T10:19:48 Vulkan: Minor style fixes. Makes some methods const or static. Fixes parameter names. explicit single argument constructors. Other small style fixes. Bug: angleproject:2462 Change-Id: Ie2bf96603e9eda81d6f2aa788867978de10e9992 Reviewed-on: https://chromium-review.googlesource.com/1089805 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 493f9571 2018-05-24T19:52:15 Add PrimitiveMode packed GLenum. Bug: angleproject:2574 Change-Id: I3d7bd7ca0d69a364a611dc04799ea34906fc4a6c Reviewed-on: https://chromium-review.googlesource.com/1067114 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c6dbc253 2018-04-30T19:07:56 Scope ANGLE_UNUSED_VARIABLE. Renames the macro to be more ANGLE-ey. Refactoring only. Bug: angleproject:1671 Change-Id: I8f2dd227c7e2025886ec66e85efa877ea261d0ad Reviewed-on: https://chromium-review.googlesource.com/1036209 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9aef3670 2018-04-27T11:45:06 Vulkan: Implement masked color clears. This implements masked color clear using clear shaders. The shaders themselves were introduced in a prior patch. In order to get the right setup for the draw call to trigger the shaders, we create an internal pipeline from the pipeline cache. We also use a special pipeline layout with only uniform buffers. The masked out color channels are disabled via settings on the pipeline. This fixes the dEQP masked color clear tests. It doesn't handle masked color clears combined with the depth clear bit. It's likely we don't have test coverage for this case. Bug: angleproject:2455 Change-Id: I513248cc0f7e58f490fc16ac9afb40119d730ccc Reviewed-on: https://chromium-review.googlesource.com/1031373 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 78feddc2 2018-04-27T11:45:05 Vulkan: Take serials in PipelineDesc::updateShaders. This makes the API easy to use with internal shaders and pipelines. This is useful for the implementation of masked color clear. Also renames the serials as shader serials. This is more precise than program serials. Bug: angleproject:2455 Change-Id: Ie6247d1212ed4df856b561a5e9f16c0378202588 Reviewed-on: https://chromium-review.googlesource.com/1032857 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 33318de4 2018-05-01T11:22:54 Vulkan: Use ShaderType enum. This re-uses the same machinery as the GL front-end. It saves a lot of custom casting and array sizing. Currently we only support vertex and fragment shaders in Vulkan. Because of the Pipeline cache sizing, it's easier to stick with just VS/FS and introduce the full set of shaders when we move to packing the cache better. Bug: angleproject:2522 Bug: angleproject:2455 Change-Id: I21432a335c741885af87970d8ee52b4a36338304 Reviewed-on: https://chromium-review.googlesource.com/1036927 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jiawei Shao <jiawei.shao@intel.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill bd5543c9 2018-04-24T08:42:05 Vulkan: Add GetColorComponentFlags. This small helper routine will be used when doing masked clears. Bug: angleproject:2455 Change-Id: Id309b48f2bc5958abb1276d140c9a3599fb7d2b9 Reviewed-on: https://chromium-review.googlesource.com/1024825 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 0986f1cc 2018-04-16T13:47:23 Vulkan: Implement depth_range dirty bit and enable tests - Additional fix in GlslWrapper.cpp to remove the @@ markers for unused attributes. - Enables 28 dEQP gles2 tests in functional.depth_range.* Bug: angleproject:2454 Change-Id: I1a6f72d846b476ba681140d4b242208d24e18b95 Reviewed-on: https://chromium-review.googlesource.com/1014262 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Luc Ferron 14f4817c 2018-04-11T08:43:28 Vulkan: Simplify viewport / scissor updates Stop tying the viewport and the scissor together. Instead, we simply use a very large (0->maxInt) scissor when scissor isn't enabled and we use the clipped scissor to the renderArea size when its enabled. Bug: angleproject:2443 Change-Id: If7454793a050b1833c7d3166ea6b380192085c8f Reviewed-on: https://chromium-review.googlesource.com/1006996 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron d17bdfe5 2018-04-05T13:50:10 Vulkan: 3 Final bugfixes to enable all dEQP depth_stencil tests - The scissor when clearing should not be clipped against the viewport. - The render pass was created with a render area == to the current viewport, but the viewport can be changed by the tests multiple times per render pass, so we should always keep the renderArea to the full framebuffer instead. - Enables an additional 163 dEQP tests. - We should clip the scissor to the framebuffer dimensions instead of the viewport. Its valid to do a cmdClearAttachments outside the viewport, but not outside the full framebuffer's dimension. Bug: angleproject:2443 Change-Id: I79168e9f0c782d6dec77470fef938b85ad7a8794 Reviewed-on: https://chromium-review.googlesource.com/998448 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6c7ab7fe 2018-03-31T14:19:15 Vulkan: Reorganize helper classes. This renames ResourceVk to vk::CommandGraphResource, which should help clarify its usage. This also moves LineLoopHandler, ImageHelper, and the DynamicBuffer and DynamicCommandPool classes into a new vk_helpers module. This file contains helper classes that manage other resources. Also this makes DynamicBuffer and DynamicDescriptorPool no longer inherit from CommandGraphResource. In the future, only Impl objects will be allowed to be graph resources. Bug: angleproject:2318 Change-Id: I0fa23da2ac853d90f3c822547a4a314f247cc757 Reviewed-on: https://chromium-review.googlesource.com/985200 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron dd196e0b 2018-04-04T11:41:44 Vulkan: Implement color mask and depth mask bits These two features are heavily used in the functional.depth_stencil_clear.* dEQP tests. Enable a bunch of color/depth/stencil clear tests, however there is still 2 tests in particular that are giving me trouble. I will work on them separately in a subsequent change. Bug: angleproject:2443 Bug: angleproject:2455 Change-Id: Ic93420c7b525b424e9641f78265e264ddb163ab1 Reviewed-on: https://chromium-review.googlesource.com/996035 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 364a9557 2018-03-29T09:44:51 Vulkan: Implement stencil test support All the fragment_ops.depth and the fragment_ops.depth tests in dEQP are now working, but not the fragment_ops.depth_stencil. Still debugging these separately and will come up with a fix for them in another commit. Bug: angleproject:2443 Change-Id: I84c3a22f612fb6dcf30598434f96c2100fd29f9c Reviewed-on: https://chromium-review.googlesource.com/993654 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill bc54342b 2018-03-30T10:43:19 Vulkan: Make RenderTargetVk use ImageHelper. Bug: angleproject:2318 Change-Id: I9bc4bb7f5bcd3029a31c8570809f253cf5e4b12a Reviewed-on: https://chromium-review.googlesource.com/980773 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 93edca16 2018-03-30T10:43:18 Vulkan: Add an Image helper class. This class wraps a lot of the common functionality of a vk::Image. It keeps an associated DeviceMemory and ImageView. Eventually we can probably merge this class with RenderTargetVk. We can also use it to implement the same functionality between Renderbuffer and Texture and abstract different storage types, like 2D and Cube. Bug: angleproject:2318 Change-Id: I39239f47b483cfb96290a15b06edd264f7f4bb34 Reviewed-on: https://chromium-review.googlesource.com/980772 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0cec82a5 2018-03-14T09:21:07 Vulkan: Implement basic depth/stencil buffers. This implements basic depth/stencil states and clearing. This also implements "fallback" texture formats in the texture generation. Fallback formats are those that are chosen at runtime for replacements for main formats which lack driver support. They are different from override formats, which are always used because we assume there is no driver support. The Vulkan spec only asserts that one of the two of D32 or D24 has mandatory support. In the case of AMD, D24 is not supported fully, and we need the fallback format support emulation. Bug: angleproject:2357 Change-Id: Ic86cede3c69ff9893a06b3a55c3b5d2d897fa55f Reviewed-on: https://chromium-review.googlesource.com/916701 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron 64e5ed2a 2018-03-09T16:32:32 Vulkan: Fix scissor clears + enable dEQP tests Vulkan does not support receiving out of bounds numbers for the scissor region but no validation errors are sent. This change clips the region received to fit the current viewport and it fixes many dEQP tests. Bug:angleproject:2356 Change-Id: I5dcf739366ba1f62b56593eaaccedf5f14d0c200 Reviewed-on: https://chromium-review.googlesource.com/957758 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron 1505c750 2018-03-09T11:28:23 Vulkan: Fix issue in blending factor conversions The blend factor were not converted correctly from GL enum types to their VK equivalents. I found this by running many dEQP tests related to blending. Bug:angleproject:2346 Change-Id: I3c332bb5e5c44d2bec4ff9d62e0df2421507e136 Reviewed-on: https://chromium-review.googlesource.com/956241 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 5242d5bf 2018-02-15T07:14:35 Vulkan: Implement scissored clears. Bug: angleproject:2356 Change-Id: I33888f9b4ebaf4b0b5af4ad59b12ad963325a790 Reviewed-on: https://chromium-review.googlesource.com/921882 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e4c5a23b 2018-03-02T21:00:31 Vulkan: Always use LOAD for RenderPass attachments. The RenderPass load/store ops allow us to specify how we want to use the data from the attachments. Previously we had the load op set to CLEAR always, which would prevent us from doing multiple kinds of operation. Using LOAD should conversatively work in any situation as long as we can ensure each Image is cleared before we use it. To this effect this patch also inserts a preliminary clear into each Texture or Renderbuffer Image's initialization. We already had this for Surfaces. In the future we'll improve this by inserting proper load/store ops, but this unblocks a lot more functionality in the interim. Bug: angleproject:2361 Change-Id: I7610eaa39d81b23dd74b4a24b7f28a66a6dfffc6 Reviewed-on: https://chromium-review.googlesource.com/948782 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>