src/libANGLE/renderer/vulkan/VertexArrayVk.cpp


Log

Author Commit Date CI Message
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten e76c5c3c 2019-05-03T15:51:30 Vulkan: Enable drawRangeElements() Enable drawRangeElements() for the Vulkan backend and the associated tests. Test: angle_deqp_gles3_tests Bug: angleproject:3420 Change-Id: I98770631ce1387131bb45e2c1e9df24e911bc692 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595101 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 892d1805 2019-03-27T14:21:34 Vulkan: Have the WindowSurfaceVk own the submit semaphores. Chaining of submit semaphores is only needed for window surfaces because they are required for the first usage of the swap chain image and final present of the image. Move ownership of the submit semaphores from RendererVk to WindowSurfaceVk and update all calls to finish and flush to be piped through a ContextVk which tracks the currently bound window surface. BUG=angleproject:2464 Change-Id: I4b3083124d7910a5dee297afc219e3a3f28057f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1542257 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 198658a3 2019-03-19T22:09:14 Vulkan: Force a flush in ContextVk::onDestroy. Otherwise we could potentially be destroying resources that are currently in use. Was caught by changing some of the test tear down ordering. Also might affect some of the dEQP EGL multithread tests. Requires fixing the serial tracking of the "null" buffer. Otherwise we could be destroying the null buffer in the incorrect order. Bug: angleproject:3261 Bug: angleproject:3059 Change-Id: I57d1059ce9b1da19ced8ac753fab80c625901066 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1531291 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Tobin Ehlis 4a41914b 2019-02-05T08:50:30 Vulkan: Add trace markers Add systrace markers for various RendererVk::finish paths in order to quickly identify cause of finishes. Also added marker to commandPool destroy which is currently a known hotspot on some devices. Bug: angleproject:2528 Change-Id: I5a2fc741679a58445d71a2edd6204cf9e869d236 Reviewed-on: https://chromium-review.googlesource.com/c/1454277 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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 a63cc59f 2019-01-16T13:27:16 Vulkan: Don't store vertex attrib format and stride. We only use these values in vertex conversion. We can instead pass more info to the convertGPU/CPU functions. In client attribute streaming we can query the format table a second time. This is a bit slower. But the runtime of attribute streaming would usually be dominated by the conversion function time. So it shouldn't regress any real work perf. This saves on a bit of storage and memory overhead in the vertex sync functions in VertexArrayVk. Bug: angleproject:3014 Change-Id: I401eeff024664aa0efeea710503c0f619e6d4f22 Reviewed-on: https://chromium-review.googlesource.com/c/1406889 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 17a50e17 2019-01-10T22:05:43 Vulkan: Enable robust buffer access. This is not a complete implementation because it does not have the ability to disable the physical device feature. It does pass the current set of robust access tests. But there could be a performance regression on platforms that have a slower impelmentation. We would want the ability to support cases with bufer robustness on or off. Bug: angleproject:3062 Change-Id: I7d6eb889debcbd32f6ed809b526677123f872726 Reviewed-on: https://chromium-review.googlesource.com/c/1403967 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c759b8b4 2019-01-03T15:16:50 Vulkan: More Vertex Array optimizations. Inlines a number of Vulkan vertex array methods. Also changes the way vertex buffers are bound. Note that Vulkan doesn't support NULL buffer bindings. Thus we create an emulated NULL buffer to work around the problem of having gaps in the bound vertex buffers. This allows us to use a single bind call for ranges of vertex buffers even when there are gaps. Also changes how vertex array dirty bits are reset. Instead of calling memset to clear the affected buffers we pass a mutable pointer to the Vertex Array sync state. This allows us to only reset the dirty bits that we sync. This saves on the memory clearing time. Improves perf by about 10% in the Vulkan VBO state change test. Bug: angleproject:3014 Change-Id: Ib7b742dff7897fc891606a652ea0b64255a24c86 Reviewed-on: https://chromium-review.googlesource.com/c/1390360 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Shahbaz Youssefi e321940c 2018-12-08T16:54:14 Vulkan: Move image clear functionality to UtilsVk DispatchUtilsVk is renamed to UtilsVk and the functionality in framebuffer's clearWithDraw() is moved to that class. Eventually, more fragment-shader-based internal algorithms will be added to this class as well. Bug: angleproject:2958 Change-Id: I4753c9cb3288b59cd1ed60fe7a57b9f189704322 Reviewed-on: https://chromium-review.googlesource.com/c/1369284 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 611bbaab 2018-12-06T01:59:53 Vulkan: Convert vertex attributes in compute In this commit, VertexArrayVk::convertVertexBuffer() is renamed to VertexArrayVk::convertVertexBufferCpu() to explicitly show it does a CPU readback. A new VertexArrayVk::convertVertexBuffer() function is added that has the same functionality in gpu (with some assumptions, where the CPU fallback is used should those assumptions fail). Currently, the only requirement is that buffer offset/stride are divided by the component size. ConvertVertex.comp is the shader responsible for this conversion, and it implements the functionality in renderer/copyvertex.inc, minus a few functions that are not used in the Vulkan backend. Bug: angleproject:2958, angleproject:3009 Change-Id: I8ec9a5f4672509bcf7b9e352cd27663970ad4653 Reviewed-on: https://chromium-review.googlesource.com/c/1364451 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 ec06305b 2018-12-06T01:58:06 Vulkan: Add dynamic vertex buffers to graph With DynamicBuffer outputting BufferHelper objects, these objects can participate in the command graph, i.e. record commands. This means they need appropriate dependencies in the graph as well as pipeline barriers. There are a few users of DynamicBuffer for which this change should be applied to. This change covers vertex attribute buffers. Bug: angleproject:2958 Change-Id: Ic3f8e187639919aba23102bba238de9ce70e6394 Reviewed-on: https://chromium-review.googlesource.com/c/1364450 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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>
Shahbaz Youssefi 4abdf74f 2018-11-28T14:41:10 Vulkan: Add dynamic index buffers to graph With DynamicBuffer outputting BufferHelper objects, these objects can participate in the command graph, i.e. record commands. This means they need appropriate dependencies in the graph as well as pipeline barriers. There are a few users of DynamicBuffer for which this change should be applied to. This change covers index buffers. This commit includes a fix to BufferHelper::copyFromBuffer for WaW hazards. It also includes a fix for a missing pipeline barrier after BufferVk::copyToBuffer. Bug: angleproject:2958 Change-Id: I3e61af56936580b2da20c28c45defece552d9a39 Reviewed-on: https://chromium-review.googlesource.com/c/1352732 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@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 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 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>
Shahbaz Youssefi fca8fd62 2018-11-13T13:55:48 Vulkan: Refix cleanup race condition on Context destroy This partially reverts commit 905ee08219faed8ea50e194be0d76ad69faf1026 due to regression caused on startup time. Instead of calling finish before destroying the context, the objects in the Vulkan backend are `release()`ed instead of `destroy()`ed, so they will be kept alive for the duration of current work. Bug: 904846 Change-Id: Ia774470666c4c0d4c1ddc348f685d621243de204 Reviewed-on: https://chromium-review.googlesource.com/c/1333969 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 03d1a5ed 2018-11-12T11:34:24 Vulkan: Use global buffer barriers. This switches from using resource barriers for buffers to using global barriers. This matches the general advised best practice. It also allows us to combine multiple barriers into one. On a draw we might combine all the vertex and index barriers into a single barrier call. We implement this using a bit of extra state tracking in BufferHelper. Bug: angleproject:2828 Change-Id: I196b368804ff50e60d085687a643e5566ba1c5b6 Reviewed-on: https://chromium-review.googlesource.com/c/1309977 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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 77abad8d 2018-10-25T17:03:48 Remove Context::gatherParams. This won't be used in the future. It saves a few instructions on each entry point. Also refactors a bit of touched code. Also adds in a missed entry point: "glTexStorage2DMultisampleANGLE". Removes related code and moves remaining helper code in params.h into a new file entry_point_utils.h. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ifb49564597cde6ba82dfc3e185227619fdc62612 Reviewed-on: https://chromium-review.googlesource.com/c/1299478 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill bfe31c42 2018-10-25T17:03:47 Remove uses of DrawCallParams. Packing and referencing this structure was causing unnecessary draw call overhead. This improves performance on all the back-ends. Impacts the GL back-end the most. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ief416ab874e481baf960d02965978a311214a146 Reviewed-on: https://chromium-review.googlesource.com/c/1299477 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c1fd7376 2018-10-26T22:48:39 Move index range calculations into VertexArray. This is in preparation for removing the entire DrawCallParams struct. This struct was big enough to cause a performance hit on draw call perf tests just by virtue of initializing the fields. Also dereferencing the struct members is slower than reading function parameters since it adds an indirection. Also includes some error refactoring to enable moving code to a shared location. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ib663f2538c14ac30d4c31fd10d6350be469626e2 Reviewed-on: https://chromium-review.googlesource.com/c/1298380 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill cd0a0a3c 2018-10-18T18:41:57 Introduce SubjectBindingPointer. We can share the same pointer for the subject binding and the binding pointer. This further allows us to optimize buffer re-binding. The shared memory increases cache coherency and reduces the number of instructions needed. Bug: angleproject:2891 Change-Id: Id3162fa79de203f75989e7289ea02cb2ea1bec73 Reviewed-on: https://chromium-review.googlesource.com/c/1270217 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 6f755b21 2018-10-09T12:48:54 Use angle::Result in front-end. (Part 1) This covers most of the hot paths used in draw calls. Gives in the order of a 5% reduction in draw call overhead. Bug: angleproject:2491 Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa Reviewed-on: https://chromium-review.googlesource.com/c/1258149 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
jchen10 5dc0a6f9 2018-09-20T14:30:45 Vulkan: Vertex buffer should be format aligned. The address of each attribute in a vertex buffer must be aligned according to its format. See section 20.3 of vkspec. Currently we don't handle this when using DynamicBuffer as vertex input buffer. This loosely fixes the issue by using max alignment for all formats. BUG=angleproject:2797,angleproject:2405 Change-Id: I2b27950dacc8fda75dcb646ef4b4d66ff27d629a Reviewed-on: https://chromium-review.googlesource.com/1234281 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 2d03ff4a 2018-09-27T15:04:26 Vulkan: Make Buffer/Image be CommandGraphResources. Don't make TextureVk/RenderbufferVk/SurfaceVk/BufferVk own the manipulation of the command graph. Instead put the operations close to the buffers and images used to render. This will lead towards implementing implicit barriers on the command graph resources. Bug: angleproject:2828 Change-Id: I07b742b6792c60285b280d6454f90e963d667e0e Reviewed-on: https://chromium-review.googlesource.com/1246983 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 299bdfe7 2018-09-25T11:44:19 Vulkan: Update AMD suppressions. Bug: angleproject:2463 Bug: angleproject:2847 Bug: angleproject:2848 Change-Id: I4036363c517dbe293566bb9d51a2470685d41ac2 Reviewed-on: https://chromium-review.googlesource.com/1240108 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 85c4b43e 2018-09-19T23:35:00 Vulkan: Translate line loop indices from buffer. When a line loop is drawn with byte indices from a buffer, translate to short. Enable test. BUG=angleproject:2802 Change-Id: Ie178ec866387be85b91291c28e1978db0a09c20a Reviewed-on: https://chromium-review.googlesource.com/1237293 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Frank Henigman 9d84ccba 2018-09-12T18:09:02 Vulkan: renderer->finish() before reading buffers. Have to call renderer->finish() before reading a buffer otherwise you can get stale data. Enable IndexBufferOffsetTest.UInt8Index/ES2_VULKAN which now works. Disable LineLoopTest.LineLoopUShortIndexBuffer/ES2_VULKAN which stopped working on Windows with Intel GPU. BUG=angleproject:2659 Change-Id: I1e21b0e1dacd3368923caf18e767e34ab696eef6 Reviewed-on: https://chromium-review.googlesource.com/1227032 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 0a17e484 2018-08-31T17:19:11 Vulkan: Fix sync of initially disabled attributes. If an attribute was never enabled or disabled the default state was not properly synced in our implementation. This wasn't caught by currently enabled tests. Those tests are now enabled in VertexAttributeTest. Bug: angleproject:2800 Change-Id: I97c063651911379e16de4ee557d9840782114c54 Reviewed-on: https://chromium-review.googlesource.com/1199724 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 88fc6da3 2018-08-30T16:18:36 Vulkan: Mega-refactor to VertexArrayVk. This moves a lot of the code in VertexArrayVk into ContextVk. Having the code in a centralized place makes the code a bit more organized since the Context is reponsible for binding state to the command buffers. It also makes it easier to use dirty bits to track the command buffer state. Bug: angleproject:2786 Change-Id: I5cefbb14028e8f3fe651f26e997ca88f8f1c7628 Reviewed-on: https://chromium-review.googlesource.com/1188953 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 253038d8 2018-08-30T16:18:35 Vulkan: Refactor VertexArrayVk::streamIndexData. This enables us to use the same code for streaming client side index arrays and for translating buffers. Also includes a few more code cleanups. Bug: angleproject:2786 Change-Id: Ic615d87cb50fd0acd8ab6b63ed334da4b1c40eff Reviewed-on: https://chromium-review.googlesource.com/1188952 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@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>
Jamie Madill a064c27c 2018-08-30T16:18:34 Vulkan: Refactor VertexArrayVk::streamVertexData. Merges duplicated code in convertVertexBuffer with streamVertexData. Refactoring change only. Bug: angleproject:2786 Change-Id: I32baaad42d74918cfb17f04970d3c7e9b88362e7 Reviewed-on: https://chromium-review.googlesource.com/1188950 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4c310831 2018-08-29T13:43:17 Vulkan: Return VkDeviceSize from DynamicBuffer. This obviates many static_casts. More closely represents what Vulkan is doing. One cast remains where we are using uint32_t for dynamic offsets with uniform buffers. Bug: angleproject:2786 Change-Id: I043ebb5d965f46ee6ebbfcb91d75a58508cacfe3 Reviewed-on: https://chromium-review.googlesource.com/1188949 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dc358af7 2018-07-31T11:22:13 Context: Cache attributes masks. This cache is updated in the following locations: 1. GLES1: clientActiveTexture. 2. GLES1: disableClientState/enableClientState. 3. Context: linkProgram/useProgram/programBinary. 4. Context: bindVertexArray. 5. Vertex Array: most state changes. Improves performance by about 6% in the GL no-op test. Also includes fixes for keeping the client memory attribs mask in sync. The cache also includes a boolean if there are any enabled client attributes. Bug: angleproject:1391 Change-Id: I93b6a2c8492355958fd5483f14b70535729091d6 Reviewed-on: https://chromium-review.googlesource.com/1147437 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 67c388e6 2018-07-19T19:16:11 Vulkan: support GL_FIXED vertex data. Override fixed to float, generate code, enable tests. BUG=angleproject:2405 Change-Id: Ic3e9a31eaf22372023b94081b0f4a83770dcabbe Reviewed-on: https://chromium-review.googlesource.com/1144455 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman e452382a 2018-07-19T16:10:53 Vulkan: convert/align vertex data from buffers When we get a buffer with vertex data in an unsupported format or alignment, correct that as we copy it to a DynamicBuffer, then use the copy. Enable tests. BUG=angleproject:2405 Change-Id: I2132abea4d936f6b53d9209be7f99a0e2d8de219 Reviewed-on: https://chromium-review.googlesource.com/1141277 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ba365939 2018-07-18T17:23:46 Rename angle::Format::ID to angle::FormatID. This allow for predeclaring the enum. It solves some include dependency issues. Bug: angleproject:2729 Change-Id: Ibbbab0796e466c62848404ba277c5f454fd9ac62 Reviewed-on: https://chromium-review.googlesource.com/1142299 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5a4c932a 2018-07-16T11:01:58 Vulkan: Implement "default" vertex attributes. Rendering from disabled attributes is implemented using small dynamic buffers. The buffers use a stride of zero so the same vertex data is pulled for every index. This fixes all the disable attribute tests in dEQP. Bug: angleproject:2444 Change-Id: I04fe139076da3e3ff723bed8eb17e333b4cb0ddf Reviewed-on: https://chromium-review.googlesource.com/1136664 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 419acc8f 2018-06-24T19:57:31 Vulkan: Convert streamed vertex data as needed. Add two members to vk::Format: - vertex data copy function - flag indicating if the function converts or not Use the function when streaming vertex data so it gets converted if needed. Add fallbacks for integer formats. These formats will now work everywhere, as long as they are in client memory, not a buffer object. Adjust test expectations accordingly. BUG=angleproject:2405 Change-Id: I677221219d933c35740633a0ab7694293e218177 Reviewed-on: https://chromium-review.googlesource.com/1084328 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Jamie Madill eebe2190 2018-07-11T09:01:18 Vulkan: Clean up Error usage. * Adds a nodiscard to the Error class. * Fixes the places where Error was discard. * Uses more vk::Error instead of gl::Error. This enables the Vulkan back-end Error refactoring. Bug: angleproject:2713 Change-Id: I09606d965e8b7cfd341ad7fb95cf029b9d694ef4 Reviewed-on: https://chromium-review.googlesource.com/1128922 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill a2f043d8 2018-07-10T17:21:20 dEQP: Implement platform error handling. Also downgrades several Vulkan UNIMPLEMENTED() to WARN(). Also downgrades a couple D3D-specific errors to warnings. Also downgrades an undefined behaviour integer clear error to warning. Also includes suppressions for failing D3D11 ES 3.1 SSBO tests. Also includes suppressions for failing Android GLES format tests. Also includes suppressions for failing Android Vulkan buffer tests. Bug: angleproject:2552 Bug: angleproject:2567 Bug: angleproject:1951 Bug: angleproject:2405 Change-Id: Ie619085021d42012cd578b669f7ff4252ca41a58 Reviewed-on: https://chromium-review.googlesource.com/1062791 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Luc Ferron fa5d84be 2018-06-28T10:40:04 Vulkan: Fix offset handling for vertex buffers Bug: angleproject:2580 Change-Id: I22f62a8549e998275224a6b1f9c133cf31ebb5b9 Reviewed-on: https://chromium-review.googlesource.com/1118419 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman 8c379f36 2018-06-21T19:55:05 Vulkan: enable some vertex data tests. Enable tests that don't use fixed or unnormalized short/byte vertex data, with some exceptions for Android and AMD. BUG=angleproject:2405 Change-Id: I9e37ebca3a873617f11fee065b7a0ba67f80998c Reviewed-on: https://chromium-review.googlesource.com/1111317 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Rafael Cintron 05a449a7 2018-06-20T18:08:04 Replace reinterpret_cast with safer or no cast When casting types to one another in C++, the weaker the cast, the better. This change replaces instances of reinterpret_cast with static_cast or no cast where it safe and correct to do so. BUG=angleproject:2683 Change-Id: I99c9033614a65282ae1d78cf0f4b80fabd75877a Reviewed-on: https://chromium-review.googlesource.com/1109396 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 2ad498eb 2018-06-20T13:19:01 Vulkan: get vertex formats from format table. Use the Vulkan format table to look up the Vulkan format for vertex data. This will let us support more vertex formats by adding them to the table. It also eliminates one usage of gl::VertexFormatType. No functional change. BUG=angleproject:2405 BUG=angleproject:2531 Change-Id: I73eb69ccac50d427de3e7d5479f92bb17c49aed3 Reviewed-on: https://chromium-review.googlesource.com/1051028 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron 6ed167a9 2018-06-13T13:45:55 Vulkan: Implement conversion to uint16 for drawElements with ubytes Bug: angleproject:2646 Bug: angleproject:2659 Change-Id: If3c7a2b77d6acd18c8ca2522a427a43e10ed6db2 Reviewed-on: https://chromium-review.googlesource.com/1099420 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 49aacad5 2018-06-12T08:33:59 Vulkan: Support the indices offset in drawElements calls Also fixes an issue in buffer copy synchronization. Bug: angleproject:2645 Change-Id: Ibca7052daaf1e6fe37913c8a8216ec33c66426b6 Reviewed-on: https://chromium-review.googlesource.com/1096911 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron 3e313805 2018-06-11T14:44:33 Vulkan: Line loop edge case with ubyte indices Bug: angleproject:2637 Change-Id: I2cec129ed1aa0e55e0dbf1d353caa65a51c528a3 Reviewed-on: https://chromium-review.googlesource.com/1096017 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Luc Ferron 387b3b36 2018-05-28T10:11:57 Vulkan: Fix a line loop edge case causing validation errors Bug: angleproject:2563 Change-Id: I6e908fbd3e5725dc3f355f8b0561f2177b61dff6 Reviewed-on: https://chromium-review.googlesource.com/1075291 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 316c6065 2018-05-29T10:49:45 Vulkan: Call GraphResource instead of GraphNode. We don't need to use the CommandGraphNode class directly. This CL consolidates our code so we never call the GraphNodes class directly. Instead we call operations on GraphResource. This should simplify the interaction with APIs from the various graph and dependency management classes in the Vulkan back-end. A new concept of 'starting' vs 'appending' commands is introduced. Appending tries to avoid starting new command buffers when possible. Should not change how the graphs are constructed, and mostly be a refactoring change. There may be minor behaviour changes to some commands. Bug: angleproject:2539 Change-Id: Ia971e5cacb1164b9b3b22fa4a0a55b954d81f10e Reviewed-on: https://chromium-review.googlesource.com/1052068 Commit-Queue: Jamie Madill <jmadill@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>
Luc Ferron a9ab0f37 2018-05-17T17:03:55 Vulkan: Fix DynamicBuffer usages, need to use specific alignment The alignment used to allocate VkBuffers in the VkBuffer needs to be at least the size of the nonCoherentAtomSize defined in the limits of the VkDevicePhysicalProperties. The latest roll of the vulkan-validation-layers added that check and caused a bunch of errors. This is fixing them. Bug: angleproject:2565 Change-Id: Ia2ad506dce7966adb6220c52ea891903922c47d0 Reviewed-on: https://chromium-review.googlesource.com/1064950 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 18e323ab 2018-05-11T16:54:17 D3D11: Fix out-of-range access with robust access. When using a vertex buffer with DYNAMIC usage, with robust buffer access enabled, we would sometimes read out-of-bounds when using very large values for the index range. An unchecked signed addition would overflow and lead to reading a negative offset. Fix this problem by keeping the value size_t whenever possible. Also do clamped casts when converting to a smaller values. Also adds a regression test. Bug: chromium:842028 Change-Id: Ie630ac857c6acfc0bace849a03eebfbaa2fbe89a Reviewed-on: https://chromium-review.googlesource.com/1055928 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 61859817 2018-05-09T14:17:39 Vulkan: Fix use-after-free with DynamicBuffer. The implementation of DynamicBuffer before my changes could have some issues in the following use case: - Allocate buffer 1 for Texture 1 (with size as big as the full buffer size) - Allocate buffer 2 for Texture 2 (triggers creation of a new underlying BufferVk and releases the buffer 1 to the Renderer) - Render with Texture 2 (texture 1 hasn't been flushed yet) - swap buffers (causes garbage in the renderer to be cleaned up) - Try rendering with Texture 1, and you'll get an error stating that the buffer we're trying to copy is not valid (because its already been freed). This set of changes: - Add a new test that specifically triggers this case. - enables the texture.filtering.cube* tests in dEQP. - Fixes the issue by adding a manual releasing pattern of the buffers in DynamicBuffer. Bug: angleproject:2505 Change-Id: I207ce4a694016766f008cca67d82b252f460e0df Reviewed-on: https://chromium-review.googlesource.com/1052551 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron a4fa9c27 2018-04-13T07:00:56 Vulkan: drawElements with GL_LINE_LOOP and an offset Also enables a test in LineLoopTest that validates this case. Bug: angleproject:2473 Change-Id: Icb4c5735c11be40cdeceaa051f5a5cef33fd22c6 Reviewed-on: https://chromium-review.googlesource.com/1011669 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill bcef3224 2018-04-13T15:19:11 Move client attribs mask to front-end. The Vulkan and GL back-ends both had a client attributes mask. This consolidates them into the front-end, where it can also be used in the validation layer. Also includes a fix which was incorrectly setting the enabled mask in setVertexAttribFormatImpl. Bug: angleproject:1391 Change-Id: I5e45c1e2a56b30a36dec1482d170592c30a16d40 Reviewed-on: https://chromium-review.googlesource.com/1008272 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Luc Ferron a912046d 2018-04-12T13:11:03 Vulkan: DrawElements with line loops client side memory support - Also enables 6 new tests in LineLoopTests.cpp in angle_end2end Bug: angleproject:2458 Change-Id: I4aec12b0ac780e81e6811f1199a5acaf17d9b982 Reviewed-on: https://chromium-review.googlesource.com/1010411 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron 983c429f 2018-04-10T13:05:45 Vulkan: Lineloops edge base bugfix and new tests The dynamic buffer we are using in the LineLoopHelper wasn't able to support switching between different allocation sizes. Fix this by simply using a min alignment of the maximum allocation size we can reach. Adds 2 new tests to validate these calls in StateChangeTest.cpp Bug: angleproject:2458 Change-Id: I9d224e7dcfcd7627010832ca30dd9e1b9eceea4e Reviewed-on: https://chromium-review.googlesource.com/1007335 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron c1e0268a 2018-04-11T11:02:55 Vulkan: drawArrays followed by drawElements bugfix Also add a test in StateChangeTest.cpp to validate the behavior. Bug: angleproject:2458 Change-Id: I58848772c0b4f71aaa3ee187778e49fa08e6800d Reviewed-on: https://chromium-review.googlesource.com/1007320 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill a56467e0 2018-04-11T16:19:41 VertexArray: Use switch macro for faster iteration. Has a small but noticeable impact on performance on a microbenchmark. Seems to improve a synthetic score by about 1%. Should have a very small improvement in real-world performance. Note that the odd formatting is an idiosyncrasy of clang-format. Bug: angleproject:2389 Change-Id: I888bf101c6d8b80a0fbafdb9c5a84205c9c8fee6 Reviewed-on: https://chromium-review.googlesource.com/962963 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 22f12fed 2018-04-08T14:23:40 Vulkan: Rename vk::LineLoopHelper. This more closely follows the general pattern laid out by the naming in vk_helpers.h. It also changes the dynamic buffer that the helper wraps to be stored by-value since the header include order problem is fixed. Bug: angleproject:2318 Change-Id: I1de9e1edee2125d3afd490b4f9c99cf70c61215c Reviewed-on: https://chromium-review.googlesource.com/1001654 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 4416247c 2018-04-06T13:20:45 Vulkan: Enable point sprite end2end tests Bug: angleproject:2447 Change-Id: I92a6ed730dd2048b055d32d1f149a29172c7f38a Reviewed-on: https://chromium-review.googlesource.com/999822 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill 26084d0a 2018-04-09T13:44:04 Vulkan: Create TextureVk's Image lazily. This defers the actual Image initialization until the Image is used as either a Framebuffer Attachment or OpenGL Texture object. This will allow us to construct an Image from multiple sub resources, like when we're initializing a mip chain, or a cube map texture. Also adds a helper "hasDepthOrStencilBits" function to angle::Format. Bug: angleproject:2318 Change-Id: Ife861560216581a90fc6da32a583f69886c7daea Reviewed-on: https://chromium-review.googlesource.com/985202 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9cceac42 2018-03-31T14:19:16 Vulkan: Update resource dependency semantics. This removes passing the Serial around to several methods, so that dependency management is a bit more automatic. This makes life a bit easier when dealing with state updates when resources are in use by Vulkan. The FramebuffeVk no longer stores an extra serial of the last draw, instead it will trigger creation of a new writing node on a state change update. Bug: angleproject:2318 Change-Id: Ie58ec66e6e8644ba4d402c509255c3795d363dd3 Reviewed-on: https://chromium-review.googlesource.com/985201 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill b8e39660 2018-04-04T11:41:42 Vulkan: Remove Observer from LineLoopHandler. This can now use the VertexArrayVk dirty bits. It also seems as though there are a couple caching bugs with the LineLoopHandler. Bug: angleproject:2389 Change-Id: I8af73f4acf56768ed9c68395349ba96acfbe9666 Reviewed-on: https://chromium-review.googlesource.com/989259 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@google.com>
Jamie Madill c3755fc5 2018-04-05T08:39:13 Vulkan: Move Streaming data to VertexArrayVk. Instead of the ContextVk owning the translations for the various attributes, make the VertexArrayVk own them. This way they can handle the dirty bit state notifications directly instead of needing their own Observers. Bug: angleproject:2389 Change-Id: I5e571ba6c563e820a4c0d5f92db35031e6f2428a Reviewed-on: https://chromium-review.googlesource.com/989258 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill f3614370 2018-03-31T14:19:14 Vulkan: Rename StreamingBuffer to DynamicBuffer. This makes it consistent with DynamicDescriptorPool, and gives a bit more precise definition. Bug: angleproject:2318 Change-Id: I8953113165ebe2d0dcfc0fc923d94280180442ce Reviewed-on: https://chromium-review.googlesource.com/985199 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Jamie Madill 32fd63bc 2018-03-31T11:20:35 Vulkan: Use DrawCallParams in draw methods. This cleans up some of the vertex streaming logic. Bug: angleproject:2389 Change-Id: I8ed2f8acd06bbdd97db40acac35e5692112a3efe Reviewed-on: https://chromium-review.googlesource.com/989257 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 0946393d 2018-04-04T05:26:59 Move Buffer Subject/Observer to front end. This makes BufferImpl into an Observer Subject. It also refactors the Vertex Array updates for the D3D11 backend use more of a dirty bit coding style. This change makes it so Buffer contents changes trigger front-end dirty bits from the back-end, which may be undesirable. Bug: angleproject:2389 Change-Id: Iac8ce1171284a86851c18cd1373ddf24fcefe40b Reviewed-on: https://chromium-review.googlesource.com/979812 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 5d232d53 2018-04-01T19:57:19 Fix conditions for updating element array buffer. It was skipping elementArrayBufferOverride->onReadResource() if mCurrentElementArrayBufferResource was null. BUG=angleproject:2389 Change-Id: If33a11d35225daf572796abc8c18f6d6df758b48 Reviewed-on: https://chromium-review.googlesource.com/989408 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Frank Henigman 0af5b86a 2018-03-27T20:19:33 Return gl::Error from VertexArray::syncState(). No functional change. When we add vertex data format conversion to Vulkan we will need to be able to return an error from VertexArray::syncState(). BUG=angleproject:2405 Change-Id: I4b537946ecbb6593280b6510c5cd8d8e3c65e8dd Reviewed-on: https://chromium-review.googlesource.com/982897 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Jamie Madill e858cb1d 2018-03-27T09:44:32 Split VAO dirty bits to speed iteration. Using > 64 bits (we had over 90) would use a much slower dirty bit iteration. Speed this up by splitting the dirty bits into two levels. The first top level only has a single dirty bit per attrib, per binding, and one bit for the element array buffer. The next level has separate dirty bits for attribs and bindings. The D3D11 back-end doesn't actually care about individual dirty bits of attribs or bindings, since it resets entire attributes at a time, but the GL back-end only refreshes the necessary info. Improves the score of a simple state change microbenchmark by 15% on the D3D11 and GL back-ends with a no-op driver. Real-world impact will be smaller. Also includes a test suppression for an NVIDIA bug that surfaced when we changed the order of that GL commands were sent to the driver. BUG=angleproject:2389 Change-Id: If8d5e5eb0b27e2a77e20535e33626183d372d311 Reviewed-on: https://chromium-review.googlesource.com/556799 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 7a06ac1b 2018-03-15T10:17:04 Vulkan: Dynamic update of uniforms - This change enables us to update uniforms indefintely using VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC descriptor types. - Enables 219 new dEQP tests in the uniform_api namespace. - Creates a new white box test to validate new buffer allocation. Bug: angleproject:2392 Change-Id: I8146e6104a6b7727f63265a4671577d251a8fca8 Reviewed-on: https://chromium-review.googlesource.com/965929 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron e3dc5dd0 2018-03-16T07:37:21 Vulkan: Add 2 features to StreamingBuffer This is prerequisite work to dynamic uniform buffer updates. 1- Alignment parameter to be able to allocate by chunks of this alignment. 2- Out boolean to indicate if a new VkBuffer has been assigned on the allocate operation. Bug:angleproject:2392 Change-Id: If346e13200455febbe78045e908ae89c9dc93cdb Reviewed-on: https://chromium-review.googlesource.com/965612 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Frank Henigman a53d0e18 2018-02-13T00:06:06 Vulkan: support indices in client memory. glDrawElements will now work with indices and/or vertex data in client memory, as well as in a buffer object. Enable corresponding tests. BUG=angleproject:1683 Change-Id: Iefb9796a48b21ed6f9a837b08b0ad3218ff6dd6b Reviewed-on: https://chromium-review.googlesource.com/915721 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 6dd4a92a 2018-03-02T16:35:13 Vulkan: track attributes in client memory. To support indexed draws it's useful to have a cheap query for the presence of vertex attribute data in client memory. This patch adds a bit mask to keep track of such attributes. It also lets us simplify VertexArrayVk::streamVertexData() slightly. BUG=angleproject:1683 Change-Id: I871bfb885112650b025e110c383db3c391eafb90 Reviewed-on: https://chromium-review.googlesource.com/947927 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 78e39b3f 2018-02-26T07:42:44 Vulkan: Line loops for indexed draw calls Bug: angleproject:2335 Change-Id: Iabd6ae8181c6d3fb487f953a6fbf699db568a1c9 Reviewed-on: https://chromium-review.googlesource.com/941261 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman a8e868f2 2018-01-28T23:32:25 Vulkan: use correct vertex stride. It was passing the attribute size, not the stride, so it worked only when they were the same. Enable corresponding tests. BUG=angleproject:2310 Change-Id: Ie3ab13567c16c302aa9aeda5d059e5fd4eb92b4e Reviewed-on: https://chromium-review.googlesource.com/875304 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1f46bc12 2018-02-20T16:09:43 Vulkan: Add CommandGraph class. This also renames CommandBufferNode to CommandGraphNode. It also renames some of the intenal members to more closely represent the tree relationships (parents/children). This should clean up the command graph classes and make them a bit easier to understand. Bug: angleproject:2361 Change-Id: I024bffcc7f4157c78072ef902a3c40a07a08b18a Reviewed-on: https://chromium-review.googlesource.com/922121 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Frank Henigman 17448956 2017-01-05T15:48:26 Vulkan: vertex attributes in client memory. Support vertex data stored in client memory passed to glVertexAttribPointer. Only GL_FLOAT data is supported at this time. Includes a simple test. BUG=angleproject:1683 Change-Id: I3bc0cdefe02b02c046b0e85822019a0f1762235e Reviewed-on: https://chromium-review.googlesource.com/425137 Commit-Queue: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0e65454d 2018-02-07T14:50:06 Vulkan: Fix circular dependency with resource updates. The old implementation would try to keep recording draw commands to the same framebuffer write operation even if the vertex array buffer data changed. This would lead to a broken dependency graph. Fix this by forcing any current render operations to create a new node in this case, giving a correct command graph. Old design: - render (creates a CommandBufferNode A) - update buffer (creates a CommandBufferNode B which happens after A) - render (to CommandBuffer A, and gives a circular dependency with B) New design - render (CommandBufferNode A) - update buffer (CommandBufferNode B, happens after A) - render (CommandBufferNode C, happens after B) This also renames some methods to try to clarify them. Bug: angleproject:2350 Change-Id: I6559bed4ed3f58f68771662422c5bef6a505282b Reviewed-on: https://chromium-review.googlesource.com/907416 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill efb5a5c8 2018-01-29T15:56:59 Vulkan: Fix swaps done right after a clear. We were missing a dependency insertion between the Framebuffer and its attachments, only during clear operations. Also renames a few methods to make them more consistent. Bug: angleproject:2264 Change-Id: Ic3af5b34b6de900ea2cc1b765f8d3d69f7f9a131 Reviewed-on: https://chromium-review.googlesource.com/891985 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ffa4cbb6 2018-01-23T13:04:07 Vulkan: Implement the Pipeline cache. This currently keeps a cache of every PSO compiled and does not trim the cache or evict old members on memory pressure. This will be done as a follow-up. Improves the speed of the Draw Call microbenchmark 50x when using a single state change. Bug: angleproject:2163 Change-Id: I2cceb38ca57ae639f36a944f4571b627481b92da Reviewed-on: https://chromium-review.googlesource.com/876954 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 112a3a8e 2018-01-23T13:04:06 Vulkan: De-couple Program from VertexArrayVk dirtyiness. The VertexArrayVk is responsible for filling out the packed shader input info in ANGLE's packed PipelineDesc info structure. This packed info structure is used for Pipeline init and caching lookup. The prior design had this info depend on the active inputs in the current Program. This was undesirable because then, on a Program change, the ContextVk would have to call into the VertexArrayVk to invalidate this info. Instead, keep a working copy of the VertexArrayVk bits and only update the bits corresponding to dirty vertex attributes. This simplifies the cached state management a little bit for ContextVk. This also means we don't have to update the cached copy in the VertexArray on a change in VertexArray binding. Bug: angleproject:2163 Change-Id: I5ba74535367aed74957d17bdc61f882508562d0e Reviewed-on: https://chromium-review.googlesource.com/881703 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 3c424b48 2018-01-19T12:35:09 Vulkan: Add vk_cache_utils.h. This file contains the Pipeline and RenderPass cache utils. Also renames renderervk_utils.h to vk_utils.h and the format utils file. Refactoring change only. Bug: angleproject:2163 Change-Id: I5113a9a2c6f0b0960d38e6c2d8e391fa2d9f5f6a Reviewed-on: https://chromium-review.googlesource.com/876505 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f2f6d379 2018-01-10T21:37:23 Vulkan: Add PipelineDesc. The PipelineDesc class is a 512-byte packed description of the entire Vulkan pipeline state. It uses the alignas keyword and some static asserts to verify that the structures are packed. This ensures that when ANGLE uses MurmurHash to hash the entire struct, and memcmp to check for identity, that there are no garbage padding bits. This CL does not implement the Pipeline cache, but it will help, since now we have a packed type that can be used as the key to a hash map. Bug: angleproject:2163 Change-Id: I16efa927f08d30d89a9c4c8943edd211c6878ac8 Reviewed-on: https://chromium-review.googlesource.com/829893 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 49ac74bd 2017-12-21T14:42:33 Vulkan: Implement command re-ordering. This introduces a new CommandBufferNode class. Nodes are linked together to form a graph based on their dependencies. When the app triggers a readback or swap, the graph is flushed entirely. This sends the queued ANGLE Vulkan work to the Vulkan queue which is then processed on the GPU with the right dependencies. This design allows us to save on some unnecessary RenderPass creation and also allows us to know what load/store ops to use. It also allows us to take advantage of the Vulkan automatic RenderPass transitions for performance. Load/Store ops and automatic transitions will be implemented in later patches. Bug: angleproject:2264 Change-Id: I0e729c719e38254202c6fedcede4e63125eb4810 Reviewed-on: https://chromium-review.googlesource.com/780849 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill da854a27 2017-11-30T17:24:21 Vulkan: Clean up VAO cached resources. We can actually store a pointer to the base ResourceVk instead of BufferVk for updating serials. This will work a little nicer with streaming vertex data, which won't have a BufferVk but will have an accessible ResourceVk pointer. Also add an element array resource pointer for serial update. This was missing and could lead to incorrect behaviour. Also change the types of the caches from std::vector to gl::AttribArray, which is a std::array. Bug: angleproject:2264 Change-Id: Ibd79b7676b5dbc3875ae9d110be477d228e01c5c Reviewed-on: https://chromium-review.googlesource.com/798170 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>