src/libANGLE/renderer/renderer_utils.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi a0586d6e 2024-10-26T00:32:27 Remove feature description / condition strings These strings show up in chrome://gpu so they can marginally be useful, but are otherwise dead weight for most uses of ANGLE / users of ANGLE. While slightly less convenient, the feature name can always be linked back to the source code if needed so the presence of such metadata is not necessary either. This shaves 40KB from the binary size of ANGLE when built with Vulkan only on Android. Bug: chromium:371512561 Change-Id: I3959961bb7de95cc60a85130d0ff38a7fd533fb7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5968453 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 7e462c22 2024-09-17T15:32:41 WGPU: Implement SetUniform() enough so GetUniform() works Lays out a shadow buffer for basic uniforms per-shadertype in std140, which is close to matching WGPU's layout. This does not actually pass the buffer to WGPU as a uniform buffer. GetUniform() just reads from the shadow buffer. This is copied from the VK backend and so some code is deduplicated. Bug: angleproject:42267100 Change-Id: I727dc9e09a7ccabbb617f148dd68590469883b07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5867444 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Geoff Lang 2f2cdbb8 2024-08-19T11:05:22 D3D11: Fix uniform setting for mat3 followed by float A single float following a float3x3 will pack tightly in the last row of the matrix. The uniform setting code for matricies would write a full row stride's worth of data for the last matrix row, overwriting the float packed at the end. Update ExpandMatrix to only write colsSrc worth of values in the last row. Bug: angleproject:42266878, chromium:345525082 Change-Id: Ieb616972387501cd8c30f02b267f86a7f81cf01a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5796631 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Liza Burakova 36cd4c1f 2024-05-08T12:27:22 Adding basic readPixels. This change adds to methods in ImageHelper to read texture data. It also implements FramebufferWgpu::readPixels to get the parameters and read the texture data from an ImageHelper that's stored in mRenderTargetCache. Bug: angleproject:8653 Change-Id: I349ed8a0ae3d8d0e187c658f3402c4f8cac23eb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5441353 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Liza Burakova ead98ed9 2024-05-02T14:04:14 Implement basic texture upload. This change modifies ImageHelper's methods to upload textures to fix webgpu API calls, as well as fully implements uploading texture data via TextureWgpu::setImage for RGBA8 formats. Bug: angleproject:8457 Change-Id: I1c5be3d79ad996a709086ca7157cca6229a336ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5398002 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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>
Shahbaz Youssefi f044aaf8 2024-03-02T00:51:33 Vulkan: Create instance/device without access to Display The feature overrides are now encapsulated in a struct, a reference to which is passed around until features are initialized. Additionally, some window system information needed to decide which extensions to use or workarounds to apply are passed around. This is a step towards decoupling RendererVk from egl::Display for direct use with OpenCL. Bug: angleproject:8564 Change-Id: Id6c5d1c3b38aafcd4397e54cc6cad32bf849eeda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5335823 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: 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>
Shahbaz Youssefi eb0d5997 2023-09-15T16:41:13 Move set/get uniform machinery to ProgramExecutable This is done because some uniforms are internally added by the compiler (draw ID, base vertex, and base instance) and are automatically set **on the installed executable**. This change fixes scenarios where a draw is done after a program has failed a relink, and therefore is unable to correctly set the uniforms (as it does not have access to the executable that is installed). It also fixes draws that use those uniforms in a PPO. Bug: angleproject:8297 Change-Id: Id74b4984b88aa09b5b81be1c91412d6c91711136 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4864693 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 29561184 2023-09-06T22:08:33 Remove forward-to-executable helpers from program This helps avoid accidental usage of the executable that is in the program instead of the installed executable in the GL context. The program's executable is still accessed in specific cases of: - During link - GL program queries Bug: angleproject:8297 Change-Id: I40a956e740944f2ecfbf6e4a3060aac08c21f7f3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4864448 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Steven Noonan f395f34b 2023-08-03T13:58:43 features: frontload feature overrides This allows us to have features that depend on the state of other features more reliably. For example, let's say you have two features: ANGLE_FEATURE_CONDITION(&mFeatures, allowX, (benefitsFromX || isSpecificHardware) && !isBadHardware); ANGLE_FEATURE_CONDITION(&mFeatures, supportsX, hardware.featureXSupported && mFeatures.allowX.enabled); Before this change, if you overrode allowX, the override would be applied too late for the supportsX test. This also helps with disabling dependent features via overrides. For example, if you disable "supportsRenderpass2", it will also disable features depending on it, such as "supportsDepthStencilResolve" and "supportsFragmentShadingRate". By frontloading the feature overrides, we can have cross-dependencies between "feature supported on this platform" and "allow this feature by policy". Bug: angleproject:8291 Change-Id: Id6da2c89428fa896d677fe8d5a41369277a21b31 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4749524 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Steven Noonan <steven@uplinklabs.net> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi fede75ff 2023-07-06T11:38:35 Fix multi-draw's gl_DrawID in non-multi-draw draws The uniform value for gl_DrawID was never reset, so if a program was first used with multi-draw and then without it, gl_DrawID would not contain zero. Test credit info-tibo@orange.fr Bug: angleproject:8245 Change-Id: I73a613ab2858cde4633fadf6a1a523e462167eb0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4662137 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Mohan Maiya 0fe6f282 2023-06-24T14:06:17 Reset and then populate frontend features during display initialize Overwritten features were never reset even if a display was terminated. On platforms that reuse displays for all tests in the end2end suite, overridden feature would leak into subsequent tests causing unexpected failure. Bug: angleproject:8235 Change-Id: I1b359bc762a2bca8db4e4dbc7a587604e5bd6a5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4643453 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Alexey Knyazev dbd5d6df 2023-02-17T00:00:00 Vulkan: Fix border color adjustment for emulated formats Emulated opaque ETC compressed formats are decoded to RGBA8 so the border color must have its alpha as one. Generalized AdjustBorderColor to enforce opaque alpha for opaque formats and to support both ways, in which ANGLE could emulate LUMA formats. Moved AdjustBorderColor to renderer_utils so it could be used with other backends. Bug: angleproject:5978 Change-Id: I9ec44444fd373b1ca6116ebc4447063a014025ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4265514 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 163e56e4 2022-09-20T00:40:55 Allow feature overrides to end in * (wildcard) Makes it easier to apply overrides to features with long names. Also works around Android's limit of 92 characters for debug properties. Bug: b/238024366 Change-Id: I8f417287f92b2439de1a7b7d6abbaf9e61b405e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3906222 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Shahbaz Youssefi 98c2e169 2022-05-20T16:17:49 Vulkan: Reduce pre-rotation spec const to bool The specialization constant now only dictates whether x and y should be swapped. The complete 8 possible states of rotation and y-flip are achieved by using this swap in combination with a driver uniform for x and y flip. Swapping is still a specialization constant to avoid degrading performance of dFdx/dFdy which otherwise would need both to be evaluated instead of one. On platforms which don't support pre-rotation, the specialization constant will never change and driver uniforms entirely govern y-flip. On platforms that do support pre-rotation, only two variations of the pipeline are needed. Bug: angleproject:7366 Change-Id: I73f84e89fa9349d2098fa5b21573aee57d93a30c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3663151 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi fcec6904 2022-04-13T14:18:06 Generate feature variable names from display names The json file now only contains the feature display name. The variable name is automaticaly derived. For consistence with Chromium and other Chromium-based projects, the display name is now always snake_case, and that's what's specified in the json files. This also makes camelCase variable name generation trivial (as opposed to the other way around). Feature overrides now accept both snake_case and camelCase names to ensure compatibility with existing scripts. This is done by removing _ and comparing override names with feature names in lower case. Bug: angleproject:6435 Change-Id: I0b6ed2bbf5c312bc4f4be7b3c7d55dbaca2a9886 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3584630 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gregg Tavares 985d4293 2022-04-08T11:47:34 Metal:Speed up BGRA8 to RGBA8 copy for readPixels On a 2048x2048 texture on Intel this goes from 26-27ms to 17-18ms Bug: angleproject:7117 Change-Id: I4f48521b64e54669d180f0d2d8fdda78f83f89b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579510 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Gregg Tavares <gman@chromium.org>
Cody Northrop 32af258d 2022-03-22T16:44:14 Fix handling of incomplete CubeMapArray textures GFXBench Car Chase binds a cube map array as a default texture, then immediately samples from it without setting it up. This ends up treating the cube map array as incomplete. On the Vulkan backend, this is resulting in multiple validation errors, followed by a crash in the driver. There are a number of errors, but a telling one is this: vkCreateImage(): pCreateInfo->flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, but pCreateInfo->arrayLayers (=1) is not greater than or equal to 6. The Vulkan spec states: If imageType is VK_IMAGE_TYPE_2D and flags contains VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, extent.width and extent.height must be equal and arrayLayers must be greater than or equal to 6 This corresponds to language in the GLES 3.2 spec: 8.18. IMMUTABLE-FORMAT TEXTURE IMAGES TexStorage3D Errors An INVALID_OPERATION error is generated if any of the following conditions hold: * target is TEXTURE_CUBE_MAP_ARRAY and depth is not a multiple of 6 Since ANGLE treats incomplete textures as immutable, we need to update the dimensions of the backing image for CUBE_MAP_ARRAY. Also add a new test that exposes the problem. Test: IncompleteTextureTestES31.IncompleteTextureCubeMapArray Bug: b/218314686 Change-Id: Ibef41e15a7cfccb05e6039bfb8504d237bc42cd4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3546290 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi 17bf6e98 2021-11-11T20:53:31 Implement GL_EXT_multi_draw_indirect * Added the validation functions for multiDrawArraysIndirect() and multiDrawElementsIndirect() according to the specs. * Added generic implementation for the two functions that can be called by back-ends. * Added unit tests for the multiDrawIndirect functions. * Added flags for back-ends so they can enable the extension. * Minor cleanup in MultiDrawTest.cpp Bug: angleproject:6439 Change-Id: I4e5f1cab05c6de330aef82d115492dcc9d2fad44 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3276043 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang d2c01d2c 2021-09-17T12:57:14 GL: Allow selecting virtualization groups at context creation Rewrite EGL_ANGLE_platform_angle_context_virtualization to EGL_ANGLE_context_virtualization, changing the context virtualization parameter to an identifier for what virtualization group the frontend context should be added to. This allows ANGLE's GL backend to be used by multiple threads if the user creates contexts with different virtualization groups. Bug: angleproject:6406 Change-Id: I7414d4705ce10bdf63a9b824043d5dd040dad875 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3169193 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill ac795859 2021-06-23T11:17:36 Disable warning on invalid feature name. Because we don't have a centralized feature list, we would fire this warning every time we use a feature override. Disable it until we have a centralized list we can check. Bug: angleproject:6085 Change-Id: Ia5c3f2ae8337141e963e67e1d71243a3d0a01c9a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2982505 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Mark Lobodzinski c37b1ef8 2021-05-13T14:31:59 Balance debuglabel begin/end pairs for skipped drawcalls Some drawcalls may be no-op'd due to shader issues or having zero instance or element counts. In these cases, the ANGLE markers used for AGI will become imbalanced as it is the drawcalls that trigger the 'begin' marker. This patch ensures that the dirty-bit draw event handler is called for no-op'd drawcalls to keep the AGI commandTree in balance. Bug: b/184888395 Change-Id: I1041d2f06fb313934365340c35e458bc5a66ba64 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2895330 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Alexey Knyazev 835bcb1e 2021-05-08T13:24:58 Vulkan: Support GL_EXT_texture_sRGB_RG8 For completeness, added mappings of R8_SRGB and R8G8_SRGB to OpenGL and Metal. Bug: angleproject:4932 Change-Id: Ic8e44e3a94c114e985f6965fcd43fbcb8071432d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2880661 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Alexey Knyazev f2b47418 2021-04-22T18:32:37 Align BPTC format names in angle::FormatID Use the same naming convention as other similar formats. Bug: angleproject:5731 Change-Id: I187881f4bc4691a0963502ed41f42ab0ebf4171c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2846824 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Mohan Maiya 7e81056a 2021-02-01T11:16:14 Vulkan: Support integer type incomplete texture Support both signed and unsigned integer type incomplete textures. Bug: angleproject:5502 Bug: angleproject:4432 Tests: IncompleteTextureTestES3.*IntegerType* dEQP.KHR_GLES31/core_sample_variables_mask_rgba8*i_* Change-Id: Ic8c972aac0ca8589b26333b66dd0cc5fb5134043 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2613245 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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>
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>
Courtney Goeltzenleuchter 7616dfbd 2020-11-04T18:23:22 Vulkan: Allow Android properties to override features Can enable/disable ANGLE feature via Android properties: debug.angle.feature_overrides_enabled and debug.angle.feature_overrides_disabled which take a string of ':' separated feature strings. Bug: b/170328907 Change-Id: I815b42c5cfae85a39f0f753eabd56e264ea38baf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2514200 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: 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 248119b3 2020-07-20T16:05:45 Vulkan: Fix render target's tracking of content defined Imagine the following scenario: 1. Clear draw framebuffer 2. Invalidate draw framebuffer 3. Update texture attached to draw framebuffer 4. Draw again into draw framebuffer Step 3 could be a number of things, such as glCopyTex[Sub]Image, glBlitFramebuffer, glTex[Sub]Image2D, glGenerateMipmap etc. In the above scenario, at step 2, the framebuffer's render target remembers it being invalidated (mContentDefined = false). This is used to set the loadOp of the next render pass to DONT_CARE. However, mContentDefined was implemented for a very specific optimization regarding the swapchain's depth buffer. The reuse of this variable for glInvalidateFramebuffer was erroneous as this variable didn't track whether the contents are defined for the general case. With this change, mContentDefined is set to true during FramebufferVk::syncState for each render target whose contents are marked dirty. This change additionally makes glBlitFramebuffer signal the contents of the blit targets as dirty, as well as textures that are used as storage images. Bug: angleproject:4859 Change-Id: I68c829f75ff4a3d03bb293ec72c609384983026d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2309110 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
shrekshao 796df76c 2020-06-25T11:49:12 MultiDraw Refactor Refactor MultiDraw* from general Context to different ContextImpl. Move general multiDraw code to renderer_utils.cpp. Bug: angleproject:3402 Change-Id: I85cb4b781afa2b3a8beb382a9c735910057f2ebe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2268580 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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>
Ian Elliott a91dcb62 2020-06-05T09:46:56 Fix FramebufferVk::getScissoredRenderArea() for pre-rotation This fixes cases where pre-rotation wasn't occuring for small scissors used with glClear(). There are around 1000 tests that do this. Test: angle_deqp_gles2_tests --gtest_filter=dEQP.GLES2/functional_fragment_ops_depth_stencil_* Bug: angleproject:4431 Bug: b/157933235 Bug: b/157933198 Change-Id: I469d51975e3bc3a7bfc9521a3817c919e809f7dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2228211 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Ian Elliott d0146e07 2020-05-12T14:47:11 Vulkan: Rename SurfaceRotationType to SurfaceRotation Follow-on CL per request in https://chromium-review.googlesource.com/c/angle/angle/+/2191425/3/src/libANGLE/renderer/renderer_utils.h#48 Bug: angleproject:4436 Change-Id: I2ee8c65a0dbcf2eee4c9c7f4252abf16a578cad3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2197614 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Ian Elliott e9dcffb1 2020-05-11T17:36:33 Vulkan: Enhance ReadPixels to deal with pre-rotation Depending on the orientation, the source image may be row-major or column-major; with positive or negative x/y-axis pitches. Regardless of the orientation, the destination remains row-major. Bug: angleproject:4436 Bug: b/150329975 Change-Id: Ia1287f7036f07548d35128f1761feadf721cd78a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2191425 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Ian Elliott <ianelliott@google.com>
Jamie Madill 0f2747e9 2020-04-24T13:10:14 Vulkan: Clean up ClipRectToScissor. Refactoring change only. Split off to make the main CL for deferring clears simpler. Bug: angleproject:4517 Change-Id: I5728a7dcf09de8952d5810061d1d8b135b625339 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2165630 Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill eb63016d 2020-02-04T16:15:41 Add environment overrides for ANGLE features. Allows the application to override ANGLE behaviour without having to modify the code or use the ANGLE extension. Useful for testing with the command graph refactor. Adds a new string utility for parsing lists of strings from environment variables. Bug: angleproject:4029 Change-Id: Ibae93b743c0c385392cd259d9604ce2f2ed988dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2037784 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Ian Elliott 5f857839 2019-12-04T15:30:50 Improve current multisampled renderbuffer/texture support This is split off from a change to implement multisampled textures for the Vulkan back-end, and will come before that change. The changes include: - Make a common utility rx::GetSamplePosition() function. D3D11 and Vulkan use the same standard sample positions/locations for 1, 2, 4, 8, and 16 samples. The D3D11 back-end has a utility function for this, which is being moved to a common location--for use by both the D3D11 and Vulkan back-ends. - Texture::setStorageMultisample() handles converting the "requested number of samples" to the actual number of samples used (e.g. converting 3 to 4), supported by the underlying back-end). The actual number used is stored in gl::TextureState::mImageDescs, for use by other GLES commands. - Change some end2end tests to not make assumptions about the supported number of samples, but to properly query what is supported. Bug: angleproject:3565 Bug: angleproject:4196 Change-Id: I1dc12fedd0f8fb4975f90d87486e443b069b7141 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948535 Commit-Queue: Ian Elliott <ianelliott@google.com> Reviewed-by: Ian Elliott <ianelliott@google.com>
Jamie Madill 32bee0fd 2019-10-10T11:46:58 Fix debug layers being disabled everywhere. The define that controlled the debug layer preference was mistakenly checking a Vulkan define. When the Vulkan define was moved into the Vulkan back-end then the layers became disabled for all back-ends. Fix this by using a layered check in the Vulkan back-end and restoring the asserts enabled check to ShouldUseDebugLayers. Suppresses some tests that regressed the layers after they were broken. Bug: angleproject:3987 Bug: angleproject:3991 Change-Id: I6aafcff6d9e19866c2324663ef4d4550e97fcfb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1852706 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tobin Ehlis f22f16d3 2019-07-18T15:10:49 Reland "Vulkan: Use VK repos' internal BUILD.gn files" This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 There was a missing build dependence causing a build no-op issue which has now been fixed in the upstream Vulkan Validation Layer repo. Primary workaround that need to be re-visted and fixed are: 1. Disabled validation layers on 32-bit Windows 2. Disabled validation layers on 32-bit Android 3. Disabled DebugUtils on Android, using DebugReport instead 4. Using custom VK Loader branch to avoid WDK dependence Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Bug: angleproject:3924 > Bug: angleproject:3925 > Bug: angleproject:3946 > Bug: chromium:997009 > Bug: chromium:997016 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> Bug: angleproject:2449, angleproject:3320, angleproject:3852 Change-Id: I373ada091a1329db5e304874079428d01ba21d52 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1778302 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis aae21ef6 2019-08-29T21:56:06 Revert "Reland "Vulkan: Use VK repos' internal BUILD.gn files"" This reverts commit 0ad1559f3ae95efecaa209f990987d3ce4ebd150. Reason for revert: linux-rel no-op build issue showing up in Chromium integration. Tracking in chromium:997016 Original change's description: > Reland "Vulkan: Use VK repos' internal BUILD.gn files" > > This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 > > Original change's description: > > Vulkan: Use VK repos' internal BUILD.gn files > > > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > > files so switched ANGLE to use those by default. > > Also Validation Layer, Loader, and Tools repos no longer uses codegen > > so this speeds up the build overall. > > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > > to VK_LAYER_KHRONOS_validation unified layer. > > > > This changes includes a temporary workaround to the Vulkan-Loader repo > > to remove its Window's build dependence on WDK. There are plans to > > remove that depenedence in Loader master, but until then we can use > > our custom branch workaround. > > It also includes a custom branch for validation layers that includes > > some build fixes for ANGLE. > > Finally, the layers were crashing on Android when attempting to use > > DebugUtils extension so forcing DebugReport on Android for now. > > > > Bug: angleproject:2449 > > Bug: angleproject:3320 > > Bug: angleproject:3852 > > Bug: chromium:997009 > > Bug: chromium:997016 > > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > > Reviewed-by: Jamie Madill <jmadill@chromium.org> > > Commit-Queue: Tobin Ehlis <tobine@google.com> > > Bug: angleproject:2449, angleproject:3320, angleproject:3852 > Change-Id: I9597be99000083b135e19b6ee68d4ae222158e72 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769036 > Commit-Queue: Tobin Ehlis <tobine@google.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=tobine@google.com,syoussefi@chromium.org,jmadill@chromium.org Change-Id: I88afdaff07e9f414f9de02f6d3651eaba9a5045f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2449, angleproject:3320, angleproject:3852 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1776920 Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Tobin Ehlis 0ad1559f 2019-07-18T15:10:49 Reland "Vulkan: Use VK repos' internal BUILD.gn files" This is a reland of 552f5fcb0d8fcc615856ce3b678190e1cbdd38e6 Original change's description: > Vulkan: Use VK repos' internal BUILD.gn files > > This retires custom BUILD.gn files for the Vulkan Headers, Tools, > Validation-Layers, and Loader repos. They now have integrated BUILD.gn > files so switched ANGLE to use those by default. > Also Validation Layer, Loader, and Tools repos no longer uses codegen > so this speeds up the build overall. > Switched over from old VK_LAYER_LUNARG_standard_validation meta-layer > to VK_LAYER_KHRONOS_validation unified layer. > > This changes includes a temporary workaround to the Vulkan-Loader repo > to remove its Window's build dependence on WDK. There are plans to > remove that depenedence in Loader master, but until then we can use > our custom branch workaround. > It also includes a custom branch for validation layers that includes > some build fixes for ANGLE. > Finally, the layers were crashing on Android when attempting to use > DebugUtils extension so forcing DebugReport on Android for now. > > Bug: angleproject:2449 > Bug: angleproject:3320 > Bug: angleproject:3852 > Bug: chromium:997009 > Bug: chromium:997016 > Change-Id: I48b36acefcc7f2bc930eb72d6fdbc87bca24f833 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1610438 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Tobin Ehlis <tobine@google.com> Bug: angleproject:2449, angleproject:3320, angleproject:3852 Change-Id: I9597be99000083b135e19b6ee68d4ae222158e72 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769036 Commit-Queue: Tobin Ehlis <tobine@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2ab08edc 2019-08-12T16:20:21 Use TextureID in place of GLuint handles. Bug: angleproject:3611 Change-Id: Ie6156e8732b3ca4dc6c4439c059a5481a4dfd250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1738753 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiacheng Lu 3a36f306 2019-07-19T12:43:22 Always set matrix uniform to dirty when it updates Remove the dirty checking of matrix uniform update at frontend and always let backend update whenever glUniformMatrix* is called. Profiled with UniformsBenchmark/* with vulkan backend, performance increases around 6% when data being updated is changing and performance increases around 2% when data being updated stays same. Bug: angleproject:3705 Change-Id: I8eaf6a1231e634b69c6dc540db1b9d3a312bf45d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1709725 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jiacheng Lu ec30d78d 2019-07-03T12:56:58 Optimize uniform matrix update 1. Add a fast matrix update function to do a single memcpy for uniform matrix assignment with same layout. It benefits row-4 no-transpose GLSL matrix and col-4 transpose HLSL matrix. 2. Make boolean IsColumnMajor to be a template parameter in generate uniform matrix updating, which gets rid of the conditional branch in loop and has better performance. 3. Add e2e test of uploading multiple 3x4 GLSL matrices at the same time, which adds coverage to this CL. Bug: angleproject:3632 Change-Id: Id1701ef6fbf63ea4b9884254d93ea8eacfe4e16a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688274 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis fce1e2d1 2019-06-04T15:02:08 Extend eglGetPlatformDisplay to allow feature overrides. Add EGL_FEATURE_OVERRIDES_ENABLED_ANGLE and EGL_FEATURE_OVERRIDES_DISABLED_ANGLE to submit lists of strings naming the features that should be overridden (either enabled or disabled) on display creation. Bug: angleproject:1621 Change-Id: I4bb75c5dbab0e3b701a72069c38f8c60ecfffad2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1646595 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi b783fbc7 2019-05-10T23:16:17 Vulkan: Fix matrix uniforms A piece of code shared with d3d was used to implement this feature. However, we store the uniform data transposed and row-major in d3d to accomodate the fact that matrix indexing in HLSL is the opposite of GLSL (mat[row][col] in HLSL as opposed to mat[col][row] in GLSL). There were two functions that copied the source matrix fields either as column-major or source-major (corresponding to `transpose` false or true respectively in glUniformMatrix*) into a row-major destination. These functions are refactored into one, which copies from any-major source to any-major destination. The HLSL backend uses the "to row-major" variant and the Vulkan backend uses the "to column-major" variant. Bug: angleproject:3198 Change-Id: I7254da4fbe6916af78c5906abcb82ca01674ab9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1607541 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 127990f9 2019-04-04T13:52:04 Vulkan: Use render pass loadOp for scissored clears At this point, every clear is done through render pass loadOp, except masked color or stencil clears. The only fallback is clearWithDraw, that can clear both color and stencil at the same time. Bug: angleproject:2361 Change-Id: I805fc12475e832ad2f573f665cdfeb766e61a6d0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1553740 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com>
Jamie Madill c09ae15c 2019-02-01T14:16:32 Enable -Wextra-semi and -Wextra-semi-stmt. This will prevent users from accidentally making semicolon errors in the future. Bug: chromium:926235 Change-Id: I79a6fa376fb1ad8f0fcf1b65b1f572a035d1f4e9 Reviewed-on: https://chromium-review.googlesource.com/c/1446493 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill c3dc5d48 2018-12-30T12:12:04 Merge gl::Context and gl::ContextState. This reduces the number of indrections when accessing the Extensions or Caps structures. It will provide a small speed-up to some methods. It also cleans up the code. Bug: angleproject:2966 Change-Id: Idddac70758c42c1c2b75c885d0cacc8a5c458685 Reviewed-on: https://chromium-review.googlesource.com/c/1392391 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
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 8dc27f99 2018-11-29T11:45:44 Use packed enum for DrawElementsType. The packing and unpacking take a few extra instructions. But it completely obviates the need for any switches in the validation code. Speed is slightly faster or the similar depending on the back-end. Also add gl_angle_ext.xml to GL entry point generator inputs. This was missing and would cause the code generation to miss certain changes. Bug: angleproject:2985 Change-Id: I1ea41a71db71135000166ead8305ec42d22ff7b3 Reviewed-on: https://chromium-review.googlesource.com/c/1351729 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 666818ea 2018-11-14T09:54:33 Use angle::Result in front-end (Part 8) Refactors the gl::Texture class and a few related methods. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: Ib9a69d7f507b0dce35abb17b90532f812bf43214 Reviewed-on: https://chromium-review.googlesource.com/c/1291845 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill c1fd7376 2018-10-26T22:48:39 Move index range calculations into VertexArray. This is in preparation for removing the entire DrawCallParams struct. This struct was big enough to cause a performance hit on draw call perf tests just by virtue of initializing the fields. Also dereferencing the struct members is slower than reading function parameters since it adds an indirection. Also includes some error refactoring to enable moving code to a shared location. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ib663f2538c14ac30d4c31fd10d6350be469626e2 Reviewed-on: https://chromium-review.googlesource.com/c/1298380 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1c7f08c3 2018-10-10T16:13:02 Inline RefCountObject::release. Also don't return errors from the object release methods. Not returning errors reduces the amount of code generated. Also we shouldn't be exiting early from destructor type functions. Increases object binding performance. Bug: angleproject:2877 Change-Id: Ieb8120d885b946915e355419825e1f52f31d7b49 Reviewed-on: https://chromium-review.googlesource.com/c/1270218 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Brandon Jones 4e6f2aea 2018-09-19T11:09:51 Implement ANGLE_copy_texture_3d Extension Adds copyTexture3DANGLE and copySubTexture3DANGLE that adds copy operations on volumetric textures. Bug: angleproject:2762 Test: angle_end2end_tests Change-Id: I0076989c2b7ed69abfc73143c325065bdb06a360 Reviewed-on: https://chromium-review.googlesource.com/c/1207216 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Frank Henigman 1ffad843 2018-09-24T23:40:45 Remove PixelPackState from PackPixelsParams. Only one flag ("reverseRowOrder") from PixelPackState was being used, so instead of including the entire struct in PackPixelsParams, just include the one flag. BUG=angleproject:2718 Change-Id: I32e8b30383d198ecba9bf1719c32dda0938fc969 Reviewed-on: https://chromium-review.googlesource.com/1242210 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com>
Jamie Madill 0d0fb43f 2018-09-07T17:43:32 Pass unpack buffer as explicit parameter to texSubImage. This allows us to override it in the incomplete texture init. Any back-end that used incomplete textures was vulnerable to a bug where the unpack buffer would be used to initialize the incomplete texture. Bug: chromium:880906 Change-Id: Ica558e4a4d81de9212f0bc6619ccd812a048ad45 Reviewed-on: https://chromium-review.googlesource.com/1214207 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 522095f7 2018-07-23T14:59:41 Rename "color" functions to "pixel" functions. This extends of the copy, read and write functions to cover depth and stencil formats. Refactoring change only. Bug: angleproject:2673 Change-Id: I4b0b2f4cf8621051cacd95cdbd6d70f94ca612e2 Reviewed-on: https://chromium-review.googlesource.com/1147152 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill b436aac3 2018-07-18T17:23:48 Vulkan: Support inverted blit for depth/stencil. Depth/stencil formats are packed tightly when reading back Images with vkCmdCopyImageToBuffer. Same for the reverse. Thus we need to take this into account when doing our blitWithReadback implementation. This splits the depth/stencil blit into two separate steps. Fixes all the remaining blit failures in BlitFramebufferANGLETest. Bug: angleproject:2673 Change-Id: Ie9f43f782a82b5a0746d00122b24f81088d57c4c Reviewed-on: https://chromium-review.googlesource.com/1140740 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill db9c69ed 2018-07-18T17:23:47 Make PackPixels take an angle::Format. This removes the format type parameter from places where it isn't needed. It also removes the 'write color' functions map. This map was redundant with the angle::Format write function. Bug: angleproject:2729 Change-Id: I24e4548a89342237d7ed25180fea156fba51ccab Reviewed-on: https://chromium-review.googlesource.com/1142300 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 1617e69e 2018-07-11T11:08:19 Vulkan: Implement depth/stencil blit with flip of the viewport - This makes all end2end tests pass successfully on Win/Nvidia with viewport flipping enabled. Bug: angleproject:2673 Change-Id: I031c0a0f5fb0aede58b59479e57c2c127bcb964c Reviewed-on: https://chromium-review.googlesource.com/1133703 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Geoff Lang 24ddc7a8 2018-06-11T14:56:34 WGL: Support unvirtualized contexts and unsafe multithreading. When using unvirtualized contexts, DisplayWGL still creates a Renderer for managing any internal GL resources such as emulated back buffers for DXGISwapChainWindowSurfaceWGL or D3DTextureSurfaceWGL but also creates a new Renderer for each GL context. All created contexts share resources. BUG=angleproject:2464 Change-Id: I945502514079368e062beef70bed49c61ed44403 Reviewed-on: https://chromium-review.googlesource.com/1097459 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Luc Ferron 339b95ef 2018-06-12T10:21:52 Vulkan: Support RGB5A1 correctly Bug: angleproject:2649 Bug: angleproject:2597 Change-Id: I2fd7185463d92737454e383fbfb7992e8d68fe68 Reviewed-on: https://chromium-review.googlesource.com/1097221 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 48cdc2e8 2018-05-31T09:58:34 Vulkan: Implement setUniform for matrices correctly This fixes all these tests: dEQP-GLES2.functional.shaders.functions.datatypes.float_mat* dEQP-GLES2.functional.shaders.functions.datatypes.mat* dEQP-GLES2.functional.shaders.linkage.varying_type_mat* dEQP-GLES2.functional.shaders.matrix.* dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic.mat2_* dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.basic.mat3_* dEQP-GLES2.functional.shaders.conversions.matrix_to_matrix.* dEQP-GLES2.functional.shaders.conversions.matrix_combine.* dEQP-GLES2.functional.shaders.random.scalar_conversion* Bug:angleproject:2581 Bug:angleproject:2583 Bug:angleproject:2584 Bug:angleproject:2588 Change-Id: Ib8c03397f0229432292c51f4a6332f954fc8fa12 Reviewed-on: https://chromium-review.googlesource.com/1080392 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 46bcea50 2018-05-31T09:48:36 D3D,Vulkan: Prep work to share useful functions from D3D - Refactor and move some functions used by D3D that are not really renderer specific to be used by the Vulkan implementation to support setting matx uniforms. Bug: angleproject:2581 Change-Id: Ib37ddf4fc62bb8ecb3629893a24969e1f515795b Reviewed-on: https://chromium-review.googlesource.com/1079845 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 4bba74f0 2018-04-19T14:40:45 Refactor Texture::syncState to pass down the Context Also returning a gl::Error everywhere. Bug: angleproject:2478 Change-Id: Ic8cae0ee7aee318bb95b3588044c34c62707b578 Reviewed-on: https://chromium-review.googlesource.com/1020083 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Corentin Wallez 99d492c2 2018-02-27T15:17:10 Use packed enums for the texture types and targets, part 2 This completes the refactor by using the packed enums in the gl:: layer and in the backends. The packed enum code generation is modified to support explicitly assigning values to the packed enums so that the TextureTarget cube map faces are in the correct order and easy to iterate over. BUG=angleproject:2169 Change-Id: I5903235e684ccf382e92a8a1e10c5c85b4b16a04 Reviewed-on: https://chromium-review.googlesource.com/939994 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 58ba6bf5 2017-11-28T16:40:58 Enable debug layers by default whenever assertions are enabled. BUG=angleproject:2279 Change-Id: I7e7ef359fa3021aa10585653b2fec169f5d4a51f Reviewed-on: https://chromium-review.googlesource.com/794536 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Corentin Wallez cda6af19 2017-10-30T19:20:37 Split pixelBuffer from pack/unpack state This will refactor will help use packed enums for buffer targets. BUG=angleproject:2169 Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c Reviewed-on: https://chromium-review.googlesource.com/745181 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 42975644 2017-10-12T12:31:51 Move incomplete texture logic to shared helper. The incomplete texture handling is similar between the D3D and Vulkan back-ends. We create 1x1 textures, initialize them to black, and bind them when we detect incomplete textures. We would also bind incomplete textures when we detect feedback loops. In the GL back-end, we wouldn't detect feedback loops, and would allow the driver to handle incompleteness. Instead implement this in a shared helper class, and do the feedback loop detection in the front-end for every back-end. This makes our behaviour more consistent between back-ends, and prevents undefined behaviour. Because initializing multisample textures is tricky (they can't be updated with TexImage calls) we do a bit of a workaround so the back-end can clear the incomplete multisample texture initially. This progresses the initial Vulkan textures implementation. BUG=angleproject:2167 Change-Id: I79ddcc0711fcc986f2578a52ac6f701231d241ac Reviewed-on: https://chromium-review.googlesource.com/700993 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang d93cd6c2 2017-08-11T16:32:41 Refactor the CPU copy texture code into a function in renderer utils. BUG=angleproject:1932 Change-Id: Iab79f2a09c2d8a85d2a9dde34acf4d2151072c2b Reviewed-on: https://chromium-review.googlesource.com/612561 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 222c517f 2017-07-19T16:15:42 Control Debug layers in ANGLE_platform_angle. Debug layers seem to be a universal thing among functional back-ends. D3D, OpenGL and Vulkan all need some kind of controls for debugging, so it seems to make sense to make this control part of the base extension. Default the extension to EGL_DONT_CARE, which allows the back-end to have a lot of flexibility in terms of implementation. Also enable the extension in the D3D11 and OpenGL back-ends, and set the extension to enabled for angle_end2end_tests. Remove EGLVulkanEXTTest since it no longer tests anything not tested in the base ANGLETest class. BUG=angleproject:2086 Change-Id: I52d8170effd1846b9afbe6e4052c699fe5cb0de8 Reviewed-on: https://chromium-review.googlesource.com/578369 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4928b7ca 2017-06-20T12:57:39 Proliferate gl::Context everywhere. This gives the D3D back-end access to the GL state almost anywhere. This uses the onDestroy hook for Textures to push errors up from destructors, although they still don't quite make it to the Context. There are places, such as in EGL object (Context/Surface) destruction, where we end up calling through to GL implementation internals without having access to a gl::Context. We handle this via a proxy Context to a Display, basically a null context, that has access to impl-side state like the Renderer pointer if necessary. It does not have access to the normal GL state. Also Pass gl::Context to RefCountObject::release(). Since we're using destroy() methods now, we should not ever call the destructor directly. BUG=angleproject:1156 Change-Id: Ie4c32ad6bf6caaff0289901f30b5c6bafa2ce259 Reviewed-on: https://chromium-review.googlesource.com/529707 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ca27139e 2017-04-05T12:30:00 Key the format tables on internal format and type. Keying the format tables on internal format alone is not enough to fully validate the unsized formats which require additional type information. This CL has no functional changes, it just splits the tables and updates the calls to GetInternalFormat info to provide type information when the format is not sized. BUG=angleproject:1523 BUG=angleproject:1958 BUG=angleproject:1228 Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7 Reviewed-on: https://chromium-review.googlesource.com/468449 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4f57e5f9 2016-10-27T17:36:53 D3D11: Make several format tables constexpr. This should guarantee the best memory access patterns. It introduces some indirections for some format queries, but most of these should be direct array lookups, or used infrequently. We can optimize this later if necessary. BUG=angleproject:1389 Change-Id: I5e2c8c530a07798494afd3ea36b6164d7564c02c Reviewed-on: https://chromium-review.googlesource.com/403314 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 30712068 2016-08-09T11:10:36 Move fast copy functions into angle::Format. These tables were duplicated in D3D11 and D3D9, and would have to be further duplicated into Vulkan. BUG=angleproject:1455 Change-Id: Ice1b81417d7b14f933b61861c4a9997c260ef72e Reviewed-on: https://chromium-review.googlesource.com/367690 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 86e0b7f7 2016-08-09T11:10:29 Clean up PackPixels. BUG=angleproject:1455 Change-Id: I263719cc77ff80580a551683d062e862dee1bdab Reviewed-on: https://chromium-review.googlesource.com/365826 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Zhenyao Mo <zmo@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang 6e4cfceb 2016-06-13T15:06:31 Refactor ANGLE's image manipulation code into a static library. Allows for chromium to make use of some of the functionality. BUG=612205 Change-Id: Ib4435ca44775a3a554b0fb3bd384bd4d31d7952d Reviewed-on: https://chromium-review.googlesource.com/351753 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill ec0b580d 2016-07-04T13:11:59 Re-land "D3D11: Fix readback of BGRA-backed formats." For some BGRA-backed formats (RGBA4, R5G6B5, RGB5A1), our ReadPixels implementation wasn't aware the BGRA format didn't exactly match the RGBA format. For these it would do the 'fast path' memcpy method, when it should stop and do the slow pixel-by-pixel packing method. Fixes conformance2/reading/read-pixels-from-fbo-test.html. Reland: fix empty format info that was causing us to only see the first pixel in the FBO in a ReadPixels call. Also fix bugs in the unorm 16-bit format readback code, and add ASSERTs to catch bugs in subsequent new formats. BUG=angleproject:1407 BUG=chromium:616176 Change-Id: I9fd55b9e1dd6a306eb4db195d775c02a1eb1f93f Reviewed-on: https://chromium-review.googlesource.com/357132 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d2b50a0b 2016-06-09T00:13:35 Move ReadPixels logic to helper methods. These routines were pretty much duplicated between D3D9 and D3D11. Since I was going to have to rewrite them again for Vulkan, I figured it would be best to move them into a common location and clean them up a bit. BUG=angleproject:1319 Change-Id: I15d39b052daf3e1020dbd0880f01ae84f3686a0a Reviewed-on: https://chromium-review.googlesource.com/349630 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>