src/libANGLE/Texture.cpp


Log

Author Commit Date CI Message
Geoff Lang 92148c2c 2024-06-17T11:13:46 GL: Implement GL_EXT_clear_texture. This extension is useful because it allows clearing textures without changing the framebuffer. Chrome uses this on Android when it's available. Bug: angleproject:347047859 Change-Id: I765d9991c4549b3655446d9f51847d1095792dbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5631810 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 0ac0603e 2024-05-14T00:00:00 Fold nested std::max calls When a maximum of three values is needed, an initializer list with all three values is more readable than two std::max calls. Fixed: angleproject:8695 Change-Id: I073ea1af07b215610c85981eea03f6e73107bce6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5541974 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev b98b2c34 2024-05-14T00:00:00 Minor TextureState::getEnabledLevelCount cleanup The return value of TextureState::getMipmapMaxLevel() is by definition less than or equal to the return value of TextureState::getEffectiveMaxLevel(). Bug: None Change-Id: I5cea291bb786adb698f0c66435ac09b2e40221c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5541970 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi 4d317b52 2024-03-22T15:48:51 Vulkan: Add MSRTSS preferred usage for tex init The image create flag related to multisampled render to single- sampled was used when this feature flag was enabled. However, this could lead to some platforms allocating extra memory for the image, even if the image did not use this feature. In this change, a new feature is added regarding whether to prefer this flag from the start. If disabled, ANGLE will only use this bit for the texture if it is actually bound to an MSRTT framebuffer object (through FramebufferTexture2DMultisampleEXT()). * Added a new feature: preferMSRTSSFlagByDefault * If enabled, the MSRTSS is used for all image inits. * (TextureVk::initImage()) * Otherwise, it will create the image without the flag at first. * Added member to texture frontend to track if the texture has been bound to an MSRTT framebuffer. * mHasBeenBoundToMSRTTFramebuffer * During TextureVk::syncState(), if the image without the MSRTSS bit is bound to an MSRTT framebuffer, it is recreated using the MSRTSS flag. * Checked in respecifyImageStorageIfNecessary(). Bug: b/329911999 Bug: angleproject:8622 Change-Id: I5e7d43e3828ae272441d65b2be35d09b23b68f84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5402978 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Mohan Maiya 21ef298e 2024-03-13T11:06:22 Consider textures without an attached Buffer as incomplete There are apps that perform a draw call using GL_TEXTURE_BUFFER but without binding a valid buffer thus causing a crash. Instead consider them as incomplete textures and fail validation checks. Also, there is no need to explicitly track the buffer associated with an incomplete buffer texture, the owning texture will handle cleanup. Bug: b/328846669 Tests: TextureBufferTestES31.DrawIncomplete* Tests: TextureBufferTestES31.DrawComplete* Change-Id: Id0b68e8048ba582d677e6767272a86761913ea3a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5369639 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Kimmo Kinnunen b8e56d5d 2023-11-20T15:41:44 Fix an assert when overwriting TexImage binding Fix an assert when overwriting a image binding with multiple eglBindTexImage calls on the same texture. Bug: angleproject:8521 Change-Id: Ie7247017fd73c523b889278ec19a09ecf0683692 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5272912 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Kimmo Kinnunen <kkinnunen@apple.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d05c9a5e 2024-01-25T13:01:49 Frontend support for QCOM foveated extensions Add frontend state management to support foveated rendering extensions. Bug: angleproject:8484 Test: Texture2D*Foveation* Change-Id: I0e1be9f11b2d442207674562da760f5bfd7debc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5208091 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Stephen White a950f005 2023-12-06T18:58:35 Move compressed format validation to Vk backend. Add test to call glCompressedTexSubImage3D() from a pixel unpack buffer. This currently fails on OpenGL. Bug: angleproject:8449 Change-Id: I863b602e39a14878af8745ff62b408bdd879bc98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5100348 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Stephen White <senorblanco@chromium.org>
Alexey Knyazev d1cf2d43 2023-10-05T00:00:00 Cleanup sampler completeness validation * Simplyfied control flow in TextureState::computeSamplerCompleteness * Used special rules for all depth and stencil formats instead of the filter support flag * Fixed DEPTH_STENCIL_TEXTURE_MODE affecting completeness of depth-only textures with REF_TO_TEXTURE compare mode * Skipped mipmap validation for multisample 2D array textures Bug: angleproject:2373 Change-Id: I0f9b6e7401fb85433f2ba4873f271055139bb17e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4922392 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d919870f 2023-09-14T16:00:07 Vulkan: Do host image copy without holding the share group lock When an application uploads texture data such as with `glTexSubImage2D`, the share group lock is being hold while the data is being copied. Without VK_EXT_host_image_copy, this is a copy to a staging buffer, which may itself be expensive. With VK_EXT_host_image_copy, the cost of the copy is higher and so the lock would be held for a longer duration. This is particularly harmful to applications that spawn a separate thread for texture uploads (as the main thread is unable to make GL calls). This change moves the actual copy call to the tail of the call after the share group lock has been released. As a result: - The upload thread may be a bit slower, but - The copy does not interfere with the main thread, and - The copy does not interfere with the GPU's rendering work. As a result, games that load content seamlessly during gameplay should experience less stutter during texture uploads. Bug: angleproject:8341 Change-Id: I818c4389d4bf828847578da89414623e4b5e844e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4864290 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jeff Vigil 1bd45c4f 2023-07-17T14:18:53 Add tiling mode for GL_EXT_memory_objects Add set and get TexParameter for pName GL_TEXTURE_TILING_EXT Add test case to VulkanImageTest for import LINEAR memory object Bug: angleproject:8274 Change-Id: I4432093e41f45e3926a27e3dee00d48c0438cae5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4752793 Reviewed-by: Jeff Vigil <j.vigil@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: mohan maiya <m.maiya@samsung.com>
Roman Lavrov ff110417 2023-04-21T15:16:03 Vulkan: Emulate RGB32 uniform texel buffers when unsupported Applies to: GL_RGB32F, GL_RGB32I, GL_RGB32UI When VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT is specified for these formats by the Vulkan driver, behavior is the same as before. When it is not speficied: previously ANGLE wouldn't enable GL_EXT_texture_buffer unless exposeNonConformantExtensionsAndVersions was enabled; now ANGLE always enables it and does the RGB->RGBA conversion (GPU) under the hood and tracks buffer content updates using the paths added for tracking this for Vertex Arrays. Bug: b/278585075 Bug: angleproject:8128 Change-Id: I4605719bf3f51c5a10c1a35ecae767833dcd45d7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4456498 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 80dd54f9 2023-05-17T22:16:59 Vulkan: Enable VK_EXT_image_2d_view_of_3d and set flag Based on a change by Yiwei Zhang <zzyiwei@chromium.org> Enabling the extension was missed from https://chromium-review.googlesource.com/c/angle/angle/+/3648586, and some implementations do rely on the feature enablement (e.g. RADV). This also fixes the VVL violations on satisfied implementations. Additionally, the VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT flag is always set on 3D images when this extension is supported; it is needed for both sampled and storage images, not just storage images. Bug: b/274478146 Change-Id: Ibc210275e2d39ac0c54d1ae4c2451a5402360972 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544762 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Chris Dalton 45f91a8c 2023-05-08T13:11:44 Deinitialize PLS planes when their texture is deleted The spec originally called for PLS planes to be converted to memoryless when their texture was deleted, but this is not compatible with WebGL, which does not support memoryless planes. Change the behavior to deinitialize them instead. This change requires the addition of a new observer message, angle::SubjectMessage::TextureIDDeleted, which PLS uses to deinitialize a plane when the app deletes its texture. Bug: chromium:1421437 Change-Id: I58fd91003747160f0a1abc1a8a7a87668890ba1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4518565 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Vikas Soni b5fa8728 2023-04-20T14:59:28 Add extension to skip texture renderability validation in ANGLE. Add a new extension to skip the texture renderability validation in ANGLE. Bug: angleproject:0000 Change-Id: Ia9e5a1eff233f5aced4706b7d3c183058d474c41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4455549 Auto-Submit: vikas soni <vikassoni@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: vikas soni <vikassoni@chromium.org>
Alexey Knyazev 397f89dc 2023-03-01T00:00:00 Support stencil texturing in WebGL Updated WebGL sampler format validation to support sampling from stencil textures and combined depth/stencil textures in stencil mode. Bug: angleproject:3231 Bug: angleproject:8051 Change-Id: Ib35dfd91f7ce77fc50bd749f49602ffe86837c67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4315864 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Charlie Lao b19d17b8 2022-12-09T14:38:08 Vulkan: Split Serial class into UniqueSerial and Serial This CL splits Serial class into two classes: UniqueSerial and Serial. UniqueSerial supports the object unique serial usage where there is == and != operator but no > or < comparison. UniqueSerial can have invalid value, but Serial will not have invalid value (in next CL). The main reason is for next CL we can further optimize out the invalid value check in the QueueSerial comparison. Bug: b/262047600 Change-Id: Ieaed2a0d5546b012a6d63aa18b6006595e4aee1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4093557 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi 2f1f9500 2022-09-14T15:52:11 GLES1: Fix behavior with incomplete mipmap textures GLES1 requires texturing to be disabled when a mipmap-enabled texture is incomplete. Bug: angleproject:3408 Change-Id: I2c3b0206282a71f9a54d77ecdf2c7e42c7175fe5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3896212 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski fb3e2def 2022-05-24T15:47:01 Extend labelObject functionality Modify interface to fully support labelObject return codes. Fix issues with texture implementation, including handling deferred Vulkan object creation. Bug: b/229105865 Change-Id: I0c64b72dd0b54642fb643ee7f5ccbb2a134c6787 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3703184 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Cody Northrop 1ae9756e 2022-06-22T17:43:15 Textures: Centralize texture format emulation check Refactor in order to use the check in multiple places. Bug: b/236478448 Change-Id: I6df2e0d63c60fa3e8b2d65185fce164be0e7d961 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3719160 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gert Wollny 39df42d3 2022-06-13T19:25:42 Vulkan: set storage external memory before the description This is a partial revert of 86d9d66dce02f5ae27ca71a94fcdc485bcd7a3ad. "Vulkan: Determined sized-ness of format in initImageViews." When the image descriptions are set, then we already need the storage information, otherwise the Vulkan validation layer may complain, and the replay part of some Capture/Replay tests will fail. Bug: angleproject:7428 Change-Id: I40c70918a439939d3dcbb4aad703fd05eb8104c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3702357 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mark Lobodzinski 7fb021b0 2022-05-12T16:19:14 Reland "Add Vulkan backend support for texture labels" This is a reland of commit 1afb80587e302e2ce9a901a69fd66e5ef98a73b6 Added check to ensure vkSetDebugUtilsObjectName fcn ptr is valid before use. Fixes failures on mac-swangle-chromium-try-x64. Original change's description: > Add Vulkan backend support for texture labels > > Add onLableUpdate support for textures in the Vulkan backend. > > Bug: b/229105865 > Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Ian Elliott <ianelliott@google.com> Bug: b/229105865 Change-Id: I994da6db2771671c204e4ab01c69912c1be4a48f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3674296 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Charlie Lao 2fec519f 2022-06-02T15:17:28 Avoid dirty texture swizzle state when there is no change Some applications (for example surfaceflinger on Android) may set texture swizzle at every call even though there is no actual swizzle change. But we are not checking against redundant state calls and is always setting texture's DIRTY_BIT_SWIZZLE_* bits. This caused vulkan backend free image views which in turn forces VkFramebuffer recreation. This CL check the swizzle state and only set dirty bits if it actually changes. Bug: b/234602034 Change-Id: I7fab96a957c0b7a7ed318eaccea2d42146ca23cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3688732 Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Kai Ninomiya 7ad48b84 2022-05-26T00:23:35 Revert "Add Vulkan backend support for texture labels" This reverts commit 1afb80587e302e2ce9a901a69fd66e5ef98a73b6. Reason for revert: Null-dereference crash starting here: https://ci.chromium.org/ui/p/chromium/builders/ci/mac-swangle-chromium-x64/26323/blamelist (see angle blamelist) Crash reason: EXC_BAD_ACCESS / KERN_INVALID_ADDRESS Crash address: 0x0 Process uptime: 24 seconds Thread 0 (crashed) 0 0x0 rax = 0x0000011c0113c000 rdx = 0x0000011c09094590 rcx = 0x0000000000000006 rbx = 0x0000011c0e2a0000 rsi = 0x00007ffedfc11500 rdi = 0x0000011c01378010 rbp = 0x00007ffedfc11540 rsp = 0x00007ffedfc114f8 r8 = 0x0000000000000006 r9 = 0x0000000123a6ccc4 r10 = 0x0000011c011018d0 r11 = 0x00007ffdbc1a4834 r12 = 0x0000000000000006 r13 = 0x0000011c090944b0 r14 = 0x0000011c0e34c000 r15 = 0x00007ffedfc11550 rip = 0x0000000000000000 Found by: given as instruction pointer in context 1 libGLESv2.dylib!gl::Context::objectLabel(unsigned int, unsigned int, int, char const*) + 0x156 rbp = 0x00007ffedfc116a0 rsp = 0x00007ffedfc11550 rip = 0x00000001357b38e6 Found by: previous frame's frame pointer 2 libGLESv2.dylib!_GL_ObjectLabelKHR + 0xa5 rbp = 0x00007ffedfc116f0 rsp = 0x00007ffedfc116b0 rip = 0x000000013578e7e5 Found by: previous frame's frame pointer 3 Chromium Framework!gpu::gles2::GLES2DecoderPassthroughImpl::DoBindTexture(unsigned int, unsigned int) + 0x1ea rbp = 0x00007ffedfc11780 rsp = 0x00007ffedfc11700 rip = 0x000000011e7dcd4a Found by: previous frame's frame pointer Original change's description: > Add Vulkan backend support for texture labels > > Add onLableUpdate support for textures in the Vulkan backend. > > Bug: b/229105865 > Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Ian Elliott <ianelliott@google.com> Bug: b/229105865 Change-Id: I5a5e00084e1320a486c43fec9d41b9ae6cb2b1db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3669657 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Mark Lobodzinski 1afb8058 2022-05-12T16:19:14 Add Vulkan backend support for texture labels Add onLableUpdate support for textures in the Vulkan backend. Bug: b/229105865 Change-Id: Id9e5b2b81352e97b7843a63f27709739005dc2f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3645854 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Mohan Maiya 2fdd7bfd 2022-05-17T13:31:58 Vulkan: Support binding 2D slice of a 3D texture to an image unit Support binding a 3d texture as a 2d texture by specifying that it is non-layered during glBindImageTexture and expose support for EGL_KHR_gl_texture_3D_image when VK_EXT_image_2d_view_of_3d vulkan extension is supported. Tests: ComputeShaderTest.BindImageTexture3D dEQP-GLES31.functional.image_load_store.3d.*single_layer Bug: angleproject:7320 Change-Id: Ie2f0dfcdf302a4aa58990f74329ca36e62cd3902 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3648586 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Charlie Lao ff011779 2022-05-13T12:36:24 Vulkan: Let texture buffer handle BufferVk's storage change When buffer's storage changed due to glBufferData call, texture buffer code should also respond to this and update the texture descriptor set. This CL merges BufferVkStorageChanged message into InternalMemoryAllocationChanged and removed BufferVkStorageChanged all together. Bug: angleproject:7283 Change-Id: I230ee7268634e747d06eab1954f5a76ecf84c9d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3646955 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 86d9d66d 2022-05-04T12:21:32 Vulkan: Determined sized-ness of format in initImageViews. Bug: angleproject:7269 Change-Id: I1f1f58a0079c8ead28cc2bf7f9aa91cd3f9dc7bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3628019 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Jamie Madill 77cd0b5a 2022-04-14T13:32:07 Re-land: "Vulkan: Cache ImageView serials on texture changes." Re-land fixes BindTexImage serial caching. This significantly reduces overhead when changing textures before draw calls in the Vulkan back-end. Bug: angleproject:6776 Change-Id: I2cc03cb8a70e8c181f7658ab45df780e412bfc57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3623860 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2dd13ebb 2022-04-21T11:25:00 Track Surface color & depth/stencil init separately. This clears up some trace testing confusion due when robust resource init is enabled, and the app clears color but not depth on the default surface. Bug: angleproject:7221 Change-Id: Id97871aec32ad831b663aaa9116e04b582ab5a36 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3600375 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Sunny Sachanandani d4cbd9bf 2022-04-11T16:55:39 vulkan: Mark external memory textures as preinitialized Textures initialized from external memory objects should be considered preinitialized so that they're not cleared on first access with robust resource init. This is essential for Vulkan-GL (WebGPU-WebGL) interop on Linux where Skia or Dawn could be first used to render into a VkImage backed by an external memory object, and a GL texture is created lazily on first GL access. This CL also includes an end-to-end test for such interop, and changes to support that test: 1) Add writePixels() to VulkanHelper to upload pixels to a VkImage 2) Detect external memory / semaphore extensions when VulkanHelper is initialized from ANGLE. 3) Allow importing external memory object that's larger than VkImage size requirements. Bug: angleproject:7188 Change-Id: I60c250b64df1766a179edd1cc67c3f0765e8aa0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3582954 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Mohan Maiya 078da78f 2022-03-17T13:06:58 Vulkan: Support GL_EXT_EGL_image_storage extension This extension provides a mechanism for creating texture objects that are both EGLImage targets and immutable and removes the possibility of implicit orphaning. EGL images created from external sources now support types other than 2D. Tests covering the new feature were added to ImageTest.cpp. Bug: angleproject:6346 Change-Id: Id3e328f352deb1af47062be232384229a8b1c341 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530489 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Yuxin Hu 1dc9f126 2022-03-16T19:29:26 Revert "Flush the texture staged updates when destroying context share group" This reverts commit 5c29d795d1625f71ac6999f157b6f3bba79d5256. Reason for revert: this is causing some test failures on chromium and blocking the angle-chromium auto roller job: https://chromium-review.googlesource.com/c/chromium/src/+/3529771/ Original change's description: > Flush the texture staged updates when destroying context share group > > If we are using the extension EGL_ANGLE_display_texture_share_group, > flush the texture staged updates upon destroying the context. With the > extension enabled, the texture could still be alive when both context > and its' EGL::ShareGroup are destroyed. If we have staged updates not > yet flushed, the updates will keep the ShareGroupVk bufferpool occupied, > causing an error upon ShareGroupVk::onDestroy(). > > Bug: chromium:1299211 > Change-Id: I260de93c3a3099e023e31acbe017803e824459ad > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3495879 > Reviewed-by: Charlie Lao <cclao@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Yuxin Hu <yuxinhu@google.com> Bug: chromium:1299211 Change-Id: I214161d6a8aec834e1efc5fc9d2479e62e3bfae0 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3530505 Auto-Submit: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuxin Hu 5c29d795 2022-02-28T23:56:46 Flush the texture staged updates when destroying context share group If we are using the extension EGL_ANGLE_display_texture_share_group, flush the texture staged updates upon destroying the context. With the extension enabled, the texture could still be alive when both context and its' EGL::ShareGroup are destroyed. If we have staged updates not yet flushed, the updates will keep the ShareGroupVk bufferpool occupied, causing an error upon ShareGroupVk::onDestroy(). Bug: chromium:1299211 Change-Id: I260de93c3a3099e023e31acbe017803e824459ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3495879 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Jamie Madill ea70300b 2022-03-01T14:55:00 Fix base level changes not updating FBO completeness check. Bug: chromium:1299264 Change-Id: I0881a4916c3eeb9ee023d28d207795899417d530 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3498282 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Auto-Submit: Jamie Madill <jmadill@chromium.org>
Mohan Maiya d4c8209b 2022-01-10T13:30:06 Fix validation of copyImageSubData related to texture completeness Fixed an edge case in validation code where we were not properly ignoring format rules for texture completeness as required for copyImageSubData by the ES 3.2 specification Bug: angleproject:5363 Tests: KHR-GLES32.core.copy_image.r32*_texture Change-Id: Ibf8a6f4708e2135f0eb6f4ba58d4ce413f11ce5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3379224 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Amirali Abdolrashidi 89e11878 2021-12-06T09:42:46 Vulkan: Fix the UAF issue with BufferData * Fixed the use-after-free issue with stale buffer handles after calling BeginTransformFeedback. * Added an observer for TransformFeedbackVk to update the buffer handles when buffer's storage is changed and the buffer update type is StorageRedefined. * Added a function to TransformFeedbackVk::onDestroy() to release the counter buffers in order to avoid crash due to TransformFeedbackVk::end() not being called, e.g., as a result of no glEndTransformFeedback() calls. Bug: chromium:1274316 Change-Id: I8ed477f36e6ff89dd4764bb59af564c69efe33e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3321789 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Geoff Lang 5c6998e4 2021-03-30T09:33:55 Mark objects as initialized when robust init is disabled. If a context with robust resource init disabled allocates a texture, make sure it's marked as initialized or else the texture may be reinitialized later by a context with robust resource init enabled. Bug: chromium:1192632 Change-Id: I643f616c89420312f341b53cedbd1a4e4dc58675 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2794621 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org>
Shahbaz Youssefi 6fe13477 2021-11-11T00:47:14 Vulkan: Add external's pNext to ANGLE_external_objects_flags ANGLE was chaining VkImageFormatListCreateInfoKHR to VkImageCreateInfo::pNext to support sRGB extensions. For external images, it was unknown whether that was valid because there was no way to know if external used an identical chain of pNexts. This was causing a discrepancy between images created by Chrome and those created by ANGLE as part of an import. This change updates ANGLE_external_objects_flags to take in the pNext chain external has used to create the image so ANGLE could create the image identically. Bug: chromium:1266094 Change-Id: I479b9e7ff39d437425dc91c79834880749766f99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3274177 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang a8000240 2021-10-05T13:12:22 Don't release EGLImage refs until backends are respecified orphanImages is called before impl methods to respecify textures and renderbuffers. This can cause the backend objects to reference deleted images. TextureVk::handleImmutableSamplerTransition is one such function that is called using "previousImage". Fix this by having orphanImages return a RAII object that deletes the image when the caller chooses. In this case, after the impl methods have been called to respecify the backend data. Bug: b/194432407 Change-Id: Ifb265b4409ba43478731a1701e2409f089976b1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3206430 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill cebca7c2 2021-09-24T07:55:38 Texture: Ignore buffer contents changed events. Texture doesn't need to care when its attached buffer gets different contents via a SubData call. This CL updates the BufferVk logic to ensure that SubData calls trigger a storage changed notification when there's a new storage, and otherwise Texture can ignore SubData calls. Will make it easier to split "contents" changed notifications to their own event, for optimizing Vertex Buffer updates. Bug: angleproject:6371 Change-Id: I4f15ad3ad2da5d838bd51fb065184b7344b188d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3181562 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten 68c0da83 2021-09-15T12:00:08 Vulkan: Inform frontend when new buffer is allocated When a buffer is mapped with GL_MAP_INVALIDATE_BUFFER_BIT while it's currently in use, the Vulkan backend will allocate a new buffer, map it, and return the pointer to the new buffer. This was missing a call to inform the frontend that a new buffer was allocated, causing the old buffer data to be accessed in subsequent draw calls. The fix is to add a onStateChange(angle::SubjectMessage::SubjectGhosted) call when the new buffer is allocated, to inform the frontend. Bug: angleproject:5971 Bug: angleproject:6396 Test: TextureBufferTestES31.MapTextureBufferInvalidateThenWrite Change-Id: I9984d1049ab4d6a2066f4440fc710c9b93ff6ab8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3163244 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 9158436e 2021-07-31T18:26:16 Vulkan: glMapBuffer(): Create new buffer (Buffer Ghosting) When glMapBuffer() is called, if the buffer is in use but not being written to by the GPU: 1.) Create a new buffer. 2.) Copy the contents of the old buffer into the new buffer. 3.) Map the new buffer and return the pointer. Creating a new buffer prevents ending the renderpass and flushing the commands to allow the in-use buffer to be mapped. This change increases Idle Heroes performance from 40FPS to 125FPS. Bug: angleproject:5971 Test: VulkanPerformanceCounterTest.MappingGpuReadOnlyBufferGhostsBuffer Test: BufferDataTest.MapWriteArrayBufferDataDrawQuad Test: BufferDataTest.MapWriteArrayBufferDataDrawArrays Change-Id: I1d433d179f9f5110a948f191c5aedda5397acac8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3065799 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 9184973f 2021-07-21T08:28:30 Add GetCompressedTexImageANGLE to ANGLE_get_image Includes front-end support for reading back compressed texture images. Back-end support is incomplete and will be implemented in a future CL. CL authored by cnorthrop@google.com. Bug: angleproject:6177 Change-Id: I1482b15e5ffec6120f09f51b2718cdbef07c93c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3163359 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill e84b0154 2021-09-13T16:04:20 Update extension boolean names. This is in preparation for auto-gen, which uses a simple naming scheme. This fixes the bool names to be totally consistent with the extension names. Bug: angleproject:6379 Change-Id: Ia212449be04accb0e4f006b55b1813ab4481fa0b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3157417 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Charlie Lao 8ea87a67 2021-08-17T18:46:36 Vulkan: Avoid texture format fallback when possible Some texture formats are not renderable on some hardware. For example, R4G4B4A4 are not renderable on nvidia and not blendable on ARM. R5G5B5A1 are also not blendable on nvidia. Right now when we generate format table, we are being most conservative, picking an actual format that is always renderable and blendable. This means when R4G4B4A4 is used on one of these GPUs, we are always falling back to R8G8B8A8 regardless if the texture is actually being used as color attachment or not. This CL adds a actualRenderableImageFormatID field in vk::Format. Initially we will pick actualImageFormatID which only ensures texture sample capability. If later on the texture is being attached to FBO, then we will switch to actualRenderableImageFormatID and do data copy if necessary. This way we save memory and reduce texture bandwidth for most usage of these textures. For renderBuffer and surfaces and EGLImages, we always pick the renderable textures. Bug: b/196456356 Change-Id: I02eec3365c2a317b0d1bad6dbdc3e741114c5bba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3104514 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Aditya Kushwah f015ae81 2021-08-02T12:47:32 Implement onLabelUpdate method. This change will implement the onLabelUpdate method by calling from every TextureStorage object. Instead of using setDebugName, introduced two new functions, setInternalName and setKHRDebugLabel, which will set the internal name and KHR label respectively that will further be sent to D3D string. Bug: chromium:1164111 Change-Id: I401ca9f6e8a2099a8807f0d7f321efe74269f9f0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3067921 Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Jamie Madill a8f1a916 2021-08-26T17:53:56 GetTexImage: Remove syncState calls & add early error exit. Instead of calling syncState to force the Vulkan staged textures to flush, we ensure the Texture is marked initialized by sending a message up to the Texture when there are no more pending updates. Also adds handling for textures with extra mips. Instead of crashing, we now return an error with a warning. Also adds a test with a texture that has extra (outside the mip chain) defined levels. Also adds a test and handling for empty texture levels. This should lead to more consistent behaviour in the trace test serialization logic, where often the prior logic would behave differently depending on if GetImage was called from MEC or from the serialization code. Also updates the generateMipmap logic to syncState after calling initializeContents so the updates happen in the correct order on Vulkan. Bug: angleproject:5133 Bug: angleproject:6336 Change-Id: Iab1c2a22b9f9435e7f3c0f870c86bbed3460482e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3123168 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill a835912f 2021-08-09T13:58:37 Texture: Mark initialized after syncState. This fixes an issue with retracing where textures that are never used or only used once may have different init states on re-tracing. Bug: angleproject:5133 Change-Id: I29fdc477e3522582c8e2eece0b4b86384ecf6d9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3081762 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jeff Vigil 6136620b 2021-03-25T15:43:06 Reland "EGL: GLES: Implement GL_EXT_protected_textures" This is a reland of 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa This removes changes in gl backend. Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: Id36d697c53afc0f0dadf92bda4565f9157f4fc2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3076825 Commit-Queue: Brandon Schade <b.schade@samsung.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
SeongHwan Park 16a61bbb 2021-08-05T23:06:22 D3D: Fix not notifying RenderTarget release in TextureD3D This could lead to use-after-free for the RenderTarget object. Bug: chromium:1234829 Change-Id: I73d4547b8f09f2f2cf3f7f8394f7f573fe5a4ef5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3063858 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c408926f 2021-07-22T12:00:59 Revert "EGL: GLES: Implement GL_EXT_protected_textures" This reverts commit 6210a9b34a721df2c84cf69170ad9bf7ba40e4aa. Reason for revert: Suspected for breaking ANGLE->Chrome roller. Bug: angleproject:6204 Original change's description: > EGL: GLES: Implement GL_EXT_protected_textures > > Implement EGL_EXT_protected_content Images > Add protected member to Images and Textures > Add error when creating objects if not supported or > does't match native buffer > When creating siblings pass protected state > Add extension caps > Add Validation > Add GetTexParameter and SetTextparameter > Add protected to Texture and state > Expand tests for images and textures > > Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest > > Bug: angleproject:3965 > Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 > Commit-Queue: Mohan Maiya <m.maiya@samsung.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:3965 Change-Id: Ia3ef260a17097b474189ccad5b235a9db99ee00b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3043889 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jeff Vigil 6210a9b3 2021-03-25T15:43:06 EGL: GLES: Implement GL_EXT_protected_textures Implement EGL_EXT_protected_content Images Add protected member to Images and Textures Add error when creating objects if not supported or does't match native buffer When creating siblings pass protected state Add extension caps Add Validation Add GetTexParameter and SetTextparameter Add protected to Texture and state Expand tests for images and textures Test: angle_end2end_test --gtest_filter=EGLProtectedContentTest Bug: angleproject:3965 Change-Id: I35a89b4e80bba6d9b6831c68e71630eef304dacb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2802852 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Tim Van Patten 9ddaa686 2021-07-16T14:57:13 Call getNearestSamples() in Framebuffer::setAttachment() The app jp.garud.ssimulator uses the same sample count of '2' for both glRenderbufferStorageMultisampleEXT() and glFramebufferTexture2DMultisampleEXT(). However, when glRenderbufferStorageMultisampleEXT() is called, Renderbuffer::setStorageMultisample() calls TextureCaps::getNearestSamples() which rounds up the sample count from '2' to '4'. Later, when the app tries to draw with the framebuffer, an error is generated by ANGLE: Framebuffer is incomplete: Attachments have different sample counts. The fix is to also call TextureCaps::getNearestSamples() in Framebuffer::setAttachment() to make sure the sample count passed into glFramebufferTexture2DMultisampleEXT() is also rounded up to match the renderbuffer. Bug: angleproject:6183 Test: MultisampledRenderToTextureTest.FramebufferCompletenessSmallSampleCount Change-Id: I58be9986077257f4767f2e528c2f87e496d9d774 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3036254 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Aditya Kushwah c9dcc553 2021-06-22T18:55:39 Move Objectlabel from Texture object to TextureState object. Created a subscriber function onLabelUpdated in the storage base class. The derived storage class will pass the label reference to the base storage class in the constructor. Future changes will use this label reference to update the label string with D3D. Bug: chromium:1164111 Change-Id: Ic5ca73bac61427afe392bb5bcc6a6eab8e785941 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2981451 Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Jamie Madill cb87d78c 2021-07-08T08:28:04 Enable -Wshadow with Clang. Also fixes a few instances of variable shadowing in the code. Bug: angleproject:6148 Change-Id: Ic51d722a3f953f246f51af6d74abb302f832cf44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3014875 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d665593b 2021-07-05T15:02:11 Update TextureState::getEnabledLevelCount. Instead of simply returning a count of all non-empty texture desc levels, we iterate the levels from the base level and return the count of levels that make a consistent mip chain. This will fix edge cases where Textures are defined sequentially with inconsistent mip levels, but valid rendering states. Bug: angleproject:4780 Change-Id: Id3ebf2d7ad706070896cb5cdf2a311dba2c88949 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3007135 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 977a28f3 2021-06-22T12:30:07 No-op glGenerateMipmap on zero-sized textures The spec says: > Otherwise, ... if any dimension is zero, all mipmap levels are left > unchanged. This is not an error. Bug: chromium:1220250 Change-Id: I45e007c1f8e9b80f405d3d096eb896a7246f7c8e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2979853 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
James Darpinian bb7c1442 2021-03-17T10:17:31 Fix immutable texture base level validation Jeff's new rendering feedback loop test (https://github.com/KhronosGroup/WebGL/pull/3221) found a couple of issues with texture base level validation. For immutable textures the base level is clamped to the valid range, so setting an out of range base level does not make an immutable texture sampler incomplete, and we need to use the clamped value when checking for rendering feedback loops. Bug: angleproject:5768 Change-Id: Ie065709efd736f2cf75d4f980e8ac27999f80142 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2767901 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Courtney Goeltzenleuchter 72b68950 2020-12-02T16:22:21 Ignore redundant Texture state changes Dirtying the state unnecessarily was causing Vulkan backend to create new framebuffer objects when it didn't need to. Bug: b/174700581 Change-Id: I74e0ed51a2c6598ab3dca9a955c247ec97b6856f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2570201 Commit-Queue: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 86d7e4d8 2020-11-10T15:55:34 Vulkan: Support texture buffers Texture buffers are placed in the same descriptor set with the rest of the textures. However, the different code paths that handle textures have special cases for texture buffers as they create a different descriptor type (texel buffer instead of combined image sampler). Image view serials are used to track the buffer view serials as well so the texture descriptor cache can handle texture buffers as well. This CL is missing storage texel buffer support. Bug: angleproject:3573 Change-Id: Iff80ca22ff9b9957a0c9a3c7aaada1fa54b24ec8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2532653 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi 5dec9d19 2020-11-16T16:52:23 Use 0 as special value for glTexBuffer instead of UINT_MAX This is more in line with the rest of ANGLE which assumes a binding of 0 size means the size of gl::Buffer. This allows GetBoundBufferAvailableSize to be used in texture buffer related code. Bug: angleproject:3573 Change-Id: I305835f305d4bf4422759bb96e030cbbc136871a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2542863 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5b419533 2020-11-03T13:33:44 GL: Implement EXT_YUV_target Add test coverage of YUV format sampling as RGB or directly as YUV and rendering as YUV using layout(yuv). Initializing YUV AHardwareBuffers requires Android API 29 so ANGLE must be compiled with: android32_ndk_api_level = 29 android64_ndk_api_level = 29 The following tests can still run with Android API 26 because they don't need to initialize the buffer: ImageTestES3.ClearYUVAHB ImageTestES3.YUVValidation Bug: angleproject:4852 Bug: b/172649538 Change-Id: I4fe9afb2a68fb827dc5a5732b213b5eb60d585ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2517562 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 5b52afae 2020-11-11T15:26:39 Fix texture buffer width query If glTexBuffer is used, the width should be calculated based on the buffer size. Since ES doesn't have immutable buffers, EXT_texture_buffer allows mutable buffers to be attached to the texture. This means that updates to the buffer must update the image description. This is done by having the texture observe the attached buffer. Bug: angleproject:3573 Bug: angleproject:5334 Test: dEQP-GLES31.functional.state_query.texture_level.texture_buffer.width_* Test: TextureBufferTestES31.QueryWidthAfterBufferResize Change-Id: I7d9e5344a3d4ea70da7ba525f13b5876481a70a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2533495 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 620cb770 2020-11-11T14:45:14 Fix texture buffer unbind and size query - Fixes a crash with glTexBuffer given 0 as buffer. - Fixes query of TEXTURE_BUFFER_SIZE. If glTexBuffer is used to bind a buffer, and the buffer is modified, the result of this query must adapt to the new buffer size. The spec mentions that unlike Desktop GL, ES doesn't have immutable buffers, and so they had no choice but to allow mutable buffers. Bug: angleproject:3573 Test: KHR-GLES31.core.texture_buffer.texture_buffer_parameters Test: dEQP-GLES31.functional.texture.texture_buffer.state_query.texture_buffer_size_integer Change-Id: Iec77c14ccf0e9ee11a171dbe2c7386678304bcc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2533494 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill 43acf3ba 2020-07-31T15:43:57 GL: Compiler changes for GL_OES_texture_buffer This extension is core in GLES 3.2 This CL enables the extension, added 412 new dEQP tests for texture buffer. 410 of these tests pass, but there are two tests that fail, detailed in anglebug.com/4933 Also includes a fix for completeness checks. Based on a CL by Jonah Ryan-Davis. Bug: angleproject:3573 Bug: angleproject:4933 Change-Id: I45759d765c88c64f21b592eab01d910dc4bc8da3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2521239 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill fbaae6ce 2020-07-24T11:47:12 GL: Add support for GL_OES/EXT_texture_buffer This extension is core in 3.2 Based on a CL by Jonah Ryan-Davis. Bug: angleproject:3573 Bug: angleproject:4933 Change-Id: Ib5ce038414075a5cdce36e9404e25d7af33fb39c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519401 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 39b777c6 2020-10-29T16:55:06 Capture/Replay: Two cleanups. This changes from returning a vector to directly returning a pointer to the binary data for the serialized state. The second cleanup is to use a ContextID as a wrapped type which simplifies the output formatting code. Bug: angleproject:5247 Change-Id: Ieb8afdb9326a12968dd2d69c05e1ed811b93abff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2506198 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 32f0dd6a 2020-10-15T10:08:51 Add Queries and Setters for resource initialization state. There are cases where we know that the next draw operation will fully initialize a texture/renderbuffer and we can save the robust resource init cost. Default all resource init state to Initialized, any redefinition will set it back to MayNeedInit. After setting an individual texture image to initialized, check if all images are now initialized and update the TextureState::mInitState to match. The cost of this check is only performed after initializing an image and allows future init checks to be faster. Bug: chromium:1132514 Change-Id: Ia23664ae162559d1614f1eb5643e24a491d87f7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2475456 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2072ce50 2020-10-18T16:44:09 Rename "NonLinear" to "SRGB". In OpenGL parlance there are really only two color spaces: Linear and SRGB. Vulkan is much more complicated with linear and nonlinear SRGB, and multiple non-SRGB linear color spaces. Keep things simple by working with OpenGL nomenclature. Bug: angleproject:5176 Change-Id: Ia730a9a666a2b3325194b86dc588e7fd226c4183 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2483466 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Mohan Maiya 7bbe497a 2020-10-16T14:46:45 Vulkan: Implement EXT_texture_sRGB_decode Implement EXT_texture_sRGB_decode. This builds on the existing functionality from EXT_texture_sRGB_override, with 2 major edge cases: 1. sRGB_decode allows the texture state to be overridden by sampler state, which is implemented by forcing a a texture state sync during updateActiveTextures if a texture is bound to the same unit as a sampler with that state 2. texelFetch calls require us to reenable decoding, regardless of decode state. We add a new compiler pass (FlagSamplersWithTexelFetch) to mark samplers that are used with texelFetch in order to support this. This change also re-enables EXT_texture_sRGB_R8, which was disabled due to a dEQP bug that this change will bypass. Bug: angleproject:3609 Bug: angleproject:4503 Test: dEQP.GLES31/functional_srgb_texture_decode_skip_decode_* Test: GLES31/functional_state_query_texture_*_srgb_decode_* Test: GLES31/functional_state_query_sampler_*_srgb_decode_* Test: GLES31/functional_debug_negative_coverage_*_srgb_decode_* Test: GLES31/functional_android_extension_pack_extensions_ext_texture_srgb_decode Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan* Change-Id: I4a67e487dc82e2f57c8c87d4bcd8ef442b6fe220 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2359481 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Geoff Lang 49f01a53 2020-09-18T11:38:14 Vulkan: Add features to modify sampling parameters Add features to optionally increase the LoD offset of all sampling operations or disable linear filtering. These can be used to compare performance without recompiling ANGLE. These features could be potentially implemented in the frontend it is more difficult because the features are not available at texture initialization time. Bug: b/167404532 Change-Id: Ifcf56fbcf130c24c54834737733bbffa5ade3959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2411475 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang f17cd288 2020-09-18T11:36:50 Refactor IsMipmapFiltered to take the min filter directly. This function is more useful if it takes just the min filter mode instead of the entire sampler struct to read a single member. Bug: b/167404532 Change-Id: Ie8c01c4095a615f06fe046fb175cdfb92fa54cbf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2419111 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Corentin Wallez e5882825 2020-09-07T10:55:35 Texture::copyImage: Correctly compare against FBAttachment There is no functional changes, but avoids an incorrect static_cast of pointers when looking to skip the clear in a copyImage of an image onto itself. Change-Id: I35949005016dab5df01e58d27de53dccf38d50c7 Bug: chromium:1125354 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2395617 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexis Hetu d0d523f4 2020-09-02T14:47:27 Make copyTexImage2D robust when source area is out of bounds Whenever the source area of the texture being copied is out of bounds and robust resource init is enabled, it is necessary to clear the invalid portion of the source area to 0 in the copy operation, EXCEPT if the source and the destination are the same, in which case clearing the destination would also clear the source. Bug: angleproject:3930 Change-Id: Ie9e0c52fff86b5626c82a511319688392b7b073b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2391281 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Alexis Hétu e3db3d20 2020-09-02T12:29:28 Revert "Make copyTexImage2D robust when source area is out of bounds" This reverts commit e1e6f2940c25b3899a13f9f76815ddbb2d00e245. Reason for revert: This fix is incorrect, it ends up being a noop. Reverting this first before landing a different fix. Original change's description: > Make copyTexImage2D robust when source area is out of bounds > > Whenever the source area of the texture being copied is out of > bounds and robust resource init is enabled, it is necessary to > clear the invalid portion of the source area to 0 in the copy > operation. > > Bug: angleproject:3930 > Change-Id: If1605b917097006c37e7d59c66babbc32d0ba6d8 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378004 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org> > Commit-Queue: Alexis Hétu <sugoi@chromium.org> TBR=sugoi@chromium.org,geofflang@chromium.org,jmadill@chromium.org,sugoi@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:3930 Change-Id: I9e37a3f739eb7ce5d6d6ab5ca59d11ce9aae8483 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2388718 Reviewed-by: Alexis Hétu <sugoi@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Alexis Hetu e1e6f294 2020-08-26T15:06:25 Make copyTexImage2D robust when source area is out of bounds Whenever the source area of the texture being copied is out of bounds and robust resource init is enabled, it is necessary to clear the invalid portion of the source area to 0 in the copy operation. Bug: angleproject:3930 Change-Id: If1605b917097006c37e7d59c66babbc32d0ba6d8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2378004 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: back sept 10 - Jamie Madill <jmadill@chromium.org> Commit-Queue: Alexis Hétu <sugoi@chromium.org>
Jamie Madill ea3f501e 2020-08-18T11:13:33 Feedback Loop Redesign 3/3: Remove feedback loop tracking. We now we detect feedback loops by tracking the Framebuffers that the Texture is bound to. We still have the old tracking method that counts sampler and image bindings in the code as well. This CL removes the old front-end tracking for feedback loops. It's no longer used by any back-ends. This removal should reduce CPU overhead around Texture and Program binding changes. Reverts the image binding tracking to the simpler scheme that tracks if a Texture has ever been bound as an Image. This should practically have little or no perf effect and we can reinstate some simpler tracking in the future if required. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: Idc625d6e4c519919f97a4dc72dd9c35d262706fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2363210 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com>
Jamie Madill 185d9d08 2020-08-14T22:48:15 Re-land "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." Re-land fixes the crash when drawing with no bound Program executable. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: If2bd25b08298a99f5e64b4055137f9154b0f0860 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365595 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Khushal f6fb6da8 2020-08-19T21:04:35 Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture." This reverts commit 699bcde0b729853f33474941a313f6d5c9e63faf. Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240 Original change's description: > Feedback Loop Redesign 2/3: Track bound FBOs in Texture. > > Currently we track feedback loops by counting the times a Texture is > bound as a sampler or image in a particular context. This is a bit > tricky because Texture bindings change frequently. Relative to the > number of times we need to check for a feedback loop this causes excess > overhead. > > Usually Framebuffers have a low number of Textures bound (in many cases > just 1). And Textures aren't usually bound to many different FBOs. So > instead of counting the number of times a Texture is bound as a sampler > or image we will track the Framebuffers that the Texture is bound to. > > This CL adds a small vector class to gl::Texture which tracks all the > Framebufer Serials of its bound Framebuffers. We can use this set to > quickly check if there's any potential feedback loop between the a FBO > and this Texture. > > We also update the feedback loop check to use this new method. We will > be able to remove the old counting method when we switch the Vulkan > feedback loop handling to use the new tracking in this CL. > > Bug: angleproject:4500 > Bug: angleproject:4959 > Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 > Reviewed-by: Tobin Ehlis <tobine@google.com> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,courtneygo@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4500 Bug: angleproject:4959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077 Reviewed-by: Khushal <khushalsagar@chromium.org> Commit-Queue: Khushal <khushalsagar@chromium.org>
Jamie Madill 699bcde0 2020-08-14T22:48:15 Feedback Loop Redesign 2/3: Track bound FBOs in Texture. Currently we track feedback loops by counting the times a Texture is bound as a sampler or image in a particular context. This is a bit tricky because Texture bindings change frequently. Relative to the number of times we need to check for a feedback loop this causes excess overhead. Usually Framebuffers have a low number of Textures bound (in many cases just 1). And Textures aren't usually bound to many different FBOs. So instead of counting the number of times a Texture is bound as a sampler or image we will track the Framebuffers that the Texture is bound to. This CL adds a small vector class to gl::Texture which tracks all the Framebufer Serials of its bound Framebuffers. We can use this set to quickly check if there's any potential feedback loop between the a FBO and this Texture. We also update the feedback loop check to use this new method. We will be able to remove the old counting method when we switch the Vulkan feedback loop handling to use the new tracking in this CL. Bug: angleproject:4500 Bug: angleproject:4959 Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 48ba75ac 2020-08-06T15:26:53 Remove TextureCommand TextureCommand::GenerateMipmap can be moved into gl::Command allowing us to remove TextureCommand. Bug: angleproject:4753 Test: CQ Change-Id: Idc546df519e199ffd3a8b8e03b9868cd9152e9ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2338823 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi fc4bd898 2020-08-03T16:29:06 Vulkan: Support ANGLE_external_objects_flags With this extension, it is possible to import Vulkan images into ANGLE (similar to EXT_external_objects) while specifying the Vulkan create and usage flags used to create that image. This can be used by the application to drop usage flags it does not need to improve performance, or add create flags as it requires. Bug: angleproject:4912 Bug: fuchsia:52759 Change-Id: Ia568973b19670999dd0e69f6ac5548e8ef0c3eec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2335020 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Michael Spang <spang@chromium.org>
Geoff Lang ab95a449 2020-07-20T12:12:18 Textures that have bound surfaces are always renderable. Chrome still tends to use ES2 contexts for most rasterization. This is a problem when trying to use FP16 IOSurfaces for rendering HDR because GL_RGBA16F is not renderable in ES2. Since a surface is always renderable, allow rendering to any textures with a bound surface. Update the tests to verify that ES3 formats can be used with ES2 contexts. Add tests for RGBA16F IOSurfaces. BUG: chromium:1103112 Change-Id: I9e8c082fc97a0e072289b097e71fc944988d4872 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2307454 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Ian Elliott 0df0b79c 2020-07-17T16:26:21 Vulkan: Optimize changing texture max level For applications that frequently change the texture max level, to a value that is a subset of the texture's maximum levels, just recreate the VkImageView's. Test: NBA 2K20 game play Bug: b/160976091 Change-Id: I62a05a90cdb90147056ba8cec960c2114479ec37 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2300532 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Ian Elliott <ianelliott@google.com>
Shahbaz Youssefi b0245f68 2020-06-23T22:38:12 Vulkan: Remove superseded updates when flushing to image Especially with emulated formats and robust resource init, a clear is staged that's often superseded by a data upload to the same subresource. This change ensures that superseded updates are dropped to avoid unnecessary GPU work. Bug: angleproject:4691 Change-Id: I697ccd438b92fd2fff17a5800550694658c95c54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2262574 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi b772a955 2020-06-16T23:32:47 Vulkan: Make texture syncState aware of upcoming generateMipmap By letting TextureVk::syncState know it's being called for generateMipmap, it can make a better decision to initialize the image: - Staged updates to mips that are going to be overwritten are dropped - The image is created with full mipchain to avoid a redefine in the following generateMipmap() call. Bug: angleproject:4551 Change-Id: Ic70ee6c0a0b29c7bd62beaff612b2f2d5276defb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2249340 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Shahbaz Youssefi e7ae237e 2020-06-12T23:52:09 Vulkan: ANGLE_copy_texture_3d support Bug: angleproject:4748 Test: CopyTexImage*Vulkan:Texture3DCopy*Vulkan:Texture2DArrayCopy*Vulkan Test: dEQP.KHR_GLES3/copy_tex_image_conversions_required_cubemap*cubemap* Change-Id: Ifdc3d455ca8c9e732d0adf4afa9e2809d780ae18 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2246320 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 7fde3673 2020-05-25T15:48:06 GL: Support GL_OES_texture_cube_map_array in frontend/GL backend GL_OES_texture_cube_map_array is core in 3.2. This CL adds the necessary validation for the frontend, as well as support for this extension on the GL backend. The next step is to add the changes to the translator. Bug: angleproject:3584 Change-Id: I751a9c9f71a553b05fdf6673250290806d8cfbff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2215306 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Brandon Schade 8f6d1af9 2020-03-19T14:35:48 Vulkan: Implement EXT_texture_format_sRGB_override Implemented support for EXT_texture_format_sRGB_override This is done by creating new imageviews for textures with sRGB overridden that reinterpret the format to its sRGB counterpart. As preparation for this, textures that use this feature are reallocated with VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT. This will have a performance cost for textures that use this feature, but should have no performance cost for regular textures, since they will not have this bit set. Bug: angleproject:4561 Test: angle_end2end_tests --gtest_filter=SRGBTextureTest.*Vulkan* Change-Id: Iba25f1f2b0a7227959c1cb4ba6e3ca8311c20d06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2152145 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Cody Northrop 712fea9a 2020-05-06T15:45:25 Sync state when calling getTexImage ANGLE's mid-execution capture was failing after changes to defer clears. There were still textures with pending updates and dirty bits after SwapBuffers. This caused our calls to Texture::getTexImage to assert. This was due to a bug where getTexImage was not syncing state. This change makes the function non-const so that it can update state directly. TBR=cnorthrop@google.com,courtneygo@google.com,jmadill@chromium.org Test: Manhattan MEC Bug: angleproject:4517 Change-Id: I717ad44cfc60ae0d4483721f1c91e47c5dda3939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2186170 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Mohan Maiya daed369c 2020-05-05T14:24:26 EGL: Add support for GL_EXT_EGL_image_array extension Add support for creating 2D array EGLImages. 2D array textures are core in GLES3.0. Enable the eglImageArray bool that controls exposure of the extension for all contexts >= GLES3.0 Bug: angleproject:4604 Tests: angle_end2end_tests --gtest_filter=ImageTest.*2DArray* Change-Id: Iebc1ad184fe7209ca89d620290337438ac251c56 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2176109 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill 78a471ba 2020-04-03T16:21:21 TextureGL: Signal DirtyBitsChanged on dirty bits. This is a refactoring change only in preparation for a change in the Vulkan back-end. We'll need to split the handling for Vulkan and GL into different functions. Bug: angleproject:4517 Change-Id: I2ddf9c70fe247d1dcb4e0aa9ca929bbbd61bd42b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135893 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1c95795f 2020-04-03T14:49:45 Use ImageIndex in ensureSubImageInitialized. Passes an already initialized struct so we don't need to separately pass a level and layer. Also removes some redundant gl:: prefixes in Texture.cpp and adds a new helper function doesSubImageNeedInit. Refactoring change only. Bug: angleproject:4517 Change-Id: Ib2d8a5c9ceaada03cc8d299adcb5aed53a0cf13c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2135928 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill c9c4e4ed 2020-04-02T10:29:52 Track rendering feedback loops by-context. This fixes an issue where feedback loops detection would trigger false positives based on texture use in multiple contexts. 1) there are two contexts, C1 and C2, sharing resources 2) in C1, there is a texture T bound to GL_TEXTURE_2D, and a program in use that will sample C1 3) in C2, a framebuffer is created and T is bound to it This fix indexes each set of active bindings in an object by ContextID. We can potentially redo this solution in the future if this proves to have too much tracking overhead. Includes a test writen by Ken Russell. Bug: angleproject:4517 Change-Id: I67012e68947c42d863dca193972576c82d5f3712 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2134406 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Jamie Madill e4aa679c 2020-04-01T17:46:31 Texture: Pass explicit unpack buffer to setImage. This will allow us to call setImage internally even if there's an unpack buffer bound. Useful when implementing robust resource init with copyTexImage in some edge cases. Bug: angleproject:4517 Change-Id: I7e8e9536ab9222c620e572f7b6c20b08fa29d646 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133088 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>