src/libANGLE/renderer/vulkan/vk_utils.cpp


Log

Author Commit Date CI Message
Jamie Madill d705f18f 2020-05-11T13:53:13 Vulkan: Add immediate scissored clears. This allows us to avoid using draw commands with pipelines for scissored clears. This prevents some tests from generating large numbers of VkPipelines. Bug: angleproject:4517 Bug: angleproject:4617 Change-Id: Id4a44000078098a60aa89233cfef30b75727d108 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2194473 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill d657e1d7 2020-04-24T13:13:18 Vulkan: Defer framebuffer clears. This works by storing the deferred clears in the ImageHelper's staging buffers. We apply the deferred clears onto the RenderPass right before we begin to draw. Storing the clears in the ImageHelper solves problems where we clear GL Textures in a Framebuffer and then unbind the Textures and sample from them. Or do other commands like CopyTexImage. Note that because the staging buffer clears only handle full-image clears we need to immediately apply some scissored clears where before we would use the RP. This should be a pretty rare occurrence and it is possible to optimize that in the future. Reduces the RenderPass count in the Manhattan "frame 10" trace from max 22 to max 20. May improve perf slightly on Android or may have effects too small to measure. Should not regress performance. Bug: angleproject:4517 Change-Id: I02150d531022afb903f1058f070937ec6337bd88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2142711 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 3cb9c4be 2020-03-13T13:56:47 Statically link vulkan-loader on Mac Disable angle_shared_libvulkan on Mac since we are the only client. Re-add codepaths to support this. Bug: angleproject:4477 Change-Id: Ie128c83adaae741636541bbfd6105d160d874a8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102954 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill 35e389cc 2020-04-24T13:33:36 Vulkan: Remove unicode character from error string. Will fix presubmit checks on Windows. Bug: angleproject:4586 Change-Id: I36cec3e850c88a015f33d8a0bb7cc8f8c26402d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165628 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 492ec932 2020-04-21T13:38:41 Vulkan: Track allocated sampler counts. Helps to diagnose perf bugs where resources are over-allocated. Also can be useful to evaluate caching strategies. Bug: angleproject:4517 Change-Id: I48df5a09fbc394fa0b1712fa8cf28a179665e6e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159293 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Charlie Lao 927ea225 2020-04-21T19:42:18 Vulkan: add vulkan error code in the error message If driver returns error code that we do not know, we simply output "unknown vulkan error code". Instead we should at least include the actual errorCode here so that people can search up to see what it is. Also remove the double period at the end of string and added a few other vulkan error strings. Bug: b/154665382 Change-Id: Ic4138e90534b4e7d97520fe10ac1477d2930d9c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2160130 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya b7d6949b 2020-04-17T13:36:14 Vulkan: Enable persistently mapped buffer objects The VMA allocator has a handy feature where during memory allocation we can request persistently mapped memory. This saves IOCTL overhead for apps that update buffers frequently. Bug: angleproject:2162 Change-Id: I870d880033beec343efae6de06f1c5935de4c2c1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2155131 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
Hyunchang Kim 6e0d718a 2020-03-31T18:41:57 Vulkan: Implement device memory sub-allocation Use AMD Vulkan Memory Allocator for device memory sub-allocation. We now have a mempool from which all glBuffer memory is allocated. The CPU overhead involved in repeated IOCTL calls to the kernel is reduced significantly. Bug: angleproject:2162 Change-Id: Id7681ffe2ac3d2853141ebe34c7df7b7fdd0d55e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2124519 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Hyunchang Kim 449d9d76 2020-03-31T17:27:00 Vulkan: Refactor garbarge collection related parameter Use RendererVk instead of VkDevice as a parameter in garbage collection functions. Bug: angleproject:2162 Change-Id: Ifd53e05223d6d603402c9b7fcfa82fe1f896458c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2131882 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Hyunchang Kim 6281e30d 2020-03-31T15:41:23 Vulkan: Add flush condition for the device memory updated by CPU Memory created using HOST_COHERENT_BIT does not need to be explicitly flushed. Bug: angleproject:2162 Change-Id: Idc2001e2254de616d7e7067410d225d0b521f29f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2131881 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter 4422d298 2020-03-18T09:54:54 Vulkan: Must call vkFlush while memory is mapped Update to Vulkan validation layers pointed out that vkFlushMappedMemoryRanges needs to be called when the memory is mapped. Bug: b:151820847 Change-Id: I3860306080bca435c063046f9ae20943a8601d17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2108705 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com>
Mohan Maiya 78a85f2c 2020-03-16T10:28:59 Vulkan: Request device local memory for glBuffer with GL_STATIC* usage glBuffer objects with GL_STATIC_* usage patterns will now request the storage to be allocated in device local memory. For glBuffer objects with GL_DYNAMIC_* usage patterns we request a host cached memory. Bug: angleproject:4480 Change-Id: I7ca968f5ddfb59e4df3ecd07ae65df2bbf734190 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2102958 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill a741abb9 2020-02-21T16:37:37 Vulkan: Rename CommandGraphResource to Resource. Also renames the h and cpp files to ResourceVk (to keep distinct from other resource.h/cpp files) and renames 'onResourceAccess' to 'retain'. Cleans up a few remaining mentions of the command graph in comments. Bug: angleproject:4029 Change-Id: Ifc8e880c8cea3fc48a4aec4730191c88aa35a076 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill ce4918f1 2020-02-19T09:39:44 Vulkan: Sanitize Images & Buffers with non-zero values. Only enabled for specific tests at the moment. This CL allows our tests to sanitizes memory for the robust resource access extension. It is quite slow so should not be enabled by default. Only works for 1 level 2D color textures and buffers. Makes several flaky robust resource initialization tests consistently fail. Controlled via an angle::Feature in FeaturesVk. It works by initializing memory to an abitrary non-zero value: - if newly allocated memory is mappable, we map it in init and set it - if a buffer or texture can be a transfer destination, we use a staging resource - otherwise we don't attempt to initialize the resource. Bug: angleproject:4384 Change-Id: I9b4f347bfcddf3096f491ed0243bef86837feaa0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2043271 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 3c066404 2020-02-05T12:43:12 Vulkan: Command graph linearization (Step 4). Implements GLES 3.0 functionality for the new command recording style. Tested with angle_end2end_tests. dEQP/CTS testing will come later. Bug: angleproject:4029 Change-Id: Ibdc4f1355a7b880946699ec227fd9807f4a27af9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040197 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Courtney Goeltzenleuchter d0b4eaf6 2020-01-16T09:38:28 Vulkan: Allow user to specify preferred device On a platform with multiple graphics devices (e.g. laptop with integrated and descrete devices) it's handy to be able to specify the specific device we want ANGLE to use. Setting the environment variable ANGLE_PREFERRED_DEVICE to the device name as returned by VkPhysicalDeviceProperties.deviceName will select that device. Bug: angleproject:4305 Change-Id: Ib16895add2c36a59135942b52401ceb7b6bc0895 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2002737 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 35e6050f 2019-12-30T23:47:51 Vulkan: Correct error message for VK_ERROR_INVALID_SHADER_NV If an invalid shader is generated, generate the appropriate message instead of "Unknown error". Bug: angleproject:3394 Change-Id: I586c99e95cd72daeaf74b4d1eff352942e01d8b7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1982783 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Ian Elliott abc8f277 2019-12-19T10:47:31 Vulkan: Disallow multisampling with a sample count of 1 GLES uses a sample count of 0 to indicate non-multisampling, and a sample count of 1 or greater to indicate multisampling.  While the Vulkan specification seems to support multisampling with a sample count of 1, the following spec language effectively disallows it (even when the underlying Vulkan driver supports it): If the image was created with VkImageCreateInfo::samples equal to VK_SAMPLE_COUNT_1_BIT, the instruction must have MS = 0. The following GLES 3.1 dEQP tests use shaders that look for the sample position, with a sample count of 1: dEQP-GLES31.functional.texture.multisample.samples_1.* For Vulkan drivers that fully support multisampling with a sample count of 1, these tests pass, but get Vulkan validation errors because of the above spec language. This was discussed in the Khronos-private issue tracker (see: https://gitlab.khronos.org/vulkan/vulkan/issues/1925).  The Vulkan working group wondered if ANGLE could live with not supporting a sample count of 1 (but upgrading such requests to the next-largest supported sample count, per the GLES specification).  This change implements that approach. Bug: angleproject:4197 Bug: angleproject:4212 Change-Id: I009ba47b48efe5af464011c7c15022fc01f45e76 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1974842 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Tobin Ehlis 5fd73782 2019-08-09T11:46:46 Vulkan: Use volk to load vk* func ptrs Thanks to Jamie Madill for some fixes to get all CI test passing w/ volk. This change updates all ANGLE targets that use Vulkan to dyanmically link all of the VK entrypoints using the volk OSS library from https://github.com/zeux/volk. It's only two source files so baking them directly into ANGLE repo. Also it's used in both the tests and libANGLE trees so added to src/common/third_party/volk dir. Updated volk and the renderer to track latest instance and device that were loaded and renderer will refresh vk* function pointers if the current and previous device and/or instance don't match. This prevents errors in the test framework as we transition between backends, especially between VK HW & SwiftShader ICDs. This change rolls the Vulkan Loader forward to use the latest loader version which no longer allows static linking but requires dynamic linking. Bug: angleproject:3740 Bug: angleproject:4092 Bug: angleproject:4162 Bug: angleproject:4210 Bug: angleproject:4225 Change-Id: I8a0b7d24c9545bbfdfaa4b9357a9bfe6793e0140 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965640 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Renaud Lepage bf47a17e 2019-12-13T01:40:33 Fix GGP build Bug: angleproject:4221 Change-Id: I625b78795dbc826d176660e47af9b51d3f8d417b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1966410 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 84c074cf 2019-11-20T15:32:44 Vulkan: Simplify AppendToPNextChain use The function is turned into a template to avoid the reinterpret_cast at call sites. Additionally, uses Vulkan's own VkBaseOutStructure instead of a bespoke definition. Bug: angleproject:4027 Change-Id: Ib236d44a12c0363e7e89b9bf2ed5ab8166252730 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1924992 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill c898ec1a 2019-11-04T15:20:18 Add EGL GGP extensions. This CL adds two new extensions: * EGL_ANGLE_ggp_stream_descriptor: Introduces a new attribute to CreateWindowSurface. Allows the app to pass in a stream descriptor to VkCreateSurfaceKHR. Mirrors VK_GGP_stream_descriptor_surface. * EGL_ANGLE_swap_with_frame_token: Introduces a new function 'eglSwapBuffersWithFrameTokenANGLE'. This allows the app to pass a GGP frame token down to vkQueuePresentKHR. Mirrors VK_GGP_frame_token. Bug: angleproject:4078 Change-Id: I4313ac4c264e68999905049f661bc64b44f72fab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1897315 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
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 08af1c80 2019-10-22T08:58:52 Vulkan:Store full 64bit handle in GarbageObject On 32bit builds we were only storing 32bit handles for non- dispatchable objects. This resulted in the handles getting shrunk from 64-bits which then led to false validation errors. Fixed this by using VK_DEFINE_NON_DISPATCHABLE_HANDLE() macro in GarbageObject instead of VK_DEFINE_HANDLE(). Also MSVC on Win32 didn't like reinterpret_cast<> with the updated 64bit handles so migrated a number of GarbageHandle casts to be c-style which is contrary to style guide, but is preferable to conditional code. Bug: angleproject:3924 Bug: angleproject:3946 Change-Id: Icb4139e34989179e46ac1f0c76269ff49ab1e897 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1873244 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Le Quyen a48f95ab 2019-10-14T14:49:49 Move Vulkan GlslangWrapper code to a shared location. Metal backend will reuse Vulkan's GlslangWrapper code. The Metal backend will use this code to translate glsl to spirv then cross compile to Metal Shading Language using spirv-cross. So the source code of GlslangWrapper should be moved outside vulkan folder. Bug: angleproject:2634 Change-Id: I208062daf0d77756c9d32cfdab925b7dfdf83e05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1858042 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: 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>
Cody Northrop 6b60dfd8 2019-10-02T07:54:18 Vulkan: Remove image views forced to one mip level textureSize requires the view to reflect actual mip levels, so we can't artificially limit the view based on filtering mode. This CL removes those views. That unearthed a problem where the VK backend wasn't properly implementing non-mipmapped filter modes. There is a blurb in the Vulkan spec about this: There are no Vulkan filter modes that directly correspond to OpenGL minification filters of GL_LINEAR or GL_NEAREST, but they can be emulated using VK_SAMPLER_MIPMAP_MODE_NEAREST, minLod = 0, and maxLod = 0.25, and using minFilter = VK_FILTER_LINEAR or minFilter = VK_FILTER_NEAREST, respectively. So this CL also adds that emulation. Bug: angleproject:3948 Test: TextureSizeTextureArrayTest.BaseLevelVariesInTextureArray Test: dEQP-GLES3.functional.shaders.texture_functions.texturesize.* Change-Id: I81d5c3417e7d9abd0cdd058b935963706024a28f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1835937 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Tim Van Patten f750d86a 2019-10-01T17:52:37 Trigger a flush() when the command graph contains too many objects If an App repeatedly issues GL commands like glTextImage2D without a finish/flush/draw, it's possible for ANGLE to exhaust the available Vulkan memory allocations and exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount. When this occurs, the Vulkan validation layers will trigger an error and cause dEQP tests to fail. This change will query the backend if a flush() should be performed during each of the GL delete calls, and perform it if necessary. This will cause a queue submission and a Serial increment, allowing the allocated memory to be freed, preventing the validation errors. Bug: angleproject:3818 Test: KHR-GLES3.copy_tex_image_conversions.forbidden.renderbuffer_cubemap_* Change-Id: I26d0a47aa7bca10c25bc8141f1523afbab0b3b5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1834781 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis f22f16d3 2019-07-18T15:10:49 Reland "Vulkan: Use VK repos' internal BUILD.gn files" This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 There was a missing build dependence causing a build no-op issue which has now been fixed in the upstream Vulkan Validation Layer repo. Primary workaround that need to be re-visted and fixed are: 1. Disabled validation layers on 32-bit Windows 2. Disabled validation layers on 32-bit Android 3. Disabled DebugUtils on Android, using DebugReport instead 4. Using custom VK Loader branch to avoid WDK dependence Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Bug: angleproject:3924 > Bug: angleproject:3925 > Bug: angleproject:3946 > Bug: chromium:997009 > Bug: chromium:997016 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> Bug: angleproject:2449, angleproject:3320, angleproject:3852 Change-Id: I373ada091a1329db5e304874079428d01ba21d52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778302 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Jamie Madill 33ffed01 2019-09-26T10:19:35 Vulkan: Clean up garbage APIs. Instead of dumping resources to a context, we use the release APIs consistently. Refactoring/cleanup change only. Should have very litte impact on runtime behaviour. Bug: angleproject:2464 Change-Id: I2dc7f8316c466f7ccfad50a7b792ba0ee7bc2e49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1804883 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 29f7916f 2019-09-25T14:37:35 Vulkan: Store current Serial in RendererVk. This gives a stronger ordering on serials than if they're acquired by the ContextVk. Part of the steps of implementing multithreaded GL on Vulkan. Implements a "globalFinish" method in RendererVk that is triggered on ContextVk destruction. This helped fixed some racy object deletion situations where the ContextVk could have queued work that uses deleted objects. Flush all the Contexts before destruction to avoid these hanging deleted objects. Bug: angleproject:2464 Change-Id: I244e9bbf6cd47b272c7cbca45b0fb1eb46d626fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1791268 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d2766ce7 2019-08-30T15:26:17 Vulkan: Generalize ICD decision for loader. This will allow a more flexible introduction of other ICDs like SwiftShader. Refactoring change only. Bug: angleproject:3876 Change-Id: I6883225645e0f961f699366368bebccd9812aaec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1775463 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 2b7e2acb 2019-08-30T13:26:37 Vulkan: Move loader defines into BUILD.gn. We shouldn't need the extra loader defines config variable. The defines we need should probably be able to be located in ANGLE entirely. Bug: angleproject:3320 Bug: angleproject:3876 Change-Id: I78f449f44c1709b6d683930f9b9ea3d80016272e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1775462 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis aae21ef6 2019-08-29T21:56:06 Revert "Reland "Vulkan: Use VK repos' internal BUILD.gn files"" This reverts commit 0ad1559f3ae95efecaa209f990987d3ce4ebd150. Reason for revert: linux-rel no-op build issue showing up in Chromium integration. Tracking in chromium:997016 Original change's description: > Reland "Vulkan: Use VK repos' internal BUILD.gn files" > > This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 > > Original change's description: > > Vulkan: Use VK repos' internal BUILD.gn files > > > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > > files so switched ANGLE to use those by default. > > Also Validation Layer, Loader, and Tools repos no longer uses codegen > > so this speeds up the build overall. > > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > > to VK_LAYER_KHRONOS_validation unified layer. > > > > This changes includes a temporary workaround to the Vulkan-Loader repo > > to remove its Window's build dependence on WDK. There are plans to > > remove that depenedence in Loader master, but until then we can use > > our custom branch workaround. > > It also includes a custom branch for validation layers that includes > > some build fixes for ANGLE. > > Finally, the layers were crashing on Android when attempting to use > > DebugUtils extension so forcing DebugReport on Android for now. > > > > Bug: angleproject:2449 > > Bug: angleproject:3320 > > Bug: angleproject:3852 > > Bug: chromium:997009 > > Bug: chromium:997016 > > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Commit-Queue: Tobin Ehlis <tobine@google.com> > > Bug: angleproject:2449, angleproject:3320, angleproject:3852 > Change-Id: I9597be99000083b135e19b6ee68d4ae222158e72 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769036 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=tobine@google.com,syoussefi@chromium.org,jmadill@chromium.org Change-Id: I88afdaff07e9f414f9de02f6d3651eaba9a5045f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2449, angleproject:3320, angleproject:3852 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776920 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 0ad1559f 2019-07-18T15:10:49 Reland "Vulkan: Use VK repos' internal BUILD.gn files" This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Bug: chromium:997009 > Bug: chromium:997016 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> Bug: angleproject:2449, angleproject:3320, angleproject:3852 Change-Id: I9597be99000083b135e19b6ee68d4ae222158e72 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769036 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
James Dong 1d5aaa6c 2019-08-06T11:20:13 Vulkan: support dynamic indices in array of arrays Expands existing struct-sampler rewrite to flatten arrays of arrays. This allows us to support dynamically-uniform array indexing, which is core in ES 3.2. Samplers inside (possibly nested) structs are broken apart as before, and then if the type resulting from merging the array sizes of the field and its containing structs is an array of array, the array is flattened. Also adds an offset parameter to functions taking in arrays to account for this translation. As a result of outer array sizes leaking into function signatures, functions taking arrays of different sizes are duplicated according to how the function is invoked. Bug: angleproject:3604 Change-Id: Ic9373fd12a38f19bd811eac92e281055a63c1901 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1744177 Commit-Queue: James Dong <dongja@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 5f3c98de 2019-08-23T01:05:38 Revert "Vulkan: Use VK repos' internal BUILD.gn files" This reverts commit 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6. Reason for revert: Causing flakiness in "confirm no-op" CQ step. See issue for more details. Bug: chromium:997016 Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> TBR=ynovikov@chromium.org,tobine@google.com,syoussefi@chromium.org,jmadill@chromium.org Change-Id: Iec97ba8cb5c38fa56bfd4c0afb0f7af8d68513ff No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2449, angleproject:3320, angleproject:3852 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1767363 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 552f5fcb 2019-07-18T15:10:49 Vulkan: Use VK repos' internal BUILD.gn files This retires custom BUILD.gn files for the Vulkan Headers, Tools, Validation-Layers, and Loader repos. They now have integrated BUILD.gn files so switched ANGLE to use those by default. Also Validation Layer, Loader, and Tools repos no longer uses codegen so this speeds up the build overall. Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer to VK_LAYER_KHRONOS_validation unified layer. This changes includes a temporary workaround to the Vulkan-Loader repo to remove its Window's build dependence on WDK. There are plans to remove that depenedence in Loader master, but until then we can use our custom branch workaround. It also includes a custom branch for validation layers that includes some build fixes for ANGLE. Finally, the layers were crashing on Android when attempting to use DebugUtils extension so forcing DebugReport on Android for now. Bug: angleproject:2449 Bug: angleproject:3320 Bug: angleproject:3852 Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tobin Ehlis <tobine@google.com>
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>
Jamie Madill 22511021 2019-08-13T09:17:52 Vulkan: Remove unused GetDepthStencilAspectFlagsForCopy. Was incorrect and causing a Clang warning. Bug: chromium:992863 Change-Id: Ieff7b332ee11a6330bd5879d73b53ad374f40664 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1751622 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Cody Northrop a2129356 2019-07-23T12:54:13 Vulkan: Add support for 2D array textures Includes changes from jmadill to align with Vulkan backend design. Correctly setting layer count and depth when the texture type is 2Darray. Vulkan requires depth of 1 for 2Darray textures. Bug: angleproject:3189 Change-Id: I0d58c33fcd75b1d768ea0308ac6e54230d8cfcc5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1721169 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
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>
James Dong 13ac9422 2019-06-10T17:53:09 Vulkan: add support for shadow samplers. Adds support for ES 3.0 shadow samplers. Test: ./angle_deqp_gles3_no_gtest --deqp-egl-display-type=angle-vulkan -n 'dEQP-GLES3.functional.texture.shadow.2d.*' Bug: angleproject:3211 Change-Id: Ic82ecfe19290fb952fcb0ba423691b5bac87c4a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1652021 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Michael Spang 6bb193c8 2019-05-22T16:32:21 Vulkan: Implement glImportSemaphoreFdEXT Allow importing file descriptors into semaphores on linux. This can be used to synchronize ANGLE's GL renderer with respect to vulkan composition in chromium. Bug: angleproject:3289 Change-Id: I04ba3bbb2e343baa000ff89c21c03ca36163a713 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1623812 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Geoff Lang e755a537 2019-04-10T09:58:21 Vulkan: Add a new garbage type gated by fences. This allows Vulkan EGL objects such as EGL Syncs and EGL Images to give their garbage to the renderer before destroying. BUG=angleproject:2464 Change-Id: I59b8e1080e4292bd0856e59a928750c7e77a372e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1562522 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 127990f9 2019-04-04T13:52:04 Vulkan: Use render pass loadOp for scissored clears At this point, every clear is done through render pass loadOp, except masked color or stencil clears. The only fallback is clearWithDraw, that can clear both color and stencil at the same time. Bug: angleproject:2361 Change-Id: I805fc12475e832ad2f573f665cdfeb766e61a6d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1553740 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi 65d10f3b 2019-03-21T16:30:31 Vulkan: Implement robust resource initialization If a texture or renderbuffer needs to be cleared for robust access or due to having emulated channels, it is immediately cleared. The former relies on a front-end feature that optimizes robust access clears only to levels and layers that are not fully initialized through data upload. Bug: angleproject:2722 Change-Id: Icdab856eb4ffe963f78569b6d80d9ff5cb27ff9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535056 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 4d153383 2019-02-26T15:08:11 Reland "Vulkan: Implement debug markers" This reverts commit 0c01e36783b20a0177c653490cb4f8ea4a896075. Reason for revert: Its dependency that was reverted has now relanded: https://chromium-review.googlesource.com/c/angle/angle/+/1489153 Original change's description: > Revert "Vulkan: Implement debug markers" > > This reverts commit 983e446921946734fe47217c345a8fe2f079319d. > > Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605 > > Original change's description: > > Vulkan: Implement debug markers > > > > Covers both GL_KHR_debug and GL_EXT_debug_marker. > > > > Debug markers are used to specify events or hierarchically categorize a > > set of commands within the command buffer. When debugging, this allows > > for quicker navigation to the draw calls of interest, and otherwise > > provides context to debug output. > > > > Bug: angleproject:2853 > > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 > > Reviewed-on: https://chromium-review.googlesource.com/c/1403956 > > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Geoff Lang <geofflang@chromium.org> > > TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org > > Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: angleproject:2853 > Reviewed-on: https://chromium-review.googlesource.com/c/1470606 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> TBR=geofflang@chromium.org,jmadill@google.com,syoussefi@chromium.org Bug: angleproject:2853 Change-Id: Ie19ae103244d54dcf7108d5f61c24e318fc44057 Reviewed-on: https://chromium-review.googlesource.com/c/1489154 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@google.com>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 366df2b2 2019-01-18T15:40:34 Vulkan: Support external texture binding points. BUG=angleproject:2668 BUG=angleproject:3023 Change-Id: Idab0c4cbe1c7ed203ace50f1a6701dba11a40242 Reviewed-on: https://chromium-review.googlesource.com/c/1422548 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 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 0c01e367 2019-02-13T21:27:23 Revert "Vulkan: Implement debug markers" This reverts commit 983e446921946734fe47217c345a8fe2f079319d. Reason for revert: Depends on a CL that's reverted: https://chromium-review.googlesource.com/c/angle/angle/+/1470605 Original change's description: > Vulkan: Implement debug markers > > Covers both GL_KHR_debug and GL_EXT_debug_marker. > > Debug markers are used to specify events or hierarchically categorize a > set of commands within the command buffer. When debugging, this allows > for quicker navigation to the draw calls of interest, and otherwise > provides context to debug output. > > Bug: angleproject:2853 > Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 > Reviewed-on: https://chromium-review.googlesource.com/c/1403956 > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I7fcfc8683195d396aec61848719f52c0fa049ece No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2853 Reviewed-on: https://chromium-review.googlesource.com/c/1470606 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 983e4469 2019-01-18T16:04:50 Vulkan: Implement debug markers Covers both GL_KHR_debug and GL_EXT_debug_marker. Debug markers are used to specify events or hierarchically categorize a set of commands within the command buffer. When debugging, this allows for quicker navigation to the draw calls of interest, and otherwise provides context to debug output. Bug: angleproject:2853 Change-Id: Id65e11fc877d9e70b6fd0fae7f0bbbcb1164bf10 Reviewed-on: https://chromium-review.googlesource.com/c/1403956 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Michael Spang 229fc83d 2019-01-21T18:09:15 Vulkan: Port renderer to Fuchsia (reland) Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan renderer, as well as an implementation of OSWindow that renders fullscreen for the test suite. Disallow use of the vulkan loader from third_party as Fuchsia uses a fork of the loader and has not sent those changes upstream yet. Add a small wayland-inspired library libfuchsia-egl to provide a type "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type combines a zx_handle_t to an image pipe channel and a surface size. Image pipes can only be used once to create a VkSurfaceKHR. This means we have to recreate the pipe in tests that call eglCreateWindowSurface more than once with a single OSWindow, or the second call will fail. Add a resetNativeWindow() method to accomplish this. Reland disabling -Wextra-semi. BUG=angleproject:2475 TEST=angle_end2end_tests on Fuchsia Change-Id: Ie91715bcd760c6c04d4b8a02a91daa71e32ee30c Reviewed-on: https://chromium-review.googlesource.com/c/1467603 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@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 3f0ff409 2019-02-12T03:08:51 Revert "Vulkan: Port renderer to Fuchsia" This reverts commit 991d1cfb5e5a2f20a46961da3ad85b95da30b88a. Reason for revert: Failing compile on the fuchsia bots on the ANGLE auto-roller. https://ci.chromium.org/p/chromium/builders/luci.chromium.try/fuchsia_x64/209198 In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.cpp:10: In file included from ../../third_party/angle/util/fuchsia/ScenicWindow.h:13: In file included from gen/third_party/fuchsia-sdk/sdk/fidl/fuchsia/ui/policy/cpp/fidl.h:5: In file included from ../../third_party/fuchsia-sdk/sdk/pkg/fidl_cpp/include/lib/fidl/cpp/internal/header.h:12: ../../third_party/fuchsia-sdk/sdk/pkg/fit/include/lib/fit/function.h:135:6: error: extra ';' after member function definition [-Werror,-Wextra-semi] }; ^ 1 error generated. Original change's description: > Vulkan: Port renderer to Fuchsia > > Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan > renderer, as well as an implementation of OSWindow that renders > fullscreen for the test suite. > > Disallow use of the vulkan loader from third_party as Fuchsia uses a fork > of the loader and has not sent those changes upstream yet. > > Add a small wayland-inspired library libfuchsia-egl to provide a type > "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type > combines a zx_handle_t to an image pipe channel and a surface size. > > Image pipes can only be used once to create a VkSurfaceKHR. This means we > have to recreate the pipe in tests that call eglCreateWindowSurface more > than once with a single OSWindow, or the second call will fail. Add a > resetNativeWindow() method to accomplish this. > > BUG=angleproject:2475 > TEST=angle_end2end_tests on Fuchsia > > Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf > Reviewed-on: https://chromium-review.googlesource.com/c/1446496 > Commit-Queue: Michael Spang <spang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=spang@chromium.org,geofflang@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I2d9abefa9db5363ba63a17c1773d0e147040d055 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2475 Reviewed-on: https://chromium-review.googlesource.com/c/1465761 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Michael Spang 991d1cfb 2019-01-21T18:09:15 Vulkan: Port renderer to Fuchsia Add DisplayVk and WindowSurfaceVk subclasses for Fuchsia to the vulkan renderer, as well as an implementation of OSWindow that renders fullscreen for the test suite. Disallow use of the vulkan loader from third_party as Fuchsia uses a fork of the loader and has not sent those changes upstream yet. Add a small wayland-inspired library libfuchsia-egl to provide a type "struct fuchsia_egl_window" to use as EGLNativeWindowType. This type combines a zx_handle_t to an image pipe channel and a surface size. Image pipes can only be used once to create a VkSurfaceKHR. This means we have to recreate the pipe in tests that call eglCreateWindowSurface more than once with a single OSWindow, or the second call will fail. Add a resetNativeWindow() method to accomplish this. BUG=angleproject:2475 TEST=angle_end2end_tests on Fuchsia Change-Id: I71a613a362dd1c8aada49a3c02ae461e064457bf Reviewed-on: https://chromium-review.googlesource.com/c/1446496 Commit-Queue: Michael Spang <spang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Michael Spang 740db7fd 2019-02-06T09:40:13 Vulkan: Add support for loading layers from DisplayVk Fuchsia needs a layer to support VK_KHR_swapchain. Add the ability for DisplayVk subclasses to request a layer in addition to an extension. BUG=angleproject:2475 TEST=angle_end2end_tests on Fuchsia Change-Id: If86c773d4bd4ebecaee4b1631d3d4975105fe849 Reviewed-on: https://chromium-review.googlesource.com/c/1456478 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 96a8e747 2019-01-30T10:30:06 Vulkan: Move and inline object wrapper classes. This moves the wrapper classes into their own file. It also inlines all the various methods for performance. The inline methods are kept out-of-class to avoid problems with circular dependencies. Also adds a few missing valid() checks to the inline methods. Improves the score of the VBO state change test by 1-2%. Bug: angleproject:3014 Change-Id: Ia760c3a6905a9a5aacfd05db443b72f34947385e Reviewed-on: https://chromium-review.googlesource.com/c/1436167 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 82fddcb1 2019-01-18T14:27:43 Vulkan: Implement GLsync and EGLSync fence syncs That is required in GLES 3 for GLsync and EGL_KHR_fence_sync and EGL_KHR_wait_sync (or EGL 1.5) for EGLSync. The two constructs (GLsync and EGLSync) have similar semantics and share the implementation on the Vulkan backend. The implementation of a fence sync object is achieved through the combined use of a vkEvent and the implicit vkFence inserted at the end of every submission. Imagine the following command buffer: glDraw : Draw glCreateSync: Set Event <-- insertion of fence sync glDraw : Draw : Signal Fence <-- implicit fence at the end of submission glFlush : Submit Assume the serial S is associated to this submission. The following hold: - If event is set, the fence sync is signaled - If S is already finished, the fence sync is signaled - If client is waiting on the sync and S is not yet flushed, there will be a deadlock (unless multi-threaded and another thread performs the flush). The event is used to implement server waits (glWaitSync), as vkEvent is the only entity the GPU can signal and wait on within the command buffer. The wait is inserted in the command graph without incurring a flush, i.e. the wait can be within the same command buffer as event set. The event however does not support CPU waits (glClientWaitSync). vkFence is the only entity the CPU can wait on. For client wait therefore, the following algorithm is used: - If the event is already set, there's no wait -> already signaled - If timeout is zero, there's no wait -> timeout expired - If S is not flushed, flush it to ensure forward progress. - Wait until S is finished -> condition satisfied / timeout expired. Bug: angleproject:2466 Change-Id: I678995a6139dd9533fa8ad361a3d292b202c52a4 Reviewed-on: https://chromium-review.googlesource.com/c/1422552 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis 47ca1b2f 2019-01-23T16:11:41 Revert "Vulkan: Adding custom pool allocator" This reverts commit 05459e06fde5047ae8f5f90fe091c3255e6bc88e. Reason for revert: Clusterfuzz bugs flagged this commit Original change's description: > Vulkan: Adding custom pool allocator > > Copied pool allocator used by compiler to common and hooking it up as > custom allocator for CommandPools. Modified it to support reallocation. > > RendererVk now has a private poolAllocator and VkAllocationCallbacks > struct. The allocation callbacks are initialized to static functions > in RendererVk::initializeDevice() and then passed to CommandPool init() > and destroy() functions. > > Using the pool allocator saves Command Pool/Buffer clean-up time which > was showing us as a bottleneck is some cases. > > Bug: angleproject:2951 > Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 > Reviewed-on: https://chromium-review.googlesource.com/c/1409867 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=jmadill@chromium.org,tobine@google.com,ianelliott@google.com,syoussefi@chromium.org Change-Id: I363a351667c4dddef79833061790da90de477e70 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2951 Reviewed-on: https://chromium-review.googlesource.com/c/1430679 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 05459e06 2019-01-17T12:25:54 Vulkan: Adding custom pool allocator Copied pool allocator used by compiler to common and hooking it up as custom allocator for CommandPools. Modified it to support reallocation. RendererVk now has a private poolAllocator and VkAllocationCallbacks struct. The allocation callbacks are initialized to static functions in RendererVk::initializeDevice() and then passed to CommandPool init() and destroy() functions. Using the pool allocator saves Command Pool/Buffer clean-up time which was showing us as a bottleneck is some cases. Bug: angleproject:2951 Change-Id: I81aa8a7ec60397676fa722d6435029db27947ef4 Reviewed-on: https://chromium-review.googlesource.com/c/1409867 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1f750d1e 2019-01-16T13:27:16 Even more inlining and micro-optimization. Improves perf by about 3-4% on the Vulkan VBO state change test. Bug: angleproject:3014 Change-Id: If4415e503cd883cf7de6387bf1ebbca0e5fc994e Reviewed-on: https://chromium-review.googlesource.com/c/1393907 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Shahbaz Youssefi 5bca4fed 2019-01-09T17:07:06 Vulkan: Switch to EXT_debug_utils EXT_debug_utils is a (relatively) new extension that subsumes EXT_debug_report and EXT_debug_marker extensions. This change uses EXT_debut_utils (if available) to receive debug messages, keeping EXT_debug_report as fallback. Bug: angleproject:2798 Change-Id: Ia6767604548704e18f8150a54d2533c0b1197841 Reviewed-on: https://chromium-review.googlesource.com/c/1403955 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi b5ba549a 2019-01-02T15:19:22 Vulkan: Shader path for texture copy when image is not initialized This change implements staging image/texture copies when the destination image is not yet fully initialized. With this change, CPU readback for glCopyTex[Sub]Image2D and glCopy[Sub]TextureCHROMIUM should happen only if the texture formats don't allow a fragment-shader based copy. Bug: angleproject:2958 Change-Id: I04087e14ea8fb6fbc731598c5493e44651c22c01 Reviewed-on: https://chromium-review.googlesource.com/c/1393909 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 8f1b7a66 2018-11-14T16:02:54 Vulkan: Add DispatchUtilsVK This class provides a set of compute-based internal utilities. Currently, buffer clear and copy are implemented. Other possibilities include more efficient mip map generation, or specialized texture operations. VertexArrayVk::updateIndexTranslation() is updated to convert the GL_UNSIGNED_BYTE index buffer to a GL_UNSIGNED_SHORT one using this class to avoid a CPU readback. The vk::Format class is augmented with a few flags (IsInt, IsUnsigned) to be able to select the appropriate shader based on the format (float, int or uint). Bug: angleproject:2958,angleproject:3003 Change-Id: Ie35519deb3c32a3da5ccf74080c70092c9287f0a Reviewed-on: https://chromium-review.googlesource.com/c/1336307 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 254b32cb 2018-11-26T11:58:03 Vulkan: Make DynamicBuffer use BufferHelper This is so that the resulting buffers can be written to by the GPU. Additionally, the class is given the ability to create host-visible or device-local buffers, making map()-on-init() optional. This is in preparation for vertex/index transformations in compute. Bug: angleproject:2958 Change-Id: Ib8f5829e33a1e49fa8f80c70dbde74f313ae49ec Reviewed-on: https://chromium-review.googlesource.com/c/1351113 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi bc8cc5af 2018-11-26T12:15:14 Vulkan: Implement vk::BufferView Bug: angleproject:2958 Change-Id: I3f77e694638b4dc060d20a149c3f9c8aed3692d1 Reviewed-on: https://chromium-review.googlesource.com/c/1351114 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
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>
Shahbaz Youssefi 79927344 2018-10-22T11:41:43 Vulkan: add wrapper for vkEvent Bug: angleproject:2908 Change-Id: Id6c9326f85f9ff17b963078f82bcf486bae66a83 Reviewed-on: https://chromium-review.googlesource.com/c/1296951 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi c2b576d9 2018-10-12T14:45:34 Vulkan: Implement GL_EXT_disjoint_timer_query - QueryVk::queryCounter() and relevant utils are implemented for the sake of Timestamp queries. - TimeElapsed queries are implemented using two Timestamp queries. Bug: angleproject:2885 Change-Id: Id181bd97f5a24e7e96b3ea1b819483227e64daf0 Reviewed-on: https://chromium-review.googlesource.com/c/1276806 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi c4765aa7 2018-10-12T14:40:29 Vulkan: fix glGetQueryObject not flushing glGetQueryObject* requires forward progress in the queue regardless of whether we are waiting on the result or busy-looping over whether the results are available. This commit calls flush() if the query has pending work. Additionally, this fixes a race condition where glGetQueryObject* may be accessing a query whose corresponding batch has been submitted but not yet executed. In such a case, the GPU may not have already reset the query, so we have to wait on the fence of that batch to make sure the query results are reliably available. Bug: angleproject:2855 Change-Id: I977909c6526c0778a13722a8b8b73e54ad0202f6 Reviewed-on: https://chromium-review.googlesource.com/c/1279125 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 6f1dc51b 2018-10-04T14:36:04 Vulkan: Use a specialized macro for wrapped vulkan calls Vulkan wrapper functions are fairly straightforward. They call the Vulkan function and return immediately. The specialized macros introduced in this commit take care of the final return for brevity of the warpper. Additionally, this commit gets rid of ANGLE_EMPTY_STATEMENT in favor of the more robust macro definition using do {} while (0). Bug: none Change-Id: Ia7c68962d1aeee2c06ef210122b345b1a2e54f08 Reviewed-on: https://chromium-review.googlesource.com/c/1262020 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 563fbaa0 2018-10-02T11:22:01 Vulkan: Implement occlusion queries Begin and end queries insert an execution barrier in the command graph to ensure the commands around them are not reordered w.r.t to the query. Also, these commands cannot be recorded in separate secondary command buffers. Therefore, special-function nodes are created to perform the begin and end query calls on the final primary command buffer. Bug: angleproject:2855 Change-Id: Ie216dfdd6a2009deaaf744fd15d2db6899dd93e9 Reviewed-on: https://chromium-review.googlesource.com/c/1259762 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Jamie Madill c2116cd3 2018-10-02T09:31:40 Vulkan: Update pipeline barrier interface. This makes the vk::CommandBuffer class closer to an auto-generated wrapper class. Bug: angleproject:2828 Change-Id: I91ba03914a60d5612707dd240fcda25b86cf2c46 Reviewed-on: https://chromium-review.googlesource.com/1255505 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Tobin Ehlis f5aad063 2018-09-19T14:39:00 Avoid flush/invalidate of host-coherent memory For DynamicBuffer avoid calling vkFlushMappedMemoryRanges() or vkInvalidateMappedMemoryRanges() if the underlying memory is host- coherent. These calls are not required for host-coherent memory and may negatively impact performance. When currently allocating HOST_VISIBLE memory it's possible to also get HOST_COHERENT memory even though it's not explicitly requested. Because of this, the change updates the memory allocaiton interfaces through the stack to pass back the actual allocated memory properties so that it can be checked to see if it's host-coherent. Bug: angleproject:2804 Change-Id: Ife95c4b98115b16d16c087dd72dba7d9661fdb46 Reviewed-on: https://chromium-review.googlesource.com/1234276 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 8370e6bc 2018-09-11T17:56:23 Rename constant to kCubeFaceCount. This corrects the naming style for this constant variable. Also updates many usages in TextureD3D.cpp and TextureGL.cpp. Bug: angleproject:2470 Change-Id: I029dd98e925cabf23a4bb26467a62afe6c5bb6e0 Reviewed-on: https://chromium-review.googlesource.com/1220726 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3d61ac27 2018-08-28T16:58:55 Vulkan: More micro-optimizations. Inlining more methods into headers. In total the patch series improves performance by about 60-70% in the Vulkan draw call overhead test. Bug: angleproject:2786 Change-Id: I70913ac6b3d5836c17c13e249950987df362f203 Reviewed-on: https://chromium-review.googlesource.com/1194883 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Omar El Sheikh eb4b8697 2018-07-17T10:55:40 Introduced eglMakeCurrent Perf Test Currently disabled test on android Also made the default EGL device type be EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE Updated destroy function of RendererVk to properly reset the mMemoryProperties member variable Bug: angleproject:2735 Change-Id: Ie1f8ab1ac93b18eda4c10c3b10ecd4756f1d8543 Reviewed-on: https://chromium-review.googlesource.com/1140508 Commit-Queue: Omar El Sheikh <theoking@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d34aa362 2018-07-12T15:56:54 Vulkan: Add a create shader helper. This will be useful for line segment rasterization. Bug: angleproject:2598 Change-Id: I84912c976665ecb32903181fa820b8db88786a28 Reviewed-on: https://chromium-review.googlesource.com/1127299 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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 1617e69e 2018-07-11T11:08:19 Vulkan: Implement depth/stencil blit with flip of the viewport - This makes all end2end tests pass successfully on Win/Nvidia with viewport flipping enabled. Bug: angleproject:2673 Change-Id: I031c0a0f5fb0aede58b59479e57c2c127bcb964c Reviewed-on: https://chromium-review.googlesource.com/1133703 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
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>
Jamie Madill bea35a63 2018-07-05T11:54:10 Vulkan: Use Scoped resource init helper. In a few places we initialize resource on the stack in the Vulkan back-end. When we do this we should use a RAII wrapper so that if we generate an error and unwind the stack we can auto-release the object. This fixes a bug that was being triggered by an unexpected failure on Present with the Vulkan back-end on Intel. There are several other places in the code that should be modified to use the new wrapper. Bug: angleproject:2690 Change-Id: I49a1c5516756f8b7dba833aca65926aa7b8bd5c6 Reviewed-on: https://chromium-review.googlesource.com/1118610 Commit-Queue: 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 a72ebeba 2018-06-28T11:16:58 Vulkan: Fix issue in DynamicBuffer - We weren't keeping track of mSize correctly, causing some very specific index buffer bindings to fail. The size returned when allocating the buffer can be a bit different than the size requested, and that extra space between mSize and the allocated size was not meant to be used, causing errors in the validation layers. Bug: angleproject:2580 Change-Id: I47eb7b8de6f4f657de14385b77ba6a459add599b Reviewed-on: https://chromium-review.googlesource.com/1118607 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>