src/libANGLE/renderer/renderer_utils.h


Log

Author Commit Date CI Message
Amirali Abdolrashidi b682d810 2024-09-18T14:24:22 Remove limitation for INT_MAX In LimitToInt(), a limit was placed so INT_MAX/2 would return instead of INT_MAX. This was done to avoid dEQP errors due to imprecisions rising from querying the limit as a float. However, it seems that the underlying issue has been resolved. Therefore, it should be safe to remove this limit. * Set the LimitToInt() return value limit back to INT_MAX. Bug: angleproject:361369308 Bug: angleproject:42262938 Change-Id: Icf861797656bf95690ee4f0964635dd6f3c97198 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5874170 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi f0f65290 2024-09-10T15:30:30 Translator: Add check for atomic counter offset For GLSL shaders, atomic counter offset should not exceed the maximum atomic counter buffer size. This issue was seen on a dEQP test when increasing the LimitToInt() limitation from INT_MAX/2 to INT_MAX+1 or INT_MAX. * Added check to the translator to make sure the offset does not go beyond the max atomic counter buffer size. * Packed the existing checks into a single function. * (checkAtomicCounterOffsetIsValid()) * Added mMaxAtomicCounterBufferSize to TParseContext for the check. * Also added the related cap (maxShaderStorageBlockSize) for D3D11. * Increased the limitation in LimitToInt() to (INT_MAX / 2 + 1). * Added test based on dEQP test that failed on some platforms as a result of updating said limitation. * From KHR-GLES31.core.shader_atomic_counters.negative-large-offset Bug: angleproject:361369308 Change-Id: Id6128c75e12445b2a0029f4a2eb2bdb379cad48d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5851650 Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Le Hoang Quyen 1bfe5c57 2024-07-30T15:58:47 Metal: partially implement EXT_multisampled_render_to_texture. Implement by implicitly attaching a multisampled texture to the render pass. The content will be preserved across render passes by loading/storing to the implicit multisampled texture. However this won't work if the single sampled texture is used in multiple render passes with different glFramebufferTexture2DMultisampleEXT's sample counts. For that to work we need to implement unresolve step to load the resolve texture's texels into the implicit multisampled texture. That will be implemented in a separate CL. Bug: angleproject:42261786 Change-Id: I12be75af17ce5b98266946846417d0a43fcba455 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5746180 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Quyen Le <lehoangquyen@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>
Liza Burakova 041b0a4d 2024-04-15T13:42:17 Begin initializing caps for webgpu Bug: angleproject:8457 Change-Id: Idde0673297ec675a13bd3e4fd4d220ec47392153 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391987 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Liza Burakova <liza@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 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>
Charlie Lao 5217beb2 2023-08-15T13:43:12 Reland "Tightly pack LinkedUniform by using int16_t" This is a reland of commit 152cf62b38874238095a91307e4ea9bcdedf8f46 Original change's description: > Tightly pack LinkedUniform by using int16_t > > There is a check of vector size when we link uniforms and the maximum > vector size is 4096 due to we clamp the maxUniformBlockSize to 64KB. In > reality, if we exceeds this number, program link will take really long > time and then hit failure. So there is no real need to keep all the > variables in 32 bit integer. This CL changes to 16 bit integer. Further, > sh::BlockMemberInfo and ActiveVariable data members are embeded into > LinkedUniform struct as well so that the unused variables can be removed > and data can be tightly packed. This also makes LinkedUniform easier to > maintain as a simple struct with basic data types. With this change, > LinkedUniform size is reduced from 108 bytes down to 60 bytes, 48 bytes > reduction. Given some apps has 200-ish uniforms, this CL reduces 48 > bytes x 200 = ~9K memory just for uniforms per program (which goes > through hash compute and decompression and file reads). > > Bug: b/275102061 > Change-Id: I7fae20f5b75f3239305e2094a992e3040b8c8e4c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4754133 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/275102061 Change-Id: I1cdec9407e930608d3239a104dcbf77c8d8e2113 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4791661 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Vivian Pao 9f48f931 2023-08-16T06:38:15 Revert "Tightly pack LinkedUniform by using int16_t" This reverts commit 152cf62b38874238095a91307e4ea9bcdedf8f46. Reason for revert: Suspect cause of failure in for several Linux MSan Tests, e.g. https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/42403/overview https://ci.chromium.org/ui/p/chromium/builders/ci/WebKit%20Linux%20MSAN/22174/overview https://ci.chromium.org/ui/p/chromium/builders/ci/Linux%20MSan%20Tests/42403/overview Original change's description: > Tightly pack LinkedUniform by using int16_t > > There is a check of vector size when we link uniforms and the maximum > vector size is 4096 due to we clamp the maxUniformBlockSize to 64KB. In > reality, if we exceeds this number, program link will take really long > time and then hit failure. So there is no real need to keep all the > variables in 32 bit integer. This CL changes to 16 bit integer. Further, > sh::BlockMemberInfo and ActiveVariable data members are embeded into > LinkedUniform struct as well so that the unused variables can be removed > and data can be tightly packed. This also makes LinkedUniform easier to > maintain as a simple struct with basic data types. With this change, > LinkedUniform size is reduced from 108 bytes down to 60 bytes, 48 bytes > reduction. Given some apps has 200-ish uniforms, this CL reduces 48 > bytes x 200 = ~9K memory just for uniforms per program (which goes > through hash compute and decompression and file reads). > > Bug: b/275102061 > Change-Id: I7fae20f5b75f3239305e2094a992e3040b8c8e4c > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4754133 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> Bug: b/275102061 Change-Id: Id344e306307553731097f06edafc40bfeb73ff80 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4780494 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Charlie Lao 152cf62b 2023-08-15T13:43:12 Tightly pack LinkedUniform by using int16_t There is a check of vector size when we link uniforms and the maximum vector size is 4096 due to we clamp the maxUniformBlockSize to 64KB. In reality, if we exceeds this number, program link will take really long time and then hit failure. So there is no real need to keep all the variables in 32 bit integer. This CL changes to 16 bit integer. Further, sh::BlockMemberInfo and ActiveVariable data members are embeded into LinkedUniform struct as well so that the unused variables can be removed and data can be tightly packed. This also makes LinkedUniform easier to maintain as a simple struct with basic data types. With this change, LinkedUniform size is reduced from 108 bytes down to 60 bytes, 48 bytes reduction. Given some apps has 200-ish uniforms, this CL reduces 48 bytes x 200 = ~9K memory just for uniforms per program (which goes through hash compute and decompression and file reads). Bug: b/275102061 Change-Id: I7fae20f5b75f3239305e2094a992e3040b8c8e4c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4754133 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.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 025504b9 2022-10-17T17:03:03 Pass worker pools to image load functions In preparation for the ASTC decoder using threaded decoding. Bug: b/250688943 Change-Id: I70d669bcb57b900dbb633304182e174aec362203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3961339 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Greg Schlomoff <gregschlom@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@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 891a4682 2022-05-12T22:32:07 Vulkan: Dynamic state for stencil test/op Bug: angleproject:5906 Change-Id: I436c6c238a15e54919a74d2a697d1f114bb3eaf9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3647207 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Mohan Maiya 3bdbfbf8 2022-03-25T16:34:51 Vulkan: Adjust border color Some border color tests used to fail due to either unclamped color values or not accounting for depth, stencil or luma formats. We now adjust the border color value according to the sampler's format. Test: dEQP-GLES31.functional.texture.border_clamp.* Bug: angleproject:3577 Bug: angleproject:6213 Change-Id: Ib38ce2374622bfafde69fe3fa2d7227d60043954 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3551895 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 158ecba6 2022-01-07T16:40:26 Vulkan: Remove cached Impl pointers from ContextVk. These pointers were a common source of programming error, where sometimes they wouldn't be updated when they were needed. Instead we can pull the objects directly from the GLES state. We added them initially to attempt a performance improvement, but it's likely they didn't significantly decrease memory accesses or the number of instructions we process for GLES calls. Hence removing them should be an improvement in safety without a perf loss. Bug: angleproject:6864 Change-Id: I54107686992065a514077c71d173b804e295515e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3378904 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 1ca1589f 2021-09-13T10:56:58 Give GLES extension bools a vendor suffix. This is in preparation for auto-generation which will give all of these bools suffixes. Bug: angleproject:6379 Change-Id: I7e3f6c9b644c41a2165e6bf7b62d661fd352a250 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3158503 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cheryl Wei 45965e72 2021-06-17T10:21:26 Vulkan: Translate border color's channel by image view format ANGLE implementes some formats as other formats,such as ALPHA8 to R8, this caused some tests failed due to missing border color's channel translation,this change add a new textureBorderLoadFunction to translate channels of border color by image view format. Bug: angleproject:6046 Change-Id: I94ce719b4db3724ffd3dc862b51a412b5d9f3cce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2972328 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
Charlie Lao 24f64249 2020-11-16T17:55:02 Vulkan: Track specialization constant usage bit and feedback to ctx Right now context does not know which specialization constant is used by the shader. Whenever a specialization constant changes, we assume shader program is using it, we always reach into vulkan driver to ask for a new program. Instead we can track shader's usage of specialization constant so that context can utilize this information to avoid recompile pipeline program if an unused specialization constant has changed. This CL implements the plumbing the usage bits form compiler to program object, it does not actually utilize the usage bits to avoid unnecessary compilation yet. Bug: b/173461931 Change-Id: Iebc9d0638c17b1a282c8b6093ce6bae154246e57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2542866 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com>
Charlie Lao 995493cc 2020-11-18T20:33:33 Revert "Vulkan: Remove rotation related data from driver uniform" This reverts commit fd97c3343e9ff23677124b7528ec945bca65796a. Reason for revert: The specialization constant for rotation causes performance regression with older qualcomm driver. We need to keep the driver uniform code path for the older driver. Original change's description: > Vulkan: Remove rotation related data from driver uniform > > Rotation is now handled in the shader compiler with specialization > constant, it should be removed from driver uniforms. Since Metal is > using the flipXY, flipXY/negFlipXY are still kept in the shader side > implementation, but have moved to TranslatorMetal in this CL. > > Bug: b/171750979 > Change-Id: Ie8d15ef227cb52a6e19e4319ecc9f09bda42e667 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519863 > Reviewed-by: Ian Elliott <ianelliott@google.com> > Reviewed-by: Tim Van Patten <timvp@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Commit-Queue: Charlie Lao <cclao@google.com> TBR=ianelliott@google.com,timvp@google.com,jmadill@chromium.org,cclao@google.com Bug: b/171750979 Change-Id: Iff9cffb28851ade1d9c5cd23fde73910a19867ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2547808 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@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>
Charlie Lao fd97c334 2020-11-12T11:05:40 Vulkan: Remove rotation related data from driver uniform Rotation is now handled in the shader compiler with specialization constant, it should be removed from driver uniforms. Since Metal is using the flipXY, flipXY/negFlipXY are still kept in the shader side implementation, but have moved to TranslatorMetal in this CL. Bug: b/171750979 Change-Id: Ie8d15ef227cb52a6e19e4319ecc9f09bda42e667 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2519863 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
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 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>
Jamie Madill d50151d3 2019-12-17T13:57:12 Move Serial utils to their own file. This will let the front-end access them without pulling in the rest of renderer_utils. The Serial class in particular will be useful for capture/replay. Also adds a very minimal unit test. Bug: angleproject:4223 Change-Id: I9e63b8a8227a245b20a8f024b960fcf60c7840db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954611 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@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>
James Darpinian 7e48c9eb 2019-08-06T17:17:19 Add explicit integer casts WebKit uses the -Wshorten-64-to-32 flag which warns on these cases. Bug: 3439 Change-Id: I8c1de60da0f173ca2036e2120e79b857f5f2775f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1740866 Commit-Queue: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
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>
James Dong 08b56293 2019-06-10T12:55:36 Vulkan: add LINE_LOOP with primitive restart Adds support for GL_LINE_LOOP with primitive restart. Bug: angleproject:3215 Change-Id: Ief1bdf15ef9b108dba025eaf4ce580bba54af623 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1649351 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Cody Northrop f7106d16 2019-05-30T17:34:42 Revert "Revert "Vulkan: Use atomics in SerialFactory."" This reverts commit 35fa85ba2fafa583bd706b64d181f3f95094325d. Reason for revert: This commit was an innocent bystander. The bugs are intermittent, requiring multiple runs to verify. Bug: angleproject:3492 Change-Id: Idc9dcb1631cfca5fea342266c732732c6f2bd2d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1636263 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 35fa85ba 2019-05-29T15:59:13 Revert "Vulkan: Use atomics in SerialFactory." This reverts commit 1b0f79ee92b51122634fca6342876db196b85e3c. Reason for revert: Breaks a number of applications on Android Original change's description: > Vulkan: Use atomics in SerialFactory. > > This allows serials to be generated from multiple threads without locking for > very little/no cost. > > BUG=angleproject:2464 > > Change-Id: Id61d170e7a985c3100da0057156859ffcb083dad > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516514 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=geofflang@chromium.org,syoussefi@chromium.org,jmadill@chromium.org Change-Id: I52011f294d68490998869fa898e929fd41eaa51c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1636272 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Geoff Lang 1b0f79ee 2019-02-28T11:08:21 Vulkan: Use atomics in SerialFactory. This allows serials to be generated from multiple threads without locking for very little/no cost. BUG=angleproject:2464 Change-Id: Id61d170e7a985c3100da0057156859ffcb083dad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1516514 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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 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 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>
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 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 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>
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 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>
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>
Corentin Wallez f0e89be6 2017-11-08T14:00:32 Use packed enums for the texture types and targets, part 1 In OpenGL there are two enum "sets" used by the API that are very similar: texture types (or bind point) and texture targets. They only differ in that texture types have GL_TEXTURE_CUBEMAP and target have GL_TEXTURE_CUBEMAP_[POSITIVE|NEGATIVE]_[X|Y|Z]. This is a problem because in ANGLE we use GLenum to pass around both types of data, making it difficult to know which of type and target a variable is. In addition these enums are placed somewhat randomly in the space of OpenGL enums, making it slow to have a mapping from texture types to some data. Such a mapping is in hot-code with gl::State::mTextures. This commit stack makes the texture types and target enums be translated to internal packed enums right at the OpenGL entry point and used throughout ANGLE to have type safety and performance gains. This is the first of two commit which does the refactor for all of the validation and stops inside gl::Context. This was the best place to split patches without having many conversions from packed enums to GL enums. BUG=angleproject:2169 Change-Id: Ib43da7e71c253bd9fe210fb0ec0de61bc286e6d3 Reviewed-on: https://chromium-review.googlesource.com/758835 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill f2f6d379 2018-01-10T21:37:23 Vulkan: Add PipelineDesc. The PipelineDesc class is a 512-byte packed description of the entire Vulkan pipeline state. It uses the alignas keyword and some static asserts to verify that the structures are packed. This ensures that when ANGLE uses MurmurHash to hash the entire struct, and memcmp to check for identity, that there are no garbage padding bits. This CL does not implement the Pipeline cache, but it will help, since now we have a packed type that can be used as the key to a hash map. Bug: angleproject:2163 Change-Id: I16efa927f08d30d89a9c4c8943edd211c6878ac8 Reviewed-on: https://chromium-review.googlesource.com/829893 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
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 5ad26408 2017-10-17T15:32:06 Add destructor to MultisampleTextureInitializer. This was generating a warning for missing virtual destructor in some configurations. BUG=angleproject:2167 Change-Id: I05e335de4ab1160c6066665d588b50527ea34cbd Reviewed-on: https://chromium-review.googlesource.com/723980 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Jamie Madill 9959f544 2017-09-12T15:22:56 Cleanups to ResourceSerial. Allow for "empty" bindings, which are valid but represent when no object is bound. BUG=angleproject:2052 Change-Id: I0a41d1f0db3f5736e9e8f8ca3a74f41b748fd2d2 Reviewed-on: https://chromium-review.googlesource.com/659225 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 0e7f1736 2017-09-09T23:32:50 D3D: Only scan cached shader executable lists once. Any time we would query ProgramD3D for a particular vertex or pixel shader, we would iterate over all the cached shaders of the program looking for the matching input or output layout signature. This change makes it so we only compute the index of the matching shader once, and subsequent calls will re-use the shader index. This should speed up the draw call benchmarks. Also include a fix to the Serial class that initializes a Serial value to an invalid sentinel value. This ensures that comparing any other Serial (including another invalid serial) to the invalid serial will return not-equals. BUG=angleproject:1155 Change-Id: I7d913bf08d0bedf6155eae0661b2a5fa94565cc9 Reviewed-on: https://chromium-review.googlesource.com/648730 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill fb05bcba 2017-06-07T15:43:18 Move the vk Serial class to renderer_utils. This can be useful for other back-ends, for various types of state management. Also redesign the class to use an opaque factory instead of an increment operator. The class maintains the property of being ordered. Also assume we don't overflow with 64-bit serials. We could maybe redesign this to use 32-bit serials for memory constrained situations, and handle overflow more gracefully. I plan to use the serials to track state revisions for the vertex array class, to avoid doing redundant work. BUG=angleproject:1156 Change-Id: I02c78b228bc6e2fb3ee786fe67a4e607baaca18e Reviewed-on: https://chromium-review.googlesource.com/529704 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill dcc9b51d 2017-06-05T15:28:45 D3D11: Consolidate input layout application. This merges all calls to IASetInputLayout to a single place in StateManager11. This means we no longer have to invalidate the state for D3D11, and can always lazily apply the input layout state. Introduces a new ResourceSerial class to replace the uintptr_t and DirtyPointer design. BUG=angleproject:2052 Change-Id: I76b874218b754395f25a129967c769b1f8f82115 Reviewed-on: https://chromium-review.googlesource.com/523025 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill abaab233 2017-01-10T12:37:37 Vulkan: Introduce vk::Format. BUG=angleproject:1319 Change-Id: I88bcc6caa5d29565728848bada1563e47e383b29 Reviewed-on: https://chromium-review.googlesource.com/367753 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: 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 b2e4863c 2016-08-09T18:08:03 Replace std::map with switch in load functions. BUG=angleproject:1455 Change-Id: Ica74ea5503efc0315bc4d98aa322da523a30b24c Reviewed-on: https://chromium-review.googlesource.com/367696 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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>
Jamie Madill a5b1561e 2016-08-09T11:10:27 Place format info in angle::Format. Some bits of information, like the copy functions and mipmap gen functions, can be shared across back-ends in the angle::Format class. Also name the info struct angle::Format, and use an enum class angle::Format::ID to identify the particular format. This patch introduces a new table generator for angle formats and updates the D3D11 generator accordingly. BUG=angleproject:1455 Change-Id: I13b8b98822b1186c6a9e436dc232c18fef50980c Reviewed-on: https://chromium-review.googlesource.com/365824 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>