src/libANGLE/renderer/vulkan/RenderbufferVk.cpp


Log

Author Commit Date CI Message
Peter Kasting 0d06c3cf 2021-07-26T04:30:39 Fix some instances of -Wunused-but-set-variable. Bug: chromium:1203071 Change-Id: I144165ae5ec47aba88658030a6ba3e371bf31ee7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3053616 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil d2b659f9 2021-03-25T15:40:58 EGL: implement EGL_EXT_protected_content Context Add Validation check to Contexts and Surfaces Add Vulkan protected memory features and properties Add protected member to Surfaces and Contexts Implement hasProtectedContent in Vulkan Add QueueFamily helper, extent DeviceQueueMap Protected Swapchains always on for Android Add EGLProtectedContentTest Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I9352b1e594f71bb4e89cee7137a468940d186b1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800413 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao 92d3912d 2021-04-01T10:49:14 Vulkan: Remove maxLevel and immutable from ImageHelper::initExternal Now that we have removed mBaseLevel and mMaxLevel from ImageHelper class in previous two CLs. The initExternal function can be modified to not pass in base/max level information. This CL also removes immutable from argument and let caller directly pass in firstLevel to it. Bug: b/181800403 Change-Id: I595c1faffabc7582af35a9578b2ecdf00c39207f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2800414 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Charlie Lao b5a71140 2020-08-20T17:24:21 Vulkan: Make storage actually immutable for immutable textures The immutable textures are intended to be "immutable". Right now we are still re-allocating VkImage object based on base_level and max_level. This causes a problem for rendering to a level that is beyond [base_level, max_level], which is totally within OpenGL spec. This CL makes an immutable texture always allocate from 0 to max levels that are specified by a glTexStorage call. Changing base_level will not trigger re-allocation of VkImage object. Bug: b/181800403 Change-Id: I4b4ddea17b7f6f7bfd8f36bfe8bb3a35b5c180b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2368038 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi d1462228 2021-03-09T11:25:36 Vulkan: Use VK_EXT_multisampled_render_to_single_sampled Additionally, makes the emulation path not require independentResolveNone. This was only used to select the NONE resolve mode when the attachment format doesn't have either of depth or stencil aspects, but it's ok to specify the same resolve mode for both aspects even if one aspect is missing. Bug: chromium:1088005 Change-Id: Ifc37cbf5331145179c5927853b996a0d62b871ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2743666 Reviewed-by: David Reveman <reveman@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 4afd0f27 2021-02-17T13:35:57 Vulkan: Add VK_KHR_image_format_list support to initExternal The code for initializing a VkImage with VK_KHR_image_format_list extension support is now internal to initExternal. Also provides a flag to inform callers when VK_KHR_image_format_list support is enabled. Bug: angleproject:5520 Change-Id: Ie2ade93d1403ab3f9cbcf7d80684bbca201d5d8d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2702159 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Mohan Maiya 2b69462e 2021-02-12T15:55:00 Vulkan: Consolidate image format list initialization code HardwareBufferImageSiblingVkAndroid, RenderbufferVk, SurfaceVk and TextureVk all had similar code to initialize VkImage with VK_KHR_image_format_list extension support. Consolidate all of them into a helper. Bug: angleproject:5520 Change-Id: Ib7ac582a35a26c0da15879e688bcaf0c2a92ea87 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2692641 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Shahbaz Youssefi eae262e7 2021-01-27T13:56:49 Vulkan: Fix image layout barriers for tessellation shaders Also fixes a bug where invalid stages may be specified for example if AllGraphicsReadOnly or DepthStencilReadOnly layouts are used and geometry or tessellation shaders are not supported by the implementation. Bug: angleproject:5557 Change-Id: Ia25a6aec8138c67701c63da65783263d8a7bda27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2653911 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 2e9706d8 2021-01-08T17:29:42 Vulkan: Use angle::FormatID instead of VkFormat. This change switches the internal enums we pass around from VkFormat to FormatID. The end goal of the refactor is to allow the Vulkan back-end to store packed tables indexed by FormatID. Because VkFormat has large gaps in its enum space we'd otherwise need to use unordered data structures like unordered_map. The change removes the redundant VkFormat storage from vk::Format and uses a new table query to return the VkFormat that 1:1 matches an angle::FormatID. We also include a reverse mapping for use with native Vulkan get functions for Android. Also moves sRGB conversion functions into renderer_utils. A couple sRGB formats that don't exist in GL are no longer handled by the sRGB conversion functions. These formats should be extremely rare. Bug: angleproject:5438 Change-Id: Id8b49773ca0c556f9f5a6a10fcf0d9762b93bbea Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2618204 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jamie Madill e91097bf 2020-12-29T14:05:56 Vulkan: Clean up "actual"/"intended" naming. Clarifies that the GL internal format is an "intended" format and the Vulkan formats are "actual" formats. This makes all the format fields use the same consistent naming pattern. Bug: angleproject:5438 Change-Id: I935a49895109e9e06eae5ef98d5614dfd1128ff8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2605728 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 56330564 2020-12-10T00:46:04 Vulkan: Support layered framebuffers This feature is introduced by geometry shaders, where all the layers of a texture can be attached to a framebuffer. The geometry shader would use gl_Layer to decide which layer the primitive should be rendered to. Bug: angleproject:3571 Change-Id: Ib2ae8e227b226295f9e2f62f6b230839070bc95c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2582711 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Brandon Schade 777749aa 2020-11-13T09:43:31 Vulkan: Fix image copies with renderbuffers When doing an EXT_copy_image copy, renderbuffers were being recreated due to a mismatch in sample count values. Bug: angleproject:3593 Test: dEQP-GLES31.functional.copy_image.*renderbuffer* Change-Id: Ic6b85ea098ab6382b56520b1ca6b76ac25801b54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2538076 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9e7f08fc 2020-11-06T16:55:51 Vulkan: Fix incorrect reordering of barriers Take the following situation, a simple copy from image to buffer: ANGLE_TRY(contextVk->onBufferTransferWrite(buffer)); ANGLE_TRY(contextVk->onImageTransferRead(aspectFlags, image)); CommandBuffer &commandBuffer = contextVk->getOutsideRenderPassCommandBuffer(); commandBuffer.copyImageToBuffer(imageHandle, layout, bufferHandle, 1, regions); Both `onBufferTransferWrite` and `onImageTransferRead` may flush either the outsideRP or insideRP command buffers. If buffer is not previously used, but image is used: - onBufferTransferWrite: buffer usage is recorded in outsideRP1 - onImageTransferREad: outsiderRP1 is flushed, outsideRP2 is started - copyImageToBuffer: recorded on outsideRP2, but buffer usage not recorded there - A following command that uses the buffer and requires barrier doesn't close outsideRP2 as it believes it was not used there Bug: angleproject:5319 Change-Id: Ib8994083fbc21969a538cda3784adee57b089415 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2523388 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Mohan Maiya a391674c 2020-11-09T16:16:49 Vulkan: Support VK_KHR_image_format_list for RenderBuffers RenderBuffers are now created with VK_KHR_image_format_list extension support enabled. We only enable those tests where the EGL image's source is a RenderBuffer but not those tests where the EGL image's target is a RenderBuffer. There are some corner cases related to glReadPixles that need to be resolved to unblock those tests. Bug: angleproject:3756 Bug: angleproject:5281 Test: ImageTest.SourceRenderbuffer*Vulkan Change-Id: I643a9d74d14473cc7df59fa6e25acab7d1c9aad1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2528475 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mohan Maiya <m.maiya@samsung.com>
Brandon Schade 1e494cae 2020-10-07T19:26:01 Vulkan: Add support for EXT_copy_image Add support for GL_EXT_copy_image which allows image data transfer between image objects. This is implemented by using the vkCmdCopyImage API call. Bug: angleproject:3593 Test: dEQP-GLES31.functional.copy_image.* Change-Id: I30a34a8711b5d2e5834064d7453e03d6ec0df478 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2393955 Commit-Queue: Brandon Schade <b.schade@samsung.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 97843bda 2020-10-30T17:03:36 Vulkan: Fix EGL Surface robust init. The error here was related to using a single cache variable for the robust init setting for all the surfaces in a DisplayVk. Fix this by passing down the robust init setting from the SurfaceVk to image init. Bug: angleproject:5274 Change-Id: I9bc9c20990268d1d5166411fb53f8f2593fd1971 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2510694 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 86ca5d2b 2020-10-01T11:56:05 Vulkan: Add plumbing to render pass when ImageHelper gets deleted ImageHelper object is not refcounted and garbage collected and endRenderPass call is deferred until next render pass starts. This caused a situation that an ImageHelper object gets deleted while still referenced in the open render pass. This CL make sure that we call into all shared context's open renderpass when an image goes away so that they can take appropriate action for this. Bug: b/169618408 Change-Id: I5075e805980084db82ca3e699462272eee5d2d59 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2443571 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Shahbaz Youssefi a76b6836 2020-09-17T22:40:42 Vulkan: Support MSRTT depth/stencil resolve VK_KHR_depth_stencil_resolve is used by this change to resolve depth/stencil multisampled-render-to-texture renderbuffers. This extension is not widely supported yet. If it's not present, the depth/stencil resolve operation is silently ignored and the renderbuffer acts as a normal multisampled one. This is not correct, but our primary user (Chrome), and most applications don't care for the resolved depth/stencil data. In fact, it's recommended for the depth/stencil attachment to be invalidated after rendering. Exposing EXT_multisampled_render_to_texture even in the absence of depth/stencil resolve allows the majority of the applications to still take advantage of MSRTT color attachments. Bug: angleproject:4836 Change-Id: I6ba4187344a0c9330d2c77bdc5e2c6fc5483c299 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2417645 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi f39e0f01 2020-09-07T23:07:37 Vulkan: Use subpass to unresolve render-to-texture attachments GL_EXT_multisampled_render_to_texture allows singlesampled textures to be used with multisampled framebuffers in such a way that the final resolve operation is automatically done. In Vulkan terminology, the render-to-texture GL attachment is used as a Vulkan subpass resolve attachment with an implicit (ideally-)lazy-memory multisampled image as the color attachment. This extension expects that if the texture is drawn to after the automatic resolve, the implicit multisampled image would take its fragment colors from the singlesampled image. In other words, the opposite of a resolve operation should be automatically performed at the start of the render pass. This change refers to this operation as "unresolve". The goal of this extension is to allow tiling GPUs to always keep multisampled data on tile memory and only ever load/store singlesampled data. The latter is achieved by using a subpass resolve attachment and setting storeOp of the multisampled color attachment to DONT_CARE. This change achieves the former by using an initial subpass that uses the resolve attachment as input attachment, draws into the multisampled color attachment and sets loadOp of said attachment to DONT_CARE. Bug: angleproject:4881 Change-Id: I99f410530365963567c77a7d62fc9db1500e5e3e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2397206 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi edc0d2ee 2020-09-15T16:02:05 Vulkan: Disallow loadOp=LOAD for MSRTT depth/stencil textures EXT_multisampled_render_buffer2 specifies that depth/stencil textures are expected to be in a perpetual state of invalidated, except during rendering. This change makes sure that they never use loadOp=LOAD. Additionally fixes a bug where clears applied to MSRTT depth/stencil textures didn't take effect because they were applied to the multisampled image (since the resolved image was not given to the render target). Bug: angleproject:4836 Bug: angleproject:5063 Change-Id: I4506f4de415dca6c222111a1ae62017d2fb1e2b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2412848 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 37457d08 2020-09-15T14:38:53 Vulkan: Support MSRTT color renderbuffers Color renderbuffers are similar to multisampled-render-to-texture textures, but much simpler. The same mechanism is used to implement them. Bug: angleproject:4836 Change-Id: I298529c9fd1b03e78b1e37cdbe595e66166ee130 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2412847 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi d8b037d6 2020-09-15T05:05:14 Change renderbuffer width/height/sample types to GLsizei This matches the types used by GL and stored in the state. setStorage and setStorageMultisampled calls were using size_t instead with a number of unnecessary casts in places which are now removed. Bug: angleproject:4836 Change-Id: Ibb570f0c088a6f29abe10f513de27c30ba4dd098 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2411697 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b3a8f0bc 2020-09-11T15:41:16 Distinguish MSRTT renderbuffers in the front-end glRenderbufferStorageMultisampleEXT has different semantics from glRenderbufferStorageMultisample. This change makes this differentiation in the front-end and passes a flag to the backends. This extension is currently only supported on Vulkan and D3D backends. Support for the former will be done in a follow up. Support for the latter is not planned. Bug: angleproject:4836 Change-Id: I75bc3d7990a4b1ce06264280a386d5e467983b7d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2405396 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi a0d048a4 2020-08-27T12:03:02 Vulkan: Fool-proof usage of GL and VK level indices Using boxed types, this change allows the compiler to catch errors when a level index in one space (e.g. GL) is mistakenly used in another space (e.g. VK). This change uncovered a number of bugs due to such mistakes which are fixed. Mistakes are still possible when the index is explicitly extracted, for example to be given to a Vulkan command, or when it's created, for example when retrieved from gl::ImageIndex::getLevelIndex. Future work can include using gl::LevelIndex in gl::ImageIndex directly to alleviate the latter at least. Bug: angleproject:4880 Change-Id: I6427c68c3bc096f771402f51c8554d8171758aa9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2380232 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill eb85c021 2020-08-05T15:07:15 Vulkan: Refactor Context CommandBuffer query. getOutsideRenderPassCommandBuffer returns the command buffer directly since it's now stateless and cannot throw an error. All the RenderPass begin/end and flushing are done by the dependency functions (buffer/ image read/write). Bug: angleproject:4911 Change-Id: I5e7806be9d0e1b5e358524bd485298d660fac942 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2339544 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 23daea2f 2020-08-06T10:40:00 Vulkan: Rename CommandBuffer get method. This method will no longer end the RenderPass in a following CL. Renaming it in a split CL makes the review diff simple. Bug: angleproject:4911 Change-Id: Id48257884dccb7c86f7de2cc9ca95e651fb68df7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2340788 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill adc250c3 2020-07-31T21:11:05 Vulkan: Refactor ImageViewHelper serials. Instead of storing a dictionary of serials to specific image views we now store a single 32-bit serial combined with subresource info. The serials combined with a subresource info (level/layer) gives a unique identifier for each ImageView in the ImageViewHelper for the descriptor set cache and the Framebuffer cache. Also moves ImageView serial allocation to initialization and release. This means we no longer need to use "getAssign" methods and instead we use a few init methods to ensure the serials stay allocated. Bug: angleproject:4911 Change-Id: Ia6af76ae16b3ff5d4a83974bde05cc704064b079 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2333395 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi dcc56215 2020-07-19T01:12:09 Vulkan: Implement GL_EXT_multisampled_render_to_texture This change allows the use of resolve attachments in the Vulkan backend. GL_EXT_multisampled_render_to_texture is implemented using this feature. The infrastructure for specifying resolve attachments is designed with eventual support for GL_EXT_multisampled_render_to_texture2 in mind as well as optimizations to glBlitFramebuffer() and multisampled backbuffers. Proper support for glRenderbufferStorageMultisampledEXT is still missing from this change. All tests use this for the depth/stencil attachment and don't read back the data. Currently, the depth/stencil attachment is created as a normal multisampled image. Bug: angleproject:4836 Change-Id: I110a7f63312ae61a657b6094adf7d97c92bd5843 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2304170 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Cody Northrop cc846039 2020-07-27T21:05:11 Capture/Replay: Fix GetTexImage on Luminance GetTexImageANGLE and GetRenderbufferImageANGLE use ReadPixels to pull texture data. Luminance is not a renderable format, so it is not supported by ReadPixels. To support this, override Luminance formats to their underlying internal format. Test: angle_end2end_test --gtest_filter="*GetTexImage*" Bug: b/160014453 Bug: angleproject:4058 Change-Id: Id19344c2e2c06386a871338833e35b7747cb966b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2321740 Reviewed-by: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill d657e1d7 2020-04-24T13:13:18 Vulkan: Defer framebuffer clears. This works by storing the deferred clears in the ImageHelper's staging buffers. We apply the deferred clears onto the RenderPass right before we begin to draw. Storing the clears in the ImageHelper solves problems where we clear GL Textures in a Framebuffer and then unbind the Textures and sample from them. Or do other commands like CopyTexImage. Note that because the staging buffer clears only handle full-image clears we need to immediately apply some scissored clears where before we would use the RP. This should be a pretty rare occurrence and it is possible to optimize that in the future. Reduces the RenderPass count in the Manhattan "frame 10" trace from max 22 to max 20. May improve perf slightly on Android or may have effects too small to measure. Should not regress performance. Bug: angleproject:4517 Change-Id: I02150d531022afb903f1058f070937ec6337bd88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2142711 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1fc354fa 2020-04-22T11:49:00 Re-land: "Vulkan: Forward RenderBuffer/Surface dirty messages." Re-land fixes ASSERT on Android GLES. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I91d31213b115a58546b574caa574eebbb098266c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159294 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 623d0443 2020-04-21T15:15:03 Revert "Vulkan: Forward RenderBuffer/Surface dirty messages." This reverts commit 3fb33ade6ec8f286797bff5645304df580b1a963. Reason for revert: Causing WebGL test failures on GLES/ANGLE/Android. Bug: chromium:1072739 Original change's description: > Vulkan: Forward RenderBuffer/Surface dirty messages. > > Previously we were only forwarding Texture staging changes to the > Framebuffer for re-sync. We could miss out on clears that were staged > in Surfaces and Renderbuffer attachments. Complete the chain by making > the SurfaceVk and RenderbufferVk forward notifications from the > VkImage. > > Bug: angleproject:4517 > Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=cnorthrop@google.com,timvp@google.com,jmadill@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:4517 Change-Id: I4fd4d79dc11da0ba86065d3a80975de4c791a2a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2159288 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3fb33ade 2020-04-09T15:27:12 Vulkan: Forward RenderBuffer/Surface dirty messages. Previously we were only forwarding Texture staging changes to the Framebuffer for re-sync. We could miss out on clears that were staged in Surfaces and Renderbuffer attachments. Complete the chain by making the SurfaceVk and RenderbufferVk forward notifications from the VkImage. Bug: angleproject:4517 Change-Id: I15f36c225517e915f656d0c2464a99631ef9f945 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2150699 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2a0c3596 2020-03-31T15:36:45 Vulkan: Clean up robust and emulated image clears. This change consolidates image clears in multiple places into a single site in ImageHelper initialization. It adds support for appending clear image commands as well as prepend (the default). We prepend clears because image initialization happens after data upload. The Vulkan robust clear path now works like the other back-ends. The change flushed out a bug where partially uninitialized CopyTexImage was not correctly initializing a texture before triggering a full resource clear. Texture::copyImage now uses a workaround where we first init the image before clearing it. After the init we upload the new data. We'll use the appending clears path when implementing deferred clears. Bug: angleproject:4517 Change-Id: If9212f3b8cdd0fc8b7e729d364530801a644e164 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2130627 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Xiaoxuan Liu b07816d6 2020-01-02T15:13:37 Vulkan: Add robust init for NULL texture image. In gl::ReadPixels(), ValidateReadPixels() will try to flush staged updates before readPixels. In the case where a texture was initialized with null RGBA data, no Framebuffer dirty bits are set, and thus the staged clear would never be flushed from the staged updates. 1. Add robust init in TextureVk::initImage to ensure image is initialized. Test: ./angle_end2end_tests --gtest_filter=\ RobustResourceInitTest*_Vulkan_AllocateNonZeroMemory 2. Update stageSubresourceRobustClear() to kEmulatedInitColorValue in the case where robust resource was initialized without full RGBA format to update init value of robust resource. Test: texture-attachment-formats.html in webgl_conformance_vulkan_passthrough_tests. 3. Revert "Suppress Vulkan RobustResourceInit tests." Revert commit a8e6a463121b9920564fb6efd7f2c857d7023fe3. Reason for revert: re-enable related robust tests. Bug: angleproject:4255 Change-Id: I79f20e0c02c2f1b1cd68ab590f0f765229f9e780 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1985503 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill aa09ca69 2020-02-24T13:33:30 Vulkan: Update ContextVk command buffer access methods. Use the following names: - flushAndBeginRenderPass - endRenderPassAndGetCommandBuffer - flushAndGetPrimaryCommandBuffer This clarifies that a flush is part of the method. Bug: angleproject:4029 Change-Id: I6c870761339ea7aa39c83142200781ba39ad6a4b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2068129 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill c58458e6 2020-02-19T14:51:41 Vulkan: Remove CommandGraph code. Also updates relevant comments to no longer refer to a graph. Bug: angleproject:4029 Change-Id: Ic29716e9ae4926870f902947d49d8fee7af98662 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2057804 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 0a9c0b7b 2020-02-19T14:55:04 Vulkan: Fix image queue changes with graph disabled. These again weren't being tested on the CQ. Probably necessary for some image sharing scenarios. Bug: angleproject:4029 Change-Id: Iccbebf127e2ec6fdb74dd213998674fff77b75b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2065529 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Ian Elliott c6458072 2019-12-05T11:45:10 Fix multisample renderbuffer compliance (e.g. 3->4 samples) This change ensures that the following spec language is correctly implemented: the resulting value for RENDERBUFFER_SAMPLES is guaranteed to be greater than or equal to samples and no more than the next larger sample count supported by the implementation. For example, if 2, 4, and 8 samples are supported, and if 5 samples are requested, ANGLE should use 8 samples, and return 8 when GL_RENDERBUFFER_SAMPLES is queried. Note: There is a known problem with NVIDIA OpenGL driver that causes another test to be expected to fail. Bug: angleproject:2222 Bug: angleproject:4196 Change-Id: I28921badf9568427799b0af347198b5df06c2aaa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954444 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill bb35bb4e 2019-10-29T17:17:04 Vulkan: Implement simple case ANGLE_get_image. A couple cases are left unimplemented: Incomplete/unused Textures. This leads to a slightly more tricky implementation. Since we need to read back from the staging buffer we will need to flush the Image contents to a temporary buffer. Depth/stencil readback. Requires a more complex pixel packing step. 3D/Cube/2D Array readback. Also requires a more complex packing step. Bug: angleproject:3944 Change-Id: Ic5d9a606177ba7e3e5ab945feb5f555afa11741f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879964 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill dfc20daf 2019-10-28T13:51:42 Plumb more logic for ANGLE_get_image. Also implements and tests validation / negative API. Bug: angleproject:3944 Change-Id: I3385a4255f4fab6a12eee2abfa5ffcce2107359a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879961 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 68591eff 2019-10-13T15:05:23 Vulkan: Store ImageView access in the graph. This will ensure we don't destroy the image views when they are still in use by other Contexts. Bug: angleproject:2464 Change-Id: I1d3ba2ad241250e31ea32873446c4cb23971750d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1843236 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill beacd8c8 2019-10-17T14:34:02 Vulkan: Rename format fields. Renames 'angleFormat' to 'intendedFormat'. Also renames 'bufferFormat' and 'imageFormat' to 'actualImageFormat' and 'actualBufferFormat'. This renaming should make it clearer to the reader what the meaning of the different format fields are. Intended format is the front-end format and the actual formats are the formats we pass to Vulkan. Also updates the documentation. Bug: angleproject:4009 Change-Id: If61bf7250e88f7ed3d452718574c963d718e27b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866077 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a14555a7 2019-10-13T15:05:22 Vulkan: Refactor RenderTargetVk ImageViews. Instead of storing a pointer to an ImageView, store a pointer to an ImageViewHelper. The level and layer index are all that's needed to pull the right image view from the ImageViewHelper. Will make it easier to store ImageView references in the graph to track lifetime. Bug: angleproject:2464 Change-Id: I773fa79a89ceefc99ff70e4eed4985f9f01fe26a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1857549 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 0b9ebe58 2019-10-15T11:15:42 Vulkan: Add "ImageViewHelper". This allows views to track a different lifetime than vk::ImageHelper. This in turn will fix the race condition on ContextVk destruction when releasing ImageViews owned by TextureVk and RenderbufferVk. For now this is a refactoring change only. Bug: angleproject:2464 Change-Id: I9581975bd5d4913233bbed8439dd4a632cc78a2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1843231 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jamie Madill 88bc4d3d 2019-10-04T20:41:24 Vulkan: Get rid of "fetch" level/layer image views. Instead always use 2D array views when rendering to cube maps. We need to keep the "fetch" image view for the main image for emulating seamless cube map textures on GL 2.0. We also use it for some texture copying init. These uses could potentially be replaced with sample instructions if we wanted to remove this last "fetch" view. Bug: angleproject:3975 Change-Id: I90f9be9fc6542d8ec27f6722132c1b27acf72176 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1842226 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill f10bf6bf 2019-09-26T10:27:18 Vulkan: Implement multi-threaded GL. The main component of this change is to make vk::BufferHelper, vk::ImageHelper and vk::SyncHelper use a common path. We introduce a new "vk::SharedGarbage" helper class that stores small lists of garbage from individual objects like an ImageHelper or BufferHelper. The SharedGarbage is stored in the RendererVk with the ResourceUse of the helper object. The ResourceUse tells RendererVk when it is safe to destroy the GarbageObjects. New "onGraphAccess" commands are added in a few places to enable the common garbage collection path. A couple Context-only resources like default attributes now are referenced where they were not before. Also reorganizes some functions so we can add a few helpful ASSERTs to our graph dependencies. Added "updateCurrentAccessNodes" for this. Also adds a "RendererScoped" helper to replace many uses of "ContextScoped". The multithreading EGL tests mostly pass but have some remaining flakiness so cannot yet be enabled. Bug: angleproject:2464 Change-Id: Ia3e3ae8848d731abf3f21ebe04c33e381e130be0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1808444 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Cody Northrop cb16fb5f 2019-08-29T16:53:55 Vulkan: Support texture base and max levels The Vulkan backend uses a vkImage that matches the number of effective levels in the GL texture. This is due to the fact that GL textures can have really strange layouts that only make sense when base level and max level are applied. For instance, take the following layout with disjoint mip levels: Level 0: 4x4 RGBA Level 1: 2x2 RGBA Level 2: 10x10 RGB If base level is set to zero and max level is set to 1, the image is still considered mip-complete: Level 0: 4x4 RGBA ==> Base Level 0 ==> Level 0: 4x4 RGBA Level 1: 2x2 RGBA ==> Max Level 1 ==> Level 1: 2x2 RGBA Level 2: 10x10 RGB If base and max level are then both set to 2, the texture is still considered complete, but of a different size and format: Level 0: 4x4 RGBA Level 1: 2x2 RGBA Level 2: 10x10 RGB ==> Base/Max Level 2 ==> Level 2: 10x10 RGB When the base or max level is changed, we must recreate the vkImage to match the new level count. To support that, we: - Stage updates from the current image to the new image - Only stage updates if there aren't already staged updates for a level - Free the current image and so it can be recreated at the next draw This CL does the following: - Refactors TextureVk::copyImageDataToBuffer to support staging updates without flush - Adds TextureVk::copyImageDataToBufferAndGetData to support previous use model - Adds TextureVk::changeLevels, triggered during syncState, which stages updates and releases the current image. - Updates ImageHelper::flushStagedUpdates to understand base/max levels - Updates TextureVk::ensureImageInitialized and TextureVk::generateMipmap to account for base/max level - Tracks base and max levels in ImageHelper - Adds ImageHelper::stageSubresourceUpdateFromBuffer to support this use case - Adds ImageHelper::isUpdateStaged to determine if changeLevels should propagate data - Makes gl::TextureTypeToTarget available for use outside of ImageIndex - Enables several deqp and end2end tests Bug: angleproject:3148 Test: dEQP-GLES3.functional.texture.mipmap.*base_level* Test: dEQP-GLES3.functional.texture.mipmap.*max_level* Change-Id: I14ca071c9c62eb310dfed7ef9290dc65fc3ff696 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776933 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill b540da89 2019-09-19T14:19:12 Vulkan: Use ResourceUse to track object lifetime. With the new resource tracking scheme the CommandGraph, tracking a "Context serial" aka "current" serial is no longer necessary for CommandGraphResources. Serial tracking has been moved to the shared ResourceUse struct that gets updated on a command submission. Thus we don't need to store the serial as a current separate piece of info in BufferHelper/ImageHelper. Will lead to further redesign for the multi-threading support for Vulkan. Bug: angleproject:2464 Change-Id: I1ae4bcc27fcfb93422b4ab4c9682a458e482f295 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785990 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mingyu Hu 7e44ec26 2019-08-26T15:59:48 GL_EXT_multisampled_render_to_texture extension. Part 1. Adding new parameters for extension without adding any real code change. Since no new code paths were added, we expect all tests to pass as before. Bug: angleproject:980428 Change-Id: I551b46a66f422eabd357fd021e00cf266a991efb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1772377 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
James Darpinian 7e48c9eb 2019-08-06T17:17:19 Add explicit integer casts WebKit uses the -Wshorten-64-to-32 flag which warns on these cases. Bug: 3439 Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill c327370e 2019-07-23T12:54:12 Vulkan: Pass VkExtent3D to TextureHelper::init. Bug: angleproject:3189 Change-Id: I4b95240bb32fbc2b3d0c8f097e0552d0fe23417d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi f2a1c384 2019-05-21T16:32:49 Vulkan: Implement multisampled framebuffers Simultaneously implements ANGLE_framebuffer_multisample and ES3 multisampled framebuffers. Additionally, implements ES3 framebuffer blitting where multisampled framebuffers are involved. Bug: angleproject:3203 Bug: angleproject:3204 Bug: angleproject:3200 Change-Id: I5694a30f71168e807688a9568e3742b81d907918 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1622667 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang ee244c77 2019-05-06T10:30:18 Vulkan: Move command graph and garbage to ContextVk. To support multithreading, contexts should manage their own command graphs and garbage. This allows safe access to vulkan resources such as command pools without thread synchronization. BUG=angleproject:2464 Change-Id: I930149bc9f0793028761ee05ab50b8c0a4dec98a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516515 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi ce9be8c7 2019-05-24T09:35:06 Vulkan: Have a cubemap as 2D-array view handy Previously, only texture copies used a shader that performed texelFetch(). To support cubemaps, a hack was used to temporarily create a 2D array view. With upcoming support for multisample resolve, more shaders will be using texelFetch() all requiring this workaround. This change instead makes sure that a separate view is created for cubemaps for the purpose of being used with these shaders. As a result, we have three logical views on textures and render targets: - Draw: a view that can be used as a color/depth/stencil attachment - Read: a view that can be used to sample from - Fetch: a view that can be used to fetch from The fetch view is generally the same as the read view, except for cube maps. Bug: angleproject:3200 Change-Id: I21547f728c16f0aa8f0fcae152c400b5cc1565da Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1628585 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 6722009e 2019-05-20T11:12:53 Vulkan: Handle dirty RTs with state messages. Prior to this CL we were handling dirty state change notifications by flushing the RT Images just prior to use or just after they were changed. This could lead to a few redundant checks in several places. It also meant we needed an owner pointer from the RT to the parent Image. This pointer would be null for Surfaces and Renderbuffers. This cleans up the image flushing logic to be handled by dirty bit notifications. When an app updates an attached Texture with TexSubImage or related calls it will send a notification to the Framebuffer. The Framebuffer then sets a dirty contents bit that is handled in the implementation. In Vulkan this means flushing the dirty bits. Requires adding a flag to the FramebufferImpl class to determine if we need to syncState before we checkStatus. Adding the option allows us to only call syncState for the GL back-end. Not calling syncState allows the robust resource init operation to happen *before* we syncState. Which in turn allows FramebuffeVk to initialize the VkImages in one go. Added new regression tests for Texture updates. This might not cover all cases. I found it was very hard to trigger some of the resource update staging in TextureVk. Bug: angleproject:3427 Change-Id: Idfa177436ba7fcb9d398f2b67922e085f778f82a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1601552 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 0631e19b 2019-04-18T16:09:12 Vulkan: Rename Vulkan "Texture" format to "Image" Also adds some comments to vk_format_utils.h. Bug: angleproject:3372 Change-Id: I529b9b189e4cdfd400c3c981a47139727d9954ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565062 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 95c0fae6 2019-04-16T22:46:08 Vulkan: Clear surface images if emulated format This was done for renderbuffers but was missing for surfaces. Bug: angleproject:2722 Change-Id: I019805d6ca43eef86d2d46e7c72c1013803f2139 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1570149 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 65d10f3b 2019-03-21T16:30:31 Vulkan: Implement robust resource initialization If a texture or renderbuffer needs to be cleared for robust access or due to having emulated channels, it is immediately cleared. The former relies on a front-end feature that optimizes robust access clears only to levels and layers that are not fully initialized through data upload. Bug: angleproject:2722 Change-Id: Icdab856eb4ffe963f78569b6d80d9ff5cb27ff9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1535056 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 2660b503 2019-03-21T12:08:40 Vulkan: Restore CommandBuffer to namespace vk Moved vk::CommandBuffer and vk::SecondaryCommandBuffer to vk::priv:: and aliased vk::CommandBuffer to one or the other. This allows the rest of the classes to continue seeing vk::CommandBuffer as they used to do. Used a special alias for the primary command buffer that gets submitted (vk::PrimaryCommandBuffer). Bug: angleproject:3136 Change-Id: I61236fd182230991db7395d05e3da3be5e3f45be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1534456 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Tobin Ehlis 134425c7 2019-03-15T17:02:17 Vulkan:Integrate SecondaryCommandBuffers Integrate the custom SecondaryCommandBuffer type into the CommandGraph nodes by adding new ANGLE_USE_CUSTOM_VULKAN_CMD_BUFFERS define that can be set in the BUILD gn args with angle_enable_custom_vulkan_cmd_buffers set to "true." Initially the custom cmd buffers are disabled by default. This adds some support functions to SecondaryCommandBuffer to make the integration easier by matching the wrapped cmd buffer interface: initialize(), end(), valid(). Bug: angleproject:3136 Change-Id: Ib910554583192550757bb8ce89914e3ea8737988 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1526556 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 009696c5 2019-01-31T14:47:07 Vulkan: Support EGL_ANDROID_image_native_buffer on Android. BUG=angleproject:2668 BUG=angleproject:3121 Change-Id: I0dfb2ec0737ebd963b0fadb78cf720a90874f00b Reviewed-on: https://chromium-review.googlesource.com/c/1452264 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang eca36cb5 2019-01-18T14:03:52 Vulkan: Support EGL images sourced from cube maps. Store an image array offset and source texture type in ImageVk to select the correct cube face from the source texture. BUG=angleproject:2668 Change-Id: I03ad25feccb769c906dd28fb573ec342e7816863 Reviewed-on: https://chromium-review.googlesource.com/c/1422542 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 4a298703 2019-01-18T10:49:36 Vulkan: Support creating EGL images from non-zero mipmaps of textures. Store a mip offset in TextureVK to apply to all operations on the ImageHelper. There is no need to store the mip offset in RenderbufferVk because it creates the resource with the mip offset on the call to setStorageEGLImageTarget. Store a mipmap level in the RenderTargetVk object so that clear operations will target the correct mipmap of the image. BUG=angleproject:2668 Change-Id: Ie976e3dd3a8de8135a7fbb8c84bd51eec0dddce8 Reviewed-on: https://chromium-review.googlesource.com/c/1422059 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang fe59f6b5 2019-01-16T09:34:30 Vulkan: Implement EGL Images for 2D and Renderbuffer sources. No support for non-zero mipmaps as sources yet. Suppress dEQP tests due to apparent driver bugs with scissored clears on depth or stencil attachments. BUG=angleproject:2668 Change-Id: Idaa5e70ce9b0c91232fbb989cbf4de1b9134aafb Reviewed-on: https://chromium-review.googlesource.com/c/1415010 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang f3e823db 2019-01-14T12:40:34 Vulkan: Store ImageHelper as a pointer in TextureVk and RenderbufferVk Storing ImageHelper as a pointer allows the storage to be swapped or shared with other objects. BUG=angleproject:2668 Change-Id: I2e51f24737be59ffe9f472e9b0b592774a792cd1 Reviewed-on: https://chromium-review.googlesource.com/c/1409404 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 08f8fa66 2019-01-10T14:25:47 Vulkan: Merge the PixelBuffer logic into ImageHelper. To support EGL images efficiently, the pixel buffer needs to be tightly coupled with the image it will upload data to allowing textures to upload data to EGL images sourced from renderbuffers. The data will be uploaded to the image in the correct order if it comes from multiple sources and the check for pending uploads does not need to traverse EGL image siblings. BUG=angleproject:2668 Change-Id: Iebf59ed1e358ddc76843b8bcfac39b0363f66a3f Reviewed-on: https://chromium-review.googlesource.com/c/1405710 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b5ba549a 2019-01-02T15:19:22 Vulkan: Shader path for texture copy when image is not initialized This change implements staging image/texture copies when the destination image is not yet fully initialized. With this change, CPU readback for glCopyTex[Sub]Image2D and glCopy[Sub]TextureCHROMIUM should happen only if the texture formats don't allow a fragment-shader based copy. Bug: angleproject:2958 Change-Id: I04087e14ea8fb6fbc731598c5493e44651c22c01 Reviewed-on: https://chromium-review.googlesource.com/c/1393909 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 29b49417 2019-01-07T14:03:06 Make copy texture test more extensive By doing the copy multiple times, we exercise both paths where the destination is already initialized and when it's not. This adds tests for all combinations of formats and flags. Bug: angleproject:2958 Change-Id: I56afb44496acd1b4d5a8527f4dbee29afbac9c81 Reviewed-on: https://chromium-review.googlesource.com/c/1398643 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi f83a28a6 2018-12-09T03:48:34 Vulkan: Shader path for framebuffer-to-texture copy Part 1 in a series of changes to perform image copies on the GPU. Bug: angleproject:2958 Change-Id: I6264a880865c4738c0866f2dc71af63425fc4118 Reviewed-on: https://chromium-review.googlesource.com/c/1370724 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 d856ca48 2018-10-31T16:55:12 Vulkan: add clear test for emulated stencil or depth formats S8_UINT and D24_UNORM_X8_UINT are the only formats currently that are single-aspect and are possibly emulated with a packed depth-stencil format if it's not supported. A flag to FeaturesVk has been added as a way to force this behavior for the sake of testing. This test is added to ensure the correct clear algorithm is used for this case. Additionally, this case is detected and the other aspect is forcefully cleared to 0 whenever the original aspect is cleared. Bug: angleproject:2815 Change-Id: Ief3039d66bbf46468213b9e3224f7cc7541c3a2e Reviewed-on: https://chromium-review.googlesource.com/c/1312453 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 3d86e89b 2018-11-02T16:29:44 Vulkan: properly handle 0-width or 0-height framebuffers The test for whether 0-width or 0-height is not given was doing width != 0 || height != 0 which mistakenly used || instead of &&. Bug: angleproject:2910 Change-Id: Iaa41edffcfe1f8553e8fbefb9bc3b12a7f33a5a6 Reviewed-on: https://chromium-review.googlesource.com/c/1316028 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill c2328a15 2018-10-18T15:00:29 Use angle::Result in front-end (Part 4) Handles the gl::Renderbuffer class and its implementation. Bug: angleproject:2491 Change-Id: I3ef718b492dc39ba640c8f68ed80b536f89ff378 Reviewed-on: https://chromium-review.googlesource.com/c/1283309 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
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 e2d2270a 2018-09-19T08:11:48 Vulkan: Merge append/beginWriteResource. The new API is named 'recordCommands'. These two APIs were basically doing the same thing. We don't need to have an understanding of creating a new graph node to know that we want to record some Vulkan commands to a command buffer. The prior design was actually masking a bug where we would allow appending commands to a command graph node that had already started a render pass. Fix this by adding a render pass check to recordCommands. Also removes 'hasStartedWriteResource' since this method wasn't used anywhere. Also renames 'onResourceChanged' to 'finishCurrentCommands'. Bug: angleproject:2828 Change-Id: I00bd5b893fcfc37172b6c1706cb2f5fc57e79f54 Reviewed-on: https://chromium-review.googlesource.com/1235654 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 55e57f96 2018-09-18T11:32:43 Remove some redundant dirty bits notifications. These were already being signaled in the front end. Bug: angleproject:2763 Change-Id: Id78d3d764e80e687c29c08395b59048d314bfbe2 Reviewed-on: https://chromium-review.googlesource.com/1204490 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 3f3b358f 2018-09-14T10:38:44 Vulkan: Fix cube map attachment clears and readpixels. These were both missing the correct layer offset. Cache the layer inside the RenderTargetVk for easy access. Bug: angleproject:2470 Change-Id: I690dbf0702d7ec52f44ba0a9429b6ef0e51baf6b Reviewed-on: https://chromium-review.googlesource.com/1225910 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@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>
Geoff Lang 9e14164d 2018-06-27T11:43:18 VK: Support pbuffer surfaces. TEST=PbufferTest TEST=dEQP-EGL.functional.color_clears.single_context.gles2.rgba8888_pbuffer TEST=dEQP-EGL.functional.color_clears.multi_context.gles2.rgba8888_pbuffer TEST=dEQP-EGL.functional.render.single_context.gles2.rgba8888_pbuffer TEST=dEQP-EGL.functional.render.multi_context.gles2.rgba8888_pbuffer BUG=angleproject:2622 Change-Id: I99f64689c274fbb565b365f4a05b52252528fc38 Reviewed-on: https://chromium-review.googlesource.com/1117030 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c57ee259 2018-05-30T19:53:48 Vulkan: Clean up object releasing APIs. This cleans up the confusing releaseResource/releaseObject pair in the RendererVk class. It also makes getQueueSerial private in ResourceVk but keeps a public isResourceInUse API for external use. Bug: angleproject:2539 Change-Id: I6b4f24db16e36130a85ef03fc2c3b26d8d9e1fba Reviewed-on: https://chromium-review.googlesource.com/1069291 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Luc Ferron c20b950e 2018-05-24T09:30:17 Vulkan: Fix clear of specific mip level was clearing all mip levels Bug: angleproject:2502 Change-Id: Iffa012dce14584318c4dfd3d9b3a304291c9cebf Reviewed-on: https://chromium-review.googlesource.com/1070666 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill bcf467f2 2018-05-23T09:46:00 Vulkan: Encapsulate RenderTargetVk. This makes the members private and adds more functionality. This moves more responsibility out of vk::CommandGraphNode and also makes the RenderPass init in the CommandGraphNode class better encapsulated. Bug: angleproject:2539 Change-Id: Ia16f3f39cf011548c6473805b8b28e284808e856 Reviewed-on: https://chromium-review.googlesource.com/1040279 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 66410530 2018-04-20T12:47:45 Vulkan: Textures mipmaps support Note that generate mipmaps is not yet supported, but uploading mipmaps is. This also enables 64 tests in dEQP gles2 to validate the changes. While trying to enable tests in functional.texture.mipmap.*, I found an issue where the graph ends up in an invalid state and triggers and assert in onReadResource in ContextVk.cpp:188. It seems like an unrelated bug to mip maps, I will investigate to enable these tests separately in a following CL. Bug: angleproject:2479 Change-Id: If51776d8ef3d994bee620d6a1cf982bb51838ff0 Reviewed-on: https://chromium-review.googlesource.com/1022232 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 20fa8d5c 2018-04-15T10:09:32 Vulkan: Implement cube map texture sampling. This changes the TextureVk class to have a queue of staging copies, instead of a single copy at a time. This will allow us to upload multiple sub regions of a texture image at once when we need to resolve the Image at sampling time. Enables the remainder of the texture.format tests, and all non-mipped tests in the texture.size tests. Also updates the expectations with the bug number for mipmap support. Bug: angleproject:2318 Change-Id: Ie55f8f2dc24d7b133ad735e37f0f78937f022b5b Reviewed-on: https://chromium-review.googlesource.com/980775 Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: 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 364a9557 2018-03-29T09:44:51 Vulkan: Implement stencil test support All the fragment_ops.depth and the fragment_ops.depth tests in dEQP are now working, but not the fragment_ops.depth_stencil. Still debugging these separately and will come up with a fix for them in another commit. Bug: angleproject:2443 Change-Id: I84c3a22f612fb6dcf30598434f96c2100fd29f9c Reviewed-on: https://chromium-review.googlesource.com/993654 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill bc54342b 2018-03-30T10:43:19 Vulkan: Make RenderTargetVk use ImageHelper. Bug: angleproject:2318 Change-Id: I9bc4bb7f5bcd3029a31c8570809f253cf5e4b12a Reviewed-on: https://chromium-review.googlesource.com/980773 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill 93edca16 2018-03-30T10:43:18 Vulkan: Add an Image helper class. This class wraps a lot of the common functionality of a vk::Image. It keeps an associated DeviceMemory and ImageView. Eventually we can probably merge this class with RenderTargetVk. We can also use it to implement the same functionality between Renderbuffer and Texture and abstract different storage types, like 2D and Cube. Bug: angleproject:2318 Change-Id: I39239f47b483cfb96290a15b06edd264f7f4bb34 Reviewed-on: https://chromium-review.googlesource.com/980772 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
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 7b21381e 2018-03-06T10:13:13 Vulkan: Support changing in-flight Renderbuffers. Bug: angleproject:2347 Change-Id: I9bb1494a960969bb6e7c8656c27c7c180ddba069 Reviewed-on: https://chromium-review.googlesource.com/922458 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e703c606 2018-02-20T10:21:48 Add gl::RenderbufferState shared state helper. This shared state will be read-only visible in the RenderbufferImpl class. It mirrors existing structs for Textures, Buffers, and other classes. It allows the implementation class to have a read-only view as to the current GL state of an object. This will be useful to the Vulkan back-end, which would like to know the current Renderbuffer state before having to redefine the storage. If the current parameters match, it might not have to redefine the storage at all. The solution involves passing around the gl::RenderbufferState through various factory methods. Also name the Renderbuffer implementation pointer consistently and make it use std::unique_ptr. Bug: angleproject:2347 Change-Id: Ied6e0358e24e74a7fedbe4aea692edee909b5838 Reviewed-on: https://chromium-review.googlesource.com/922457 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0cbfa586 2018-02-15T14:45:41 Vulkan: Implement basic Renderbuffer attachments. Creating an ImageView for color Renderbuffers allows us to render to them in a RenderPass. We will also need additional functionality to support depth/stencil Renderbuffers. Bug: angleproject:2347 Change-Id: I5d4f7d8242ad4fbca38cb08c0cf6b43edca57c8f Reviewed-on: https://chromium-review.googlesource.com/922456 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 57fbfd80 2018-02-14T12:45:34 Vulkan: Pass RendererVk to Allocate helpers. Passing the Renderer pointer instead of the Context pointer makes these methods a bit easier to work with from the "EGL" sections of the code. This is a refactoring-only change to aid the Depth/Stencil implementation. Bug: angleproject:2357 Change-Id: Icbcc72a1daff4edd947a21672744498781cfc064 Reviewed-on: https://chromium-review.googlesource.com/919523 Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 12eb3d74 2018-02-14T12:34:45 Vulkan: Implement basic Renderbuffer creation. Bug: angleproject:2347 Change-Id: I56edfde2dbc020d5c792cc4f107aa4b9d6b71840 Reviewed-on: https://chromium-review.googlesource.com/905895 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 05b35b21 2017-10-03T09:01:44 D3D11: Lazy robust resource init. This patch moves the robust resource init logic to the GL front-end. Instead of initializing texture resources immediately on creation in D3D11, it defers the clear until before a draw call in some cases, or skips the update if we can determine if a texture (or other resource) has been fully initialized. Currently lazy init is only implemented for Textures, Renderbuffers, and Surfaces. Various places where lazy resource init is triggered: * Framebuffer operations (Draw, Blit, CopyTexImage, Clear, ReadPixels) * Texture operations (SubImage, GenerateMipmap, CopyTexImage) Some efficiency gains remain to be implemented, such as when a SubImage call fills the entire object. Similarly for Blit, and a few other operations. In these cases we can skip lazy init as an optimization. Edge cases with EGLImage are mostly untested. BUG=angleproject:2107 Change-Id: I2bf3a69b1eae0d4feeb5b17daca23451f1037be8 Reviewed-on: https://chromium-review.googlesource.com/576058 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill ea84f6ff 2017-09-20T13:20:30 Pass Context to Framebuffer11 dirty callback. This allows us to call StateManager11::invalidateRenderTarget from the Framebuffer11::signal function, which will then trigger state refresh on the next draw call. This requires passing Context through a few more Renderbuffer methods, and reorganizing the RenderTarget signalling so that it doesn't signal dirty in the destructor. Instead they are signaled as they are destroyed in the containing classes. BUG=angleproject:2151 Change-Id: I4cf575e4a01b48275ff78d75bc55b2d1fced591d Reviewed-on: https://chromium-review.googlesource.com/673139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>