src/libANGLE/renderer/vulkan/FramebufferVk.cpp


Log

Author Commit Date CI Message
Luc Ferron 14f4817c 2018-04-11T08:43:28 Vulkan: Simplify viewport / scissor updates Stop tying the viewport and the scissor together. Instead, we simply use a very large (0->maxInt) scissor when scissor isn't enabled and we use the clipped scissor to the renderArea size when its enabled. Bug: angleproject:2443 Change-Id: If7454793a050b1833c7d3166ea6b380192085c8f Reviewed-on: https://chromium-review.googlesource.com/1006996 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron d17bdfe5 2018-04-05T13:50:10 Vulkan: 3 Final bugfixes to enable all dEQP depth_stencil tests - The scissor when clearing should not be clipped against the viewport. - The render pass was created with a render area == to the current viewport, but the viewport can be changed by the tests multiple times per render pass, so we should always keep the renderArea to the full framebuffer instead. - Enables an additional 163 dEQP tests. - We should clip the scissor to the framebuffer dimensions instead of the viewport. Its valid to do a cmdClearAttachments outside the viewport, but not outside the full framebuffer's dimension. Bug: angleproject:2443 Change-Id: I79168e9f0c782d6dec77470fef938b85ad7a8794 Reviewed-on: https://chromium-review.googlesource.com/998448 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 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 6816d843 2018-03-31T14:19:17 Add two new fields to angle::Format. One field determines if a format is a compressed format (called Block format for angle::Format, but basically the same). The second field is the number of bytes in the format, so we can do calculations on pixel size. Both of these will make life cleaner in the Vulkan back-end. Also solves some TODOs in the vk format table init. Bug: angleproject:2318 Bug: angleproject:2358 Change-Id: I8b021b959c5892c86635e0225012295e5e830256 Reviewed-on: https://chromium-review.googlesource.com/987524 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@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>
Luc Ferron 8836f631 2018-04-05T07:26:53 Vulkan: Bugfix in depth/stencil clearing In the situation when we try to clear the depth OR the stencil buffer but we have a packed depth/stencil attachment, we were still clearing both of them since Vulkan doesn't allow setting just the depth or the stencil image aspect bit on the clear call. The workaround is to use the vkCmdClearAttachments command that allows us to clear one or the other easily. Bug: angleproject:2443 Change-Id: I6814e1927c019d9ec9255d79c6bc7b913a8c99e9 Reviewed-on: https://chromium-review.googlesource.com/997752 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 858c1ccc 2018-03-31T14:19:13 Vulkan: Move image layout into helper. Now that we're using the helper everywhere, we can clean up the vk::Image class and move the layout tracking into ImageHelper. Bug: angleproject:2318 Change-Id: I9636835a2a3a76f181dac629bd4182bc5815cdee Reviewed-on: https://chromium-review.googlesource.com/980774 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron a8af3a69 2018-03-29T14:44:24 Vulkan: Depth/stencil scissored clears - Generalize cmdClearAttachments to be able to clear depth/stencil/color individually. - The clear of the stencil part is implemented, but cant be tested until stencil state support is implemented in the next commit. Bug: angleproject:2427 Change-Id: Ib1fc7f66b2bd232761d374e217812605d3ff9152 Reviewed-on: https://chromium-review.googlesource.com/992874 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill bc54342b 2018-03-30T10:43:19 Vulkan: Make RenderTargetVk use ImageHelper. Bug: angleproject:2318 Change-Id: I9bc4bb7f5bcd3029a31c8570809f253cf5e4b12a Reviewed-on: https://chromium-review.googlesource.com/980773 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 93edca16 2018-03-30T10:43:18 Vulkan: Add an Image helper class. This class wraps a lot of the common functionality of a vk::Image. It keeps an associated DeviceMemory and ImageView. Eventually we can probably merge this class with RenderTargetVk. We can also use it to implement the same functionality between Renderbuffer and Texture and abstract different storage types, like 2D and Cube. Bug: angleproject:2318 Change-Id: I39239f47b483cfb96290a15b06edd264f7f4bb34 Reviewed-on: https://chromium-review.googlesource.com/980772 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron e6a40d07 2018-03-22T10:30:57 Vulkan: Depth / stencil attachments bug fixes I found a couple of bugs trying to enable polygon offset render states. This is just pre-work to get to a better state. Bug:angleproject:2353 Change-Id: If6af949a09af1340e870afb627ae427d01c6e77c Reviewed-on: https://chromium-review.googlesource.com/975631 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 60284223 2018-03-20T16:01:44 Vulkan: Support of npot textures The bug was with the readPixels not using the rowPitch, and not really with the support of npot. Bug:angleproject:2413 Change-Id: I09c0d87768bc29d3beb452ae83996cd4d2b4a600 Reviewed-on: https://chromium-review.googlesource.com/971830 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill 0cec82a5 2018-03-14T09:21:07 Vulkan: Implement basic depth/stencil buffers. This implements basic depth/stencil states and clearing. This also implements "fallback" texture formats in the texture generation. Fallback formats are those that are chosen at runtime for replacements for main formats which lack driver support. They are different from override formats, which are always used because we assume there is no driver support. The Vulkan spec only asserts that one of the two of D32 or D24 has mandatory support. In the case of AMD, D24 is not supported fully, and we need the fallback format support emulation. Bug: angleproject:2357 Change-Id: Ic86cede3c69ff9893a06b3a55c3b5d2d897fa55f Reviewed-on: https://chromium-review.googlesource.com/916701 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron 33140409 2018-03-08T13:57:52 Vulkan: Fix readPixels to support sub image reads correctly Also, do not return InvalidOperation from flush in order to be able to support running dEQP tests for Vulkan. Bug:angleproject:2346 Change-Id: I12f3bd115034e044fb0fa2d94687321ede4a1e9d Reviewed-on: https://chromium-review.googlesource.com/955889 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 19fa1c6f 2018-03-08T09:47:21 Return an Error from Framebuffer::syncState. This pipes errors up from the Impl to the top level. There are still a few places were error swallowing is needed, because the Framebuffer API doesn't support returning an error. Bug: angleproject:2372 Change-Id: Idc06bda1817fd28075940f69874d8b6ba69194f9 Reviewed-on: https://chromium-review.googlesource.com/954290 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org>
Jamie Madill 66546be2 2018-03-08T09:47:20 Vulkan: Use RenderTargetCache in FramebufferVk. The RenderTargetCache avoids many multiple calls to getRenderTarget, and should speed up the code somewhat on state changes. Also as a side benefit removes a bunch of swallowed ANGLE errors. Bug: angleproject:2372 Change-Id: I072481856aae8607f17a116e25c71acf04b4cc68 Reviewed-on: https://chromium-review.googlesource.com/948785 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 5242d5bf 2018-02-15T07:14:35 Vulkan: Implement scissored clears. Bug: angleproject:2356 Change-Id: I33888f9b4ebaf4b0b5af4ad59b12ad963325a790 Reviewed-on: https://chromium-review.googlesource.com/921882 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill e4c5a23b 2018-03-02T21:00:31 Vulkan: Always use LOAD for RenderPass attachments. The RenderPass load/store ops allow us to specify how we want to use the data from the attachments. Previously we had the load op set to CLEAR always, which would prevent us from doing multiple kinds of operation. Using LOAD should conversatively work in any situation as long as we can ensure each Image is cleared before we use it. To this effect this patch also inserts a preliminary clear into each Texture or Renderbuffer Image's initialization. We already had this for Surfaces. In the future we'll improve this by inserting proper load/store ops, but this unblocks a lot more functionality in the interim. Bug: angleproject:2361 Change-Id: I7610eaa39d81b23dd74b4a24b7f28a66a6dfffc6 Reviewed-on: https://chromium-review.googlesource.com/948782 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>
Jamie Madill f4d693c0 2018-02-14T16:38:16 Vulkan: Cache clear color in ContextVk. This makes the current clear color a bit more accessible than using the current GL state clear color directly. It is stored in the Context using the Vulkan clear color struct. This also cleans up the attachment clear values in FramebufferVk and paves the way for depth/stencil clear when support for depth/stencil exists. Bug: angleproject:2357 Change-Id: I0553e4447249325115625a44e9f4b1623c7cb0bc Reviewed-on: https://chromium-review.googlesource.com/919550 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 57dd97aa 2018-02-06T17:10:49 Vulkan: Add helper for allocating image memory. Also refactors some memory index searching code that was duplicated. This will lead the way to having more code reuse for our Renderbuffers implementation in Vulkan, and for other types of Texture. Bug: angleproject:2347 Change-Id: I49cbd77328c01f945d66f92e6ec4ba7c552abeff Reviewed-on: https://chromium-review.googlesource.com/904684 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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 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 47c8ea3f 2018-01-03T18:27:59 Vulkan: Fix looped clears. These were broken by command re-ordering. The first problem was that the Framebuffer RenderNode was not correctly being flagged as dirty. This is fixed by keeping a serial instead of a bool to track the RenderNode's cleanliness. The second issue was that an image layout transition was being set with incorrect bits. Fix this by using the correct access mask. This fixes angle_perftests's Vulkan render test. Bug: angleproject:2264 Bug: chromium:798866 Change-Id: I268b0f7aeb2c5e22892f6ef59dec62391b30bfb4 Reviewed-on: https://chromium-review.googlesource.com/848539 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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 bef918cb 2017-12-13T13:11:30 Vulkan: Add packed RenderPass descriptions. This change is two-fold: it splits the compatible parts from the RenderPass description, which allows for correct caching. It also will allow the pipeline state cache to cache the compatible RenderPass bits. In order to do this we introduce a packed version of the RenderPass description, which uses carefully aligned bit representations so we can hash the descriptions easily using MurmurHash, and compare them with memcmp. Bug: angleproject:2163 Change-Id: I4179c0ff8762df81f29082168bd6e3056ceb1318 Reviewed-on: https://chromium-review.googlesource.com/815816 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 9f2a8613 2017-11-30T12:43:09 Vulkan: Implement a RenderPass cache. This cache replaces the RenderPass-per-Framebuffer approach. Although the concepts of a RenderPass are closely associated with rendering to a Framebuffer, there can be multiple RenderPasses used with a single FBO, especially considering the nature of Load and Store operations. This code will then lend itself to the implementation of the deferred RenderPasses, which are created on flush. These RenderPasses won't be owned by a Framebuffer. Bug: angleproject:2264 Change-Id: I4dce07c302118f7e05f5225e2a3b0569ad1e52bf Reviewed-on: https://chromium-review.googlesource.com/789534 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e218f15f 2017-11-30T12:38:50 Vulkan: Remove std::vector arg from beginRenderPass. We don't want to force the RenderPass code to use std::vector when we are working with static data. Change it to take a pointer. Bug: angleproject:2264 Change-Id: I07a077719fb9b4abc33a0cfcccc178d0544b7f06 Reviewed-on: https://chromium-review.googlesource.com/789535 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 0b684ce3 2017-11-23T12:57:39 Vulkan: Move RenderPass init into a helper function. Here it can be more easily accessed for command re-ordering, which will use a RenderPass cache instead of having RenderPasses be owned by the Framebuffer. Bug: angleproject:2264 Change-Id: I9b06cff43e536a526d44e7e0c04027bc450051cf Reviewed-on: https://chromium-review.googlesource.com/789533 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7f738d4e 2017-11-20T17:06:27 Vulkan: Refactor CommandBuffer helper class. This makes the base vk::CommandBuffer class as close to the Vulkan API as possible. It moves the extra functionality and state tracking to a CommandBufferAndState helper class. Also no longer stores a reference to a CommandPool in a CommandBuffer. Eventually we won't need to free CommandBuffers explicitly, since they can be freed en-masse by deallocating the CommandPool on a flush. Bug: angleproject:2200 Change-Id: I5095fe89e8da935ff8273b1a402ccfd6a3ffe0df Reviewed-on: https://chromium-review.googlesource.com/778184 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d33c77c0 2017-11-09T13:08:30 Vulkan: Use correct transfer access mask in layout change. When using a transfer destination, we should be using the transfer access mask, not bottom of pipe or other bits. Uncovered by using a newer version of the layers SDK. BUG=angleproject:2237 Change-Id: I3ebcca707ac8889d2ece099e3765f5b0ca3dfdbc Reviewed-on: https://chromium-review.googlesource.com/760636 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 336129f6 2017-10-17T15:55:40 Use a packed enum for buffer targets. BUG=angleproject:2169 Change-Id: I4e08973d0e16404b7b8ee2f119e29ac502e28669 Reviewed-on: https://chromium-review.googlesource.com/723865 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez cda6af19 2017-10-30T19:20:37 Split pixelBuffer from pack/unpack state This will refactor will help use packed enums for buffer targets. BUG=angleproject:2169 Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c Reviewed-on: https://chromium-review.googlesource.com/745181 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 1d7be50a 2017-10-29T18:06:50 Vulkan: Upgrade RGB8 textures to RGBA8. It's unlikely any real hardware supports this format. Hack in a fixed fallback format for RGB8. We could consider implementing conditional support by checking the VkPhysicalDevice properties. This extends the Vulkan format support info in the RendererVk class to distinguish between a Buffer and Texture format. This is closely related to how Vulkan has separate format support bits for Linear Textures, Optimal Textures, and Buffers. We probably won't need to keep separate caps for Linear/Optimal, but it makes sense for Buffers to eventually use the same format tables. BUG=angleproject:2207 Change-Id: I8d427a99db15b314b13dd99f31aa1ac5055f0881 Reviewed-on: https://chromium-review.googlesource.com/742376 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill e1f3ad4d 2017-10-28T23:00:42 Vulkan: Add vk::GetImpl helper. Using reflection helpers, we can avoid having to pass the return type to the GetImpl method. BUG=angleproject:2200 Change-Id: Id160fbdf0ea8b3de2f219d3cc92394c678189a48 Reviewed-on: https://chromium-review.googlesource.com/742371 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 7bd16666 2017-10-28T19:40:50 Vulkan: Allow in-flight Framebuffer changes. This allows the app to alter Framebuffer attachments while there are existing command buffers using the resources and attachments. BUG=angleproject:2200 Change-Id: I3298dafef5e3bd2c6efda8e8a32a6cf7febc13dc Reviewed-on: https://chromium-review.googlesource.com/742370 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 526543cb 2017-10-28T10:59:16 Vulkan: Fix deleting in-use Framebuffer. BUG=angleproject:2200 Change-Id: I13d661b690a6a9e67b3e8a27f9d7bd4126dca87f Reviewed-on: https://chromium-review.googlesource.com/742749 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 1b038241 2017-11-01T15:14:36 Vulkan: Support Texture redefinition. Because initializing the texture can queue a copy from a staging vk::Image, we must ensure we're not in a render pass. To make this easier we move the current render pass tracking into the RendererVk from the FramebufferVk class. (Note: in the future we will have deferred command submission and this will become unnecessary.) BUG=angleproject:2200 Change-Id: Ide8d4d70b50efbd79bbfa7006ad75cbc57cdf4c7 Reviewed-on: https://chromium-review.googlesource.com/741549 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 25301b60 2017-10-28T20:59:31 Remove WrappedObject::retain. With resources being mostly deleted by the Renderer along with a serial number, the retain move semantics weren't very useful. Refactoring change only. BUG=angleproject:2200 Change-Id: I7b72b1decfa7604cdd767e7d9b5213b9383eb240 Reviewed-on: https://chromium-review.googlesource.com/742369 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e88ec8ee 2017-10-31T17:18:14 Vulkan: Refactor GarbageObject. Instead of allocating a small bundle for deferred deletion, store a small triple of {Serial,VkHandle,HandleType}. The HandleType can be used in a generic way to release the VkHandle, without needing to store a pointer and use a virtual call. BUG=angleproject:2200 Change-Id: I30925c2f50fd11dafb1b986ced7d279a7dde827b Reviewed-on: https://chromium-review.googlesource.com/741163 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill b79e7bb6 2017-10-24T13:55:50 Vulkan: Implement simple render-to-texture. This was mostly working already, just needed to set up a few entry points. BUG=angleproject:2200 Change-Id: I9c13d6d4dd42f23c69a58e42e07e3e28877671a1 Reviewed-on: https://chromium-review.googlesource.com/734237 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 815a6c9a 2017-10-21T14:33:04 Vulkan: Fix copyImage region parameters. In cases where we were reading back more than one pixel in ReadPixels, and in some cases for texture init, we weren't using the correct parameters to vkCmdCopyImage. This CL fixes both of those by using more correct copy regions, and fixing the row and depth pitch computation using vkGetImageSubresourceLayout. BUG=angleproject:2167 Change-Id: Ib70217ed4a17be6b4b1b8aeec9a8a6199d210d88 Reviewed-on: https://chromium-review.googlesource.com/732190 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kenneth Russell ce8602ab 2017-10-03T18:23:08 WebGL requires GL_FRAMEBUFFER_UNSUPPORTED for identical FBO attachments. If the same level of a texture is attached to multiple color attachments of a framebuffer object, for example, the WebGL conformance tests require generating a GL_FRAMEBUFFER_UNSUPPORTED error. The Direct3D backend already had this restriction; apply it to all backends when the WebGL compatibility extension is enabled. Fixes the following WebGL conformance tests with the pass-through command decoder in Chrome: conformance/extensions/webgl-draw-buffers-framebuffer-unsupported conformance2/rendering/framebuffer-unsupported BUG=angleproject:2168 Change-Id: I340d06ca0ee969989c6c5725512b1b9542281477 Reviewed-on: https://chromium-review.googlesource.com/699856 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 035fd6b3 2017-10-03T15:43:22 Vulkan: Implement very basic textures. This is a quick implementation which supports only one backing Image and one type of ImageView at a time, for 2D texture only. It also implements a helper class for finding compatible memory pools. It's possible we can keep a cache of memory pool indexes given the guarantees the Vulkan spec has on compatible memory types (see the documentation for VkMemoryRequirements). BUG=angleproject:2167 Change-Id: I1d7a8eaec90f240273ad75194e23430d6d4c5dc1 Reviewed-on: https://chromium-review.googlesource.com/680000 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill d4826159 2017-09-21T11:18:59 Vulkan: Only init RenderPass once per frame. This saves some time spent in the driver, by making multiple draw calls happen inside a single RenderPass. This also makes the ReadPixels impl method non-const. I think in the future we should avoid making const Impl methods unless they're totally trivial. BUG=angleproject:1898 Change-Id: I39172270a2f7dc5c1c2e3d4cc50af3bac8a29fa1 Reviewed-on: https://chromium-review.googlesource.com/672148 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 71c88b31 2017-09-14T22:20:29 Enable [[nodiscard]] for gl::Error. This forces all return values to be checked for gl::Error. Requires quite a bit of minor refactoring. I also added a macro to swallow an error without returning from a function. We could look at storing the errors in the Context at some point, since almost always when we're generating errors that we need to discard we have access to the Context as a parameter. BUG=angleproject:2150 Change-Id: I457e48a30c002eda0993acbcd3180ba87bf169fb Reviewed-on: https://chromium-review.googlesource.com/665173 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov c4d18aac 2017-03-09T18:45:02 Use ErrorStream everywhere Eliminates one more usage of FormatString and its static initializer. Add more ErrorStream types and replace gl::Error and egl::Error with them. BUG=angleproject:1644 Change-Id: Ib498d0ae4b81a332ec71aed7cf709993b154e6bb Reviewed-on: https://chromium-review.googlesource.com/505429 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c564c070 2017-06-01T12:45:42 Pass gl::Context to impl methods instead of ContextImpl. In some cases we might have to call back into the GL layer, passing the Context, and if we just have a ContextImpl pointer this isn't possible. It also removes the need for SafeGetImpl. BUG=angleproject:2044 Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6 Reviewed-on: https://chromium-review.googlesource.com/516835 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 231c7f56 2017-04-26T13:45:37 Apply clang-format to many files. This cleans up the formatting in many places. BUG=None Change-Id: I6c6652ebc042f1f0ffecced53582d09d66b4f384 Reviewed-on: https://chromium-review.googlesource.com/487884 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 876429b7 2017-04-20T15:46:24 Update gl2.h and update entry points. Some method signatures were updated. Types like GLclampf and GLvoid were replaced with other equivalents. BUG=angleproject:1309 Change-Id: I05e8e2072c5a063d87ad96a855b907424661e680 Reviewed-on: https://chromium-review.googlesource.com/475011 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang ca27139e 2017-04-05T12:30:00 Key the format tables on internal format and type. Keying the format tables on internal format alone is not enough to fully validate the unsized formats which require additional type information. This CL has no functional changes, it just splits the tables and updates the calls to GetInternalFormat info to provide type information when the format is not sized. BUG=angleproject:1523 BUG=angleproject:1958 BUG=angleproject:1228 Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7 Reviewed-on: https://chromium-review.googlesource.com/468449 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0c0dc345 2017-03-24T14:18:51 Vulkan: Defer command buffer submission. This packs more rendering commands into fewer command buffers. Instead of using a single command buffer per-command, create a buffer and record commands into it until we need to present the frame. More sophisticated management will be necessary in the future when we can do other types of copied and read-back from image data. This also reduces the number of Fences we use for checking if the device is finished with resources. Instead of creating a Fence per-command-buffer, it creates one per-swap. BUG=angleproject:1898 Change-Id: I9c6033bc04289fd8f936c0df914afc51fc434b29 Reviewed-on: https://chromium-review.googlesource.com/445800 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 72106562 2017-03-24T14:18:50 Vulkan: Only re-create pipeline on state change. This speeds up the simple perf test, but it is a very simple optimization that does not have a cache of pipelines or anything sophisticated. BUG=angleproject:1898 Change-Id: Iec126bc73bf28f8bb33662a2f70670588f010d72 Reviewed-on: https://chromium-review.googlesource.com/444850 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dd43e6cd 2017-03-24T14:18:49 Pass Context to VertexArray and Framebuffer syncstate. This will enable more Vulkan-friendly idioms like clearing the vulkan pipeline caches correctly on GL state changes immediately because we have access to the ContextVk. BUG=angleproject:1898 Change-Id: I16c848d8abdde8e26a38d384e565cec8548a66d0 Reviewed-on: https://chromium-review.googlesource.com/459079 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f651c773 2017-02-21T15:03:51 Vulkan: Enable command queueing. This adds the ability for rendering to happen asynchronously. If objects in-use are deleted as they are being accessed, ownership is transferred to the Renderer and they are deleted when not in use. We determine they're ready for delete using a Fence object. BUG=angleproject:1898 Change-Id: I4fcfd90ad0665d127bf01a10214a604f3407d9e4 Reviewed-on: https://chromium-review.googlesource.com/428353 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4c26fc2f 2017-02-24T11:04:10 Vulkan: Initial command queueing implementation. This removes the sychronous operation of the command buffers. It also introduces a serial type for assigning ids to queue operations. This gives us the ability to manage lifetimes of resources and track when they're no longer in use on the device. BUG=angleproject:1898 Change-Id: I91a4836d3098f1d7bd06cd389d88601a3a4826ab Reviewed-on: https://chromium-review.googlesource.com/428352 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 5deea723 2017-02-16T10:44:46 Vulkan: Don't store device handles in wrapped objects. BUG=angleproject:1684 Change-Id: I0ec11ec79f2e9893600a8ffd8cdbfc6040fb6f70 Reviewed-on: https://chromium-review.googlesource.com/426402 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 70ee0f61 2017-02-06T16:04:20 Add destroy handler to SurfaceImpl. This allows the Vulkan back-end to avoid storing a reference to the VkDevice. This will extend to all the Vulkan object handle wrapper types. BUG=angleproject:1684 Change-Id: I3a98e94bc171ca27f225ce57996c3fdf9581e6e1 Reviewed-on: https://chromium-review.googlesource.com/424229 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill df68a6f0 2017-01-13T17:29:53 Vulkan: Implement a simple graphics pipeline. BUG=angleproject:1580 Change-Id: Iceaed896db22dc9eefa3f1bee7d6142fcfb20368 Reviewed-on: https://chromium-review.googlesource.com/412267 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov d73f852f 2017-01-13T17:48:57 Reland "Replace gl::trace logging with Chromium style logging" Removing one usage of FormatString() and its static buffer. And preparation for Platform logging. Fix incorrect enabling of ERR() calls in UNIMPLEMENTED() and UNREACHABLE(), resulting in increased code size and <iostream> adding 5 static initializers to chrome because of cerr referenced in statically linked translator. BUG=angleproject:1660 Change-Id: I7caa18036118d532e0544f75278602559172ae04 Reviewed-on: https://chromium-review.googlesource.com/431457 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill ab9f9c31 2017-01-17T17:47:34 Vulkan: Configure a simple RenderPass for drawing. BUG=angleproject:1319 Change-Id: I0668527a338a2f10ca74b43f2a8bd82534e732c0 Reviewed-on: https://chromium-review.googlesource.com/370805 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
JiangYizhou bddc46b4 2016-12-09T09:50:51 ES31: Implement multisampled Textures. Implement TexStorage2DMultisample and getMultisamplefv entry point. Also modify sample state for Textures and Framebuffers. BUG=angleproject:1590 TEST=angle_unittests TEST=angle_end2end_tests TEST=dEQP-GLES31.functional.texture.multisample.samples_*.sample_position TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_color_2d TEST=dEQP-GLES31.functional.texture.multisample.samples_*.use_texture_depth_2d TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_tex TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_different_sample_count_tex_rbo TEST=dEQP-GLES31.functional.texture.multisample.negative.fbo_attach_non_zero_level TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_high_sample_count TEST=dEQP-GLES31.functional.texture.multisample.negative.texture_zero_sample_count TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_1_texture_2d TEST=dEQP-GLES31.functional.shaders.builtin_functions.texture_size.samples_4_texture_2d Change-Id: I8fa7bd4e73b95745858a3e16b1b92004b4a18712 Reviewed-on: https://chromium-review.googlesource.com/414309 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 7b57b9d7 2017-01-13T09:33:38 Vulkan: Implement basic Clear and ReadPixels. This enables the simple operations clear test on Vulkan. The current implementation is very synchronous - it will block and finish the current command buffer if there is any possibility of a race. BUG=angleproject:1319 Change-Id: If01fe9a19ed6f539639a38786193d3626164cada Reviewed-on: https://chromium-review.googlesource.com/367754 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 9e54b5af 2016-05-25T12:57:39 Add Vulkan stubs. Currently enabled for Windows by default. BUG=angleproject:1319 Change-Id: I87921c579bee466465fb1e3f629bb3a40fdff659 Reviewed-on: https://chromium-review.googlesource.com/328730 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>