src/libANGLE/Context.cpp


Log

Author Commit Date CI Message
Chris Dalton cc841237 2024-11-29T13:45:50 Accept framebuffer modifications while PLS is active The only way for a WebGL implementation to know if PLS is actually active is to call glGetIntegerv(PIXEL_LOCAL_STORAGE_ACTIVE_PLANES_ANGLE) (because glBeginPixelLocalStorageANGLE() can fail). So the original behavior of not allowing glBindFramebuffer() et. al. while PLS was active created a state scenario that was expensive for the browser to track. Instead, just allow glBindFramebuffer() et. al., and implicitly disable PLS if they are called while it's active. Bug: angleproject:40096838 Change-Id: Ibd303f9f9950fb5b7f1add2d41882e4379c51e62 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6060301 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 0bb109aa 2024-11-28T00:00:00 Fix validation for 2D multisample array textures * Fixes: * TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY query must be rejected if the functionality is not enabled. * GetInternalFormativ must accept TEXTURE_2D_MULTISAMPLE_ARRAY on unextended OpenGL ES 3.2 contexts. * Added validation to the OpenGL ES 3.2 TexStorage3DMultisample entry point. * Cleanups: * Removed OES suffix from the enum conversion. * Incorrect extension name in the error message. * Do not create a 2D multisample array zero texture object if the backend does not support the functionality. * Replaced redundant FramebufferTexture validation with an assertion. * Do not allocate texture binding vectors for 2D multisample array textures if the backend does not support the functionality. * Aligned the 2D multisample array texture target assert in RecordBindTextureTypeError with the actual error condition. Fixed: angleproject:381270278 Change-Id: Idbbc86e2efe1bbc25d9570d515b67c1a32255d99 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6063068 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton 7070a9e9 2024-11-20T00:21:16 Remove draw buffer validation clauses from PLS It was cumbersome to implement all this validation browser side for WebGL. Rather than making it an error to update blend and color mask on reserved PLS draw buffers, glBeginPixelLocalStorageANGLE() can just implicitly disable blend, and enable the color mask on overridden draw buffers. Later calls to enable blend or change the color mask on overridden planes are silently ignored until glEndPixelLocalStorageANGLE(). Bug: angleproject:40096838 Change-Id: Ic7e1c5113e7d3fad3b80d0178075df646540d743 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6045421 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Xinyu Fang 5d3d299d 2024-11-25T16:35:51 Expose the required GLES1.0/1.1 extensions in ANGLE Exposed below extensions: GL_OES_texture_mirrored_repeat GL_OES_blend_subtract Bug: angleproject:380704155 Change-Id: Ib095f9bfaabda92bb2c588d633f1512e118f066e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038450 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Neil Zhang 01dee1cb 2024-10-14T15:04:28 Add implementation for GL_EXT_texture_storage_compression Bug: angleproject:352364583 Change-Id: I3dab4c68d5d0206d681e165e991217bd3de8eeb6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6011055 Auto-Submit: Neil Zhang <Neil.Zhang@arm.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Alexey Knyazev 52fa6779 2024-11-14T00:00:00 Refactor indexed parameter query validation * Moved indexed parameter validation to queryutils. * Fixed indexed blend state enums being disallowed on unextended OpenGL ES 3.2 contexts. * Replaced redundant validations with assertions. Fixed: angleproject:380291906 Change-Id: I4d5a9c01be5a00cd834504b38a3ddaeb5fa4edb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6043710 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev 9c202275 2024-11-14T00:00:00 Fix SAMPLE_MASK_VALUE indexed query validation The SAMPLE_MASK_VALUE enum must be accepted when ANGLE_texture_multisample is enabled. Fixed: angleproject:380291919 Change-Id: Ieb834ca4c78982fbf1a121c0a70db7413574679a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6038524 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Neil Zhang 8a2b60b2 2024-11-06T17:13:16 Add stubs for GL_EXT_texture_storage_compression Bug: angleproject:352364583 Change-Id: I607c19c0c9bec7f0e3dd325e44b42e73f826b61c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5998012 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Roman Lavrov cc2edfd1 2024-11-05T15:37:21 Fix getPerfMonitorCounterData maxResults, skip AsyncCommandQueue test Skips TextureDataInLoopManyTimes on SwS AsyncCommandQueue. Add more debug info to the test although without the AsyncCommandQueue variant we likely won't be see flakes. Bug: angleproject:377503738 Change-Id: I372531451c280b04ffed84b020463657440fca08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5995531 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Roman Lavrov <romanl@google.com>
Solti 02f88b31 2024-10-30T21:49:19 Improve CanSupportAEP Error Reporting This change improves the error reporting for the `CanSupportAEP` function. Previously, if the function returned false, it was difficult to determine which requirement was not met. This change adds logging that will list all unmet requirements, making it easier to debug AEP support issues. For Chromium logs, this logging is too much. Therefore, a switch is used and by default the logging is off. ref: https://crrev.com/c/5979208?tab=comments Test: the default presubmit Bug: b/268108262 Change-Id: I7f633cdb63f9cfeb501cd5f134b0ea7874465aed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979292 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 63f5a328 2024-10-30T14:40:40 Revert "Improve CanSupportAEP Error Reporting" This reverts commit fb655e43f4a86fbdf35bf0cb5d2978d728b949d9. Reason for revert: Causes excessive logging and leads to flakiness in Chromium Original change's description: > Improve CanSupportAEP Error Reporting > > This change improves the error reporting for the `CanSupportAEP` > function. Previously, if the function returned false, it was difficult > to determine which requirement was not met. This change adds logging > that will list all unmet requirements, making it easier to debug AEP > support issues. > > Test: the default presubmit > Bug: b/268108262 > Change-Id: I48eb6b26358ca4991d760523f44568d97e8c35a6 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972497 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Solti Ho <solti@google.com> > Reviewed-by: Yuxin Hu <yuxinhu@google.com> Bug: b/268108262 Bug: chromium:376380430 Bug: chromium:40266306 Change-Id: Ic5b1bbce16fe5c98af10ca0554d1035206d5c592 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5979208 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Solti fb655e43 2024-10-28T21:45:41 Improve CanSupportAEP Error Reporting This change improves the error reporting for the `CanSupportAEP` function. Previously, if the function returned false, it was difficult to determine which requirement was not met. This change adds logging that will list all unmet requirements, making it easier to debug AEP support issues. Test: the default presubmit Bug: b/268108262 Change-Id: I48eb6b26358ca4991d760523f44568d97e8c35a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5972497 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Solti Ho <solti@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Amirali Abdolrashidi ef55ca0a 2024-10-17T14:44:22 Update copy validation regarding ext textures * Updated the validation functions for the following function to accept TEXTURE_EXTERNAL_OES: glCopyImageSubDataEXT() * Updated unit test CopyTextureTestES3.CopyImageSubDataToEGLImage * Using TEXTURE_EXTERNAL_OES as target for glFramebufferTexture2D() requires EXT_YUV_target. Therefore, the texture related to it is used instead. Bug: angleproject:361372990 Change-Id: I905d4cf89522ae3158516b42b15705d1044c6e97 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5940404 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev ab1cdd22 2024-10-03T00:00:00 Translator: Support EXT_texture_query_lod No backend support yet. Bug: angleproject:368275901 Change-Id: I10bbc03feca485908315633cbc0f955e82994657 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5920240 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski c9606f00 2024-10-07T10:15:14 Fix extensions moved to core in GLES 3.2 The GL_EXT_texture_cube_map_array, GL_EXT_texture_buffer, and GL_OES_texture_storage_multisample_2d_array extensions were moved into core in ES3.2, but validation still required enabling extensions. Added 3.2 as a sufficiency. Test: angle_end2end_tests --gtest_filter=*CompressedTexImageCubeMapArray* Bug: b/371940347 Change-Id: Ie73a76087b6b52775d44ae79efd7f48e9fc90eb9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912120 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Shahbaz Youssefi aec90a8d 2024-10-07T10:56:24 Fix ignoring blit bits when attachments are missing GLES requires that the bits provided to glBlitFramebuffer are silently ignored if either the read or draw framebuffer is missing the corresponding attachment. In WebGL, this is forbidden. ANGLE was forbidding this because of WebGL, but a recent CTS test revealed that we shouldn't be doing that when !WebGL. Bug: angleproject:370917919 Change-Id: I202fbf665d8a102f0aea72709b80dfdabeb71a2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5912614 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 166b72c9 2024-09-30T19:07:26 GL_ANGLE_blob_cache implementation. Bug: chromium:370538323 Change-Id: Ic51a951e78b48b315e36f518bcc39ff2d54660a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5900761 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 492cf265 2024-09-27T13:44:22 Stubs for GL_blob_cache_angle Bug: chromium:370538323 Change-Id: Ib56b28c24305db8931f382b16a24975b7277fa7e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5900760 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop c99f1106 2024-10-05T17:21:37 Debug: Allow forcing GL_RENDERER and GL_VENDOR It can often be useful to force the GL_RENDERER and GL_VENDOR strings to values recognized by applications. Bug: b/371749458 Change-Id: I045a76e733e1b59ad257caceed396847abf3d7fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5910908 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi b16d105f 2024-10-03T10:25:32 Remove Desktop GL front-end support For Desktop GL applications, please use Zink! Bug: angleproject:370937467 Change-Id: Ie734634bb62a2e98c80e1b32d8b3d34624da3c04 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5905428 Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 7c811715 2024-09-25T11:09:44 Vulkan: fix crash when clearing stencil with ClearBuffer Follow up to [1] which fixed a crash with glClear, but the bug remained with glClearBufferiv. This change refactors the "is stencil write masked out" query to always take the framebuffer's stencil bit count into account (practically always 8), which also happens to make the rest of the code checking this query more accurate in the presence of nonsense masks where the bottom 8 bits are 0. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/3315158 Bug: chromium:40207259 Bug: angleproject:42266334 Change-Id: I68a6b0b75c67ed2cdc8c4d03b243efe5495efce1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5889788 Reviewed-by: Geoff Lang <geofflang@chromium.org> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 05c62ebc 2024-09-24T13:41:57 Fix check for whether stencil write is masked out The stencil write mask is the only thing that decides what bits get written to. Previously, this was masked with the reference bitmask to determine if any bits get written to, which is incorrect. The effect of this was that the Vulkan backend would use the READ_ONLY layout for the depth/stencil attachment even though stencil could have been written to the attachment. Bug: angleproject:42266334 Change-Id: Ice6a35f4691fc8e09c7d5e1db6439c3079dfa039 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5887905 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Chris Dalton 966739ac 2024-09-19T23:49:06 Drop PLS support for EXT_shader_pixel_local_storage Supporting this backend drastically increased the complexity of the codebase, with little return. We don't support memoryless attachments on the web anyway, and since this extension requires us to literally draw the load/store operations, input attachments on Vulkan perform better. Once this implemention is completely removed, we will delete the PLS allow list, which isn't required for the other PLS implementations. Bug: angleproject:7279 Change-Id: Ibb036d36cbd33467e7a94398ce171cda7349e4f4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5874412 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Chris Dalton <chris@rive.app>
Amirali Abdolrashidi e38d25b1 2024-06-21T18:22:32 Vulkan: Implement EXT_clear_texture * Added new functions to TextureVk to clear the image. * clearImage() * clearSubImage() * Both implemented via clearSubImageImpl(), with the former a special case of the latter. * For multisample or renderable images, stagePartialClear() from ImageHelper is called to add the update. * For single-sampled non-renderable images, a buffer is filled with the pixel data and applied to the image as a buffer update. * Added new update type: ClearPartial * Used for renderable textures. This includes multisample textures. * LOAD_OP_CLEAR is used in a render pass to perform the clear. * UtilsVk::clearTexture() * (Uses ClearTextureParameters) * Uses the following functions to get the VkClearValue from the input data and format: * GetVkClearColorValueFromBytes() * GetVkClearDepthStencilValueFromBytes() * ClearPartial updates can also be superseded and removed similar to Buffer updates. * Updated UtilsVk::startRenderPass() to accept a VkClearValue* as an input arg. If used, the render pass will use LOAD_OP_CLEAR. * Enabled the feature "clearTextureEXT" on Vulkan. * Added new unit tests in ClearTextureEXTTest for various formats and pixel sizes. * Added related multisample tests in FramebufferTest.cpp. * FramebufferTest_ES31.ClearTextureEXT* * Disabled some of the new tests failing using OpenGL. * Disabled stencil-only-related tests on Pineapple. Bug: angleproject:42266869 Change-Id: I89c631d68a4ed63d9991abe1783333255ade20dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5778348 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 3f89dfc2 2024-08-20T17:31:43 Update validation for EXT_clear_texture * Added the validation condition that the texture level to be cleared should have been defined beforehand. * Added the condition to clearTexSubImage() at the frontend to return if any clear extent was zero. * In the validation tests, added checks for the following: * Clearing a texture level before defining it. * Clearing a compressed texture, which is not allowed. * Added setConfigAlphaBits() to ClearTextureEXTTest setup. * Replaced EXPECT_PIXEL_COLOR_EQ with EXPECT_PIXEL_RECT_EQ for ClearTextureEXTTest tests for better coverage. Bug: angleproject:42266869 Change-Id: Ieeb49e9005eba6ef9156d49ff46c71cdf4f04162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5801655 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Alexey Knyazev b98e6bc0 2024-09-12T00:00:00 Translator: Add EXT_texture_shadow_lod functions Added translator support for functions defined in the GL_EXT_texture_shadow_lod extension. Trivially enabled on GL and Vulkan backends. Bug: angleproject:365066518 Bug: angleproject:365108862 Change-Id: Ie1fc8f50e321a559d4506c479d9cebbb48802091 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5867416 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang da572160 2024-07-23T16:36:10 Reland: GL: Forward client-side arrays to the driver when possible The OpenGL driver can handle client-side arrays when the context is OpenGL ES or a desktop GL compatibility profile. When in these situations, use the driver default VAO for all frontend context VAOs and forward client-side data directly to the driver. Fix synchronizing the default VAO state for external contexts. There is no valid VertexArrayStateGL for external VAOs so make sure it's nulled and the VAO dirty bits are set so the correct VAO state is reapplied. Disable syncing to the default VAO for external contexts. The only VAO that they can share with ANGLE's internal state is the default VAO so avoid having to save and restore its state. Bug: angleproject:355034686 Change-Id: I015bbbc854938fe4bc1e92d0ca8fe04628d0db16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5743284 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 6fddb18d 2024-07-26T12:44:23 GL: Disable heavily emulated extensions for non-WebGL. The multidraw and base vertex base instance extensions are heavily emulated in ANGLE's GL backend, manipulating vertex arrays multiple times per draw. This is often a performance improvement for deep pipelines such as WebGL but slower for shallow stacks like Chrome's rasterization. Mark these extensions as "emulated" and disable them in the frontend for non-WebGL contexts. Only EXT_base_instance can have true native support. Add a frontend feature to re-enable these extensions and use it in the existing end2end tests. Bug: angleproject:355645824 Change-Id: I897559fb270e2aa0f476d7784d25d97574e28f43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5743837 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang fcf3a1c0 2024-07-02T16:33:28 GL: Allow shader compilation with cached translated source Write the translated shader source when serializing shaders. This does not increase the size of the shader cache because Vulkan only uses the compiledBinary field. Spawn a ShaderTranslateTask for loading shaders so the GL backend can compile the shader on the native driver. Bug: angleproject:350779978 Change-Id: I14413a7ca2a0d99653a1082f2c8b4a94cf58626a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5672740 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 48969c95 2024-05-31T16:34:07 GL: Implement QCOM_tiled_rendering Bug: angleproject:343900918 Change-Id: I01612e11795d7aa8ee20f6e9bd5ef62fe40e2910 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588630 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 3f572905 2024-06-19T17:46:38 Add basic begin/end support for perf counters The AMD_performance_monitor extension has explicit begin/end calls to capture counters. This was not implemented in ANGLE and the tests were relying on ANGLE always capturing counters (incurring a small overhead). This change does not complete the implementation of that extension, but does add basic support for starting and stopping perf counter measurements. While inactive, most counters are not updated. Bug: angleproject:42267038 Change-Id: I3ff6448b22ca247c217401cb2d76ef4142c9d759 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5639343 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Geoff Lang 92148c2c 2024-06-17T11:13:46 GL: Implement GL_EXT_clear_texture. This extension is useful because it allows clearing textures without changing the framebuffer. Chrome uses this on Android when it's available. Bug: angleproject:347047859 Change-Id: I765d9991c4549b3655446d9f51847d1095792dbd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5631810 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Cody Northrop 1917377f 2024-06-07T17:02:33 Capture/Replay: Write comments to the capture Useful for tracking why things are happening in the frame, from the perspective of the tracer. Allows for entries like this: // DEBUG: AttachShader called, checking for IDs; glAttachShader(gShaderProgramMap2[6943], gShaderProgramMap2[1531]); // DEBUG: AttachShader called, checking for IDs; glAttachShader(gShaderProgramMap2[6943], gShaderProgramMap2[1511]); Good for debugging or knowing we've skipped invalid/unsupported calls. This CL includes one use of comments to mark calls we've skipped, meaning the app or ANGLE submitted them, but omitted from capture. Bug: angleproject:345851268 Change-Id: Ied917c7480704afc3fdfb8cbb617b323eb7403a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3233876 Reviewed-by: Mark Łobodziński <mark@lunarg.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 2d8e15f8 2024-05-31T14:25:12 Add stubs for GL_QCOM_tiled_rendering Bug: angleproject:343900918 Change-Id: I77d742949565ebfecb5f4446db3510af4f94033c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5588629 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Amirali Abdolrashidi ebb56cee 2024-05-31T15:10:37 Implement OES_tessellation_shader Based on the specs, there are no functional differences between OES and EXT. * Added validation for glPatchParameteriOES() and the core glPatchParameteri(). * Added the extension support for GLSL. * EXT_shader_io_blocks is implicitly enabled for the EXT geometry and tessellation shader extensions. * OES_shader_io_blocks is implicitly enabled for the OES versions of said extensions. * Added a test to make sure using this extension works instead of EXT. * Turned the repeated test code into a function: * testTessellationTextureBufferAccess * Skipped the tests that fail on various platforms. * It seems that these tests were being skipped before enabling this extension ("Not supported"). Bug: b/344030760 Bug: angleproject:345306326 Bug: angleproject:345304850 Bug: angleproject:345312771 Change-Id: I905da0132bf6525cb453dcaa613e4deb3155c4dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595611 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi 25374c90 2024-05-31T16:08:58 Implement OES_gpu_shader5 Based on the specs, there is no difference between the OES version and the EXT version. * Added support for use in shaders * Added test to make sure the OES extension works. * Turned the repeated test code into a function: * testArrayOfArrayOfSamplerDynamicIndex() Bug: b/344031022 Change-Id: Ifda4fa5495983d254f598940a95d0797e8a9ce67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5595609 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Amirali Abdolrashidi 1fa6c020 2024-05-28T14:44:09 Vulkan: Add multisample line width query support * As part of GLES 3.2 support, added support to query the following through glGetFloatv(): * GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY * GL_MULTISAMPLE_LINE_WIDTH_RANGE * Added some tests to check the limits of the values above. * Updated comment regarding ES 3.2 spec table number. Bug: angleproject:42266081 Bug: b/336860504 Change-Id: I2c359bbb9003b3e76f342f7419477bdb1caaf88f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5576760 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Geoff Lang cbeaebf1 2024-05-13T17:53:25 eglCreateContext: always fail for invalid versions Since error generation can be disabled in EGL, it's not always possible for a client to detect if a context client version is valid. Always validate the context version after resolving backwards compatible versions so that the application can handle unsupported versions. Bug: chromium:339948886 Change-Id: I438fa1fcf5160a491f2b996797c29c69b1ab71b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5533776 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi a1665d2f 2024-05-10T00:15:31 Reland "Document thread-unsafe iterator access to resource maps" This is a reland of commit d1bb6ed8399dd12e79484f30f9e9ded95c25625a The crash was due to another issue (disabling EGL validation in Chrome) Original change's description: > Document thread-unsafe iterator access to resource maps > > By using a proxy type, everywhere resource maps are iterated are clearly > marked as not being thread safe. In most cases, only destruction and > capture/replay iterate over these maps, which means thread safety is not > an issue (or is externally enforced). > > The only case where iterators are used in the presence of other contexts > is with ANGLE_request_extension, which is changed to explicitly require > the application to ensure thread safety. In practice, the user is > Chrome which already guarantees this. > > Bug: angleproject:8667 > Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:8667 Change-Id: Id539cabac01df5f242150f6684222577003eef3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5531278 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 4e887491 2024-05-11T18:08:03 Revert "Document thread-unsafe iterator access to resource maps" This reverts commit d1bb6ed8399dd12e79484f30f9e9ded95c25625a. Reason for revert: Checking to see if it's the reason for crbug.com/339948886 Original change's description: > Document thread-unsafe iterator access to resource maps > > By using a proxy type, everywhere resource maps are iterated are clearly > marked as not being thread safe. In most cases, only destruction and > capture/replay iterate over these maps, which means thread safety is not > an issue (or is externally enforced). > > The only case where iterators are used in the presence of other contexts > is with ANGLE_request_extension, which is changed to explicitly require > the application to ensure thread safety. In practice, the user is > Chrome which already guarantees this. > > Bug: angleproject:8667 > Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 > Reviewed-by: Charlie Lao <cclao@google.com> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> Bug: angleproject:8667 Change-Id: I1245c9e57dfeb27a7f0e5718b1455614c70bc0dc No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5532187 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d1bb6ed8 2024-05-10T00:15:31 Document thread-unsafe iterator access to resource maps By using a proxy type, everywhere resource maps are iterated are clearly marked as not being thread safe. In most cases, only destruction and capture/replay iterate over these maps, which means thread safety is not an issue (or is externally enforced). The only case where iterators are used in the presence of other contexts is with ANGLE_request_extension, which is changed to explicitly require the application to ensure thread safety. In practice, the user is Chrome which already guarantees this. Bug: angleproject:8667 Change-Id: I7af13c6433b6955d9c36f9088b3aa4c065e1cfc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526428 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi c3a1cae4 2024-04-15T14:58:55 Use angle::SimpleMutex everywhere in libGLESv2 Only cases left that use std::mutex are: - Share group and the context ErrorSet mutexes as they need try_lock() - Anywhere mutexes are used in conjunction with std::condition_variables (as they explicitly require std::mutex) Bug: angleproject:8667 Change-Id: Ib6d68938b0886f9e7c43e023162557990ecfb300 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5453294 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi d9943e44 2024-04-09T23:53:48 Remove Program::syncState The last bit of responsibility still left in Program::syncState was to wait for post-link tasks for the sake of EGLBlobCacheTest tests. A new extension, GL_ANGLE_program_binary_readiness_query is created so that the wait can be done in the test itself. This extension is ultimately useful for applications as well, so they can avoid blocking the CPU by calling glGetProgramBinary prematurely. Bug: angleproject:8297 Change-Id: Ied6b755cb9b060198f82c7948bfd03441435a578 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5440302 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com>
Amirali Abdolrashidi 4d317b52 2024-03-22T15:48:51 Vulkan: Add MSRTSS preferred usage for tex init The image create flag related to multisampled render to single- sampled was used when this feature flag was enabled. However, this could lead to some platforms allocating extra memory for the image, even if the image did not use this feature. In this change, a new feature is added regarding whether to prefer this flag from the start. If disabled, ANGLE will only use this bit for the texture if it is actually bound to an MSRTT framebuffer object (through FramebufferTexture2DMultisampleEXT()). * Added a new feature: preferMSRTSSFlagByDefault * If enabled, the MSRTSS is used for all image inits. * (TextureVk::initImage()) * Otherwise, it will create the image without the flag at first. * Added member to texture frontend to track if the texture has been bound to an MSRTT framebuffer. * mHasBeenBoundToMSRTTFramebuffer * During TextureVk::syncState(), if the image without the MSRTSS bit is bound to an MSRTT framebuffer, it is recreated using the MSRTSS flag. * Checked in respecifyImageStorageIfNecessary(). Bug: b/329911999 Bug: angleproject:8622 Change-Id: I5e7d43e3828ae272441d65b2be35d09b23b68f84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5402978 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Shahbaz Youssefi ad013650 2024-03-22T03:42:44 Revert "Rename LinkSubTask -> PostLinkTask" This reverts commit 00eb6edba074a22389b09990ab856adfd417dd64. Reason for revert: Sub tasks are not actually post-link tasks for all the other backends (other than Vulkan), but they are a real part of the link job. Original change's description: > Rename LinkSubTask -> PostLinkTask > > This is a renaming change, no behavior changes are expected. > > Bug: angleproject:8297 > Change-Id: I734c7959f5ed6db2447853cc6f6256e3c8e86213 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5382224 > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:8297 Change-Id: Iaebf9d165d810344bfc524042206ca427d270034 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386432 Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski f3a819f1 2024-03-21T08:12:09 Context: Limit max texture size for ANGLE captures Tracing Poppy Playtime generates glTexStorage2D calls with widths exceeding P7 capabilities, so limit GL_MAX_TEXTTURE_SIZE to 16k for wider compatibility. Bug: b/330696626 Change-Id: Icfbfce1c8b59941bc5c6911aaba31fea43976cef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5385681 Commit-Queue: Mark Łobodziński <mark@lunarg.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Mohan Maiya 00eb6edb 2024-03-20T06:49:38 Rename LinkSubTask -> PostLinkTask This is a renaming change, no behavior changes are expected. Bug: angleproject:8297 Change-Id: I734c7959f5ed6db2447853cc6f6256e3c8e86213 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5382224 Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang c3fdc811 2024-03-14T14:20:43 Raise the WebGL texture size limit on Android >= 14 The previous limit of 4096 is overly restrictive for newer devices that can have screen sizes close to or greater than 4096. Bug: angleproject:8611 Change-Id: If453b7e0c6e2af218b65a631821b441330a50b69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370399 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya b978974d 2024-03-03T10:48:48 Update frontend support for QCOM foveated extensions Modifications to frontend support - 1. EXTENDED_DIRTY_BIT_FOVEATED_RENDERING is removed 2. New framebuffer attachment API - getFoveationState 3. Attachment type restriction for foveated rendering is removed 4. Addition of new test - RenderbufferAttachmentClearThenDraw Bug: angleproject:8484 Change-Id: I699cbed81346c9a6344c4ff36afa51d6cc1bf052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5338529 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4e6fe5e0 2024-02-29T15:01:06 Vulkan: Cache ImageLoadContext in context This avoids the need to requery this from the display every time. Bug: angleproject:8564 Change-Id: Ied650e7789741f59b7662c0f97c55132b105778d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5332074 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Mark Lobodzinski 6f2daf05 2024-02-26T16:31:58 Context: Limit max vtx uniform vectors to 256 during capture To ensure compatibility with Pixel 4/5, GL_MAX_VECTOR_UNIFORM_VECTORS should be set to 256 during capture. Bug: b/326199738 Change-Id: Ic7228322b4ed19949a9669cf0719fffa1a86f577 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5329326 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Mohan Maiya d05c9a5e 2024-01-25T13:01:49 Frontend support for QCOM foveated extensions Add frontend state management to support foveated rendering extensions. Bug: angleproject:8484 Test: Texture2D*Foveation* Change-Id: I0e1be9f11b2d442207674562da760f5bfd7debc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5208091 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: mohan maiya <m.maiya@samsung.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi ecc35205 2024-01-25T23:58:25 Move uniform block dirty bits to State When glUniformBlockBinding changes the mapping from a program uniform block to a buffer binding, all contexts in the share group need to reprocess the affected block index. Prior to this change, the dirty bits that indicated which blocks have their mapping redefined were placed in the program executable, and were reset by the first context that processed them. As a result, the other contexts in the share group where not aware of such modifications. Similarly, when a buffer changed in one context, the mapped program blocks were marked dirty, with similar cross-context issues. In this change, the dirty bits are moved to State, so every context would react to these changes. Bug: angleproject:8493 Change-Id: I5712002224cbc4a576bf2ac46e8e75f26ebc5b2a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5238991 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 0c4d6446 2024-01-24T10:38:45 Rework uniform block <-> uniform buffer mapping In GLES, the shader declares which buffer binding a block (uniform, storage or atomic counter) is bound to. For example: layout(binding = 1) uniform ubo0 { ... }; layout(binding = 2) uniform ubo1 { ... }; layout(binding = 1) uniform ubo2 { ... }; In the above, ubo0 and ubo2 use data from the buffer bound to index 2 (through glBindBufferRange), while ubo1 uses data from the buffer bound to index 1. For uniform blocks in particular, omitting the binding is allowed, in which case it is implicitly bound to buffer 0. GLES allows uniform blocks (and only uniform blocks) to remap their bindings through calls to glUniformBlockBinding. This means that the mapping of uniform blocks in the program (ubo0, ubo1, ubo2) to the buffer bindings is not constant. For storage blocks and atomic counter buffers, this binding _is_ constant and is determined at link time. At link time, the mapping of blocks to buffers is determined based on values specified in the shaders. This info is stored was stored in gl::InterfaceBlock::binding (for UBOs and SSBOs), and gl::AtomicCounterBuffer::binding. For clarity, this change renames these members to ...::inShaderBinding. When glUniformBlockBinding is called, the mapping is updated. Prior to this change, gl::InterfaceBlock::binding was directly updated, trumping the mapping determined at link time. A bug here was that after a call to glProgramBinary, GL expects the mappings to reset to their original link-time values, but instead ANGLE restored the mappings to what was configured at the time the binary was retrieved. This change tracks the uniform block -> buffer binding mapping separately from the link results so that the original values can be restored during glProgramBinary. In the process, the support data structures for tracking this mapping are moved to ProgramExecutable and the algorithms are simplified. Program Pipeline Objects maintain this mapping identically to Programs and no longer require a special and more costly path when a buffer state changes. This change prepares for but does not yet fix the more fundamental bug that the dirty bits are tracked in the program executable instead of the context state, which makes changes not propagate to all contexts correctly. Bug: angleproject:8493 Change-Id: Ib0999f49be24db06ebe9a4917d06b90af899611e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5235883 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya d0f5a662 2024-01-25T13:01:24 Bugfix in entry points for QCOM foveated extensions Change framebuffer and texture parameter type from GLuint to FramebufferID and TextureID types respectively. Bug: angleproject:8484 Change-Id: I822897b268f2dab56cee3f5776c07ad46a6dd052 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5238212 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi b007c74d 2024-01-23T14:17:54 GL: Separate dirty bits leading to glUniformBlockBinding The GL backend is special in that it needs to make actual calls (native glUniformBlockBinding) in response to (application) glUniformBlockBinding calls. The other backends just remap the bindings based on that information when creating descriptor sets. Previously, an optimization to track which bindings have changed used the same dirty bits that were used to signify when the GL backend needs to make these native calls. That ended up as a source of bugs. In a previous change [1], the context DIRTY_BIT_UNIFORM_BUFFER_BINDINGS is set when these mappings change, which fixes some of these issues. That change obviates the need for an actual backend sync of programs, except for GL programs that need to make these native calls. This change splits the dirty bits maintained for the purposes of the GL backend, moves them to that backend and removes the program backend sync. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/5228599 Bug: angleproject:8493 Bug: b/318806125 Change-Id: I73c6514e88a116f1cd701cb06da0d8c38f07f7f6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5230137 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 66de8492 2024-01-23T12:56:30 GL: Fix UBO binding mapping change In the absence of any other state change, the GL backend did not bind buffers (previously unused) that are used after a UBO binding mapping change. This also triggered assertion errors in the Vulkan backend. Additionally, this change improves cross-context programs, though the Vulkan backend is still affected by some bugs. A follow up change will rework the dirty bits for this change to fix that. Bug: angleproject:8493 Bug: b/318806125 Change-Id: I8f0ed4b5f666818f4fda9ec272c6b66419d64638 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5228599 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi fad2adb2 2024-01-12T14:43:33 Vulkan: Fix importing external object and using as storage image The create flags used to create the imported object was 0. Later, when the texture was used as a storage image, TextureVk::syncState would recreate the image (losing connection to external object). This change makes sure the create flags include all the necessary create flags such that the texture can be correctly used as storage image. Bug: angleproject:8464 Change-Id: I6587b53b1c2819a11dec8f2d5a3a30c889a4c63f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5194064 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang f1150231 2024-01-16T16:28:36 Track WebGL buffer type in gl::Buffer state. WebGL has special validation that disallows buffers from changing "WebGL buffer type". Once a buffer is marked as having index data it cannot be bound as any other type of buffer except the copy binding points to copy to other index buffers. This disallows any GPU writes to buffers used for index data. Use this rule to shadow index buffer data when the driver is unable to give us robust access. Index range computation can be done much faster when the buffer does not need to be read back. Bug: angleproject:8434 Change-Id: I059eff732bb2f43234f61d9ef5528289f7698b38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5200242 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Mohan Maiya d093c3d3 2024-01-17T11:33:46 Add entry points for QCOM foveated extensions Add entry points for GL_QCOM_framebuffer_foveated and GL_QCOM_texture_foveated extensions Bug: angleproject:8484 Change-Id: I59053f9be76fbb8eaed344aa460ecb1e178ce7db Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5206990 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi a1143857 2023-12-18T15:24:42 Fix UBO dirty bits vs PPOs This change fixes propagation of UBO dirty bits (such as through glUniformBlockBinding and glBindBufferRange) to program pipeline objects. Since PPOs concatenate the attached programs' UBOs in a list, a map of program UBO indices to PPO UBO indices is introduced to offset these dirty bits appropriately. Additionally, when the program's executable's buffer bindings change (through glUniformBlockBinding), a notification is send to the PPO to update its executable's buffer binding accordingly (which is otherwise only updated during PPO link). Bug: angleproject:8462 Change-Id: I4965ae23e6fc6cac0842e1643755e42e95d3d5cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5131418 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Amirali Abdolrashidi c51259ec 2023-12-14T15:58:56 Vulkan: Ignore tex coord at draw if tex disabled In GLES1, it is possible to disable texture rendering in some cases. It is done using glDisable(GL_TEXTURE_2D). In that case, if TexCoordPointer has been enabled in the client state prior to disabling the texture, its data should no longer be used, especially if the primitive changes to use more vertices. In that case, there is a risk of unauthorized memory access. In this CL, the active vertex attributes are updated accordingly if texture is disabled using the aforementioned API call. * Updated GLES1 renderer to ignore TexCoordPointer if texture has been disabled. * Added GLES1 tests for tex coord pointer, including tests to make sure that tex coord pointer is no longer used if the texture is disabled using glDisable(), and that it is used again when texture is enabled using glEnable(). * To ensure that tex coord pointer is not used, the test draws using enough vertex data that would exceed the texcoord array size, which can trigger segfault if accessed. Bug: b/310688730 Change-Id: I5d259c83a172cc1a11733c0b42c2f9b02c9b2967 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5124259 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 18a68f6d 2023-12-07T16:23:10 Fix vertex attribute limit check Bug: angleproject:8448 Change-Id: Ie5d2b71f0be86b31ec74a1d55501b60a25245668 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5101508 Reviewed-by: Alexey Knyazev <lexa.knyazev@gmail.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Shahbaz Youssefi fb6b960c 2023-11-27T14:24:28 Remove GL_CHROMIUM_texture_filtering_hint This was using an unregistered Vulkan extension to set the precision of SwiftShader's internal filtering for the sake of Chrome. That's baked in at build instead. Bug: angleproject:8349 Bug: chromium:726075 Change-Id: I12849d2d29d99626f22a92ee9d74366f78658476 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5063344 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 3680a5dc 2023-11-17T13:51:07 Vulkan: Let program warmup continue passed link The warmup task does not actually affect the link results, so there is no reason to wait for it when the application queries the link status. This change allows the warm up task to continue in parallel until the program is used at draw time. This allows the warm up to be more efficient when the link itself is not parallelized. For applications that create programs in the middle of every frame, it's still likely best to disable warm up (as the following immediate draw will already effectively do the warm up). Note that currently the warm up code in the Vulkan backend is not completely thread-safe, and so the program still blocks on that task before the first draw can happen (or the program is modified in any way). Bug: angleproject:8417 Change-Id: I0877fef39a0585c3279e32699ce817d4643d7cd6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5037538 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi ade3dacd 2023-11-06T21:56:41 Do compile/link unlocked if not threaded (but thread-safe) If GL_KHR_parallel_shader_compile is not supported, or it is not used to do threaded compilation and link, this change lets the compile and link jobs be done after releasing the share group lock. With multithreaded/multi-context applications, this allows the other context (typically the main context) to make progress in the meantime. A typical scenario where this optimization matters is games seamlessly loading a new area of the game and performing compilation and link in a separate context. Before this change, the game would stutter as the compile/link jobs prevent the main thread from drawing anything. With this change, the hitching is removed. Bug: angleproject:8297 Change-Id: I702d84324a7442561b49677bf42c16d650304313 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5006640 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang 2155534b 2023-11-06T11:49:20 Don't set dirty bits for attribs that are out of range. PrivateState::setAllDirtyBits sets all bits in mDirtyCurrentValues. When the context has fewer max attibutes than MAX_VERTEX_ATTRIBS, this can cause out-of-bounds access to PrivateState::mVertexAttribCurrentValues if the dirty bits are iterated over without range validation. Bug: chromium:1496378 Change-Id: I65481c432263a6e353a9361bba741b97dc5e20b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5008034 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Dan Glastonbury 562d4be3 2023-10-20T14:33:05 Clear pending program linking in Context::onDestroy When destroying Context, ANGLE resets any internal state before releasing allocated objects, such as Programs and Shaders. When destroying a program, any pending program linking is resolved via Program::resolveLink. This results in trying to access the Context state that’s just been reset. To work around this, we ensure there are no pending links before resetting the Context state. Bug: angleproject:8380 Change-Id: I599c7e5a82b0e6bf14df1263006e10d8a9cb0b38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4957715 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Shahbaz Youssefi 384a29a8 2023-07-27T10:51:07 Reland: GL: Remove EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE Now that Chromium no longer uses it. This is a reland of: https://chromium-review.googlesource.com/c/angle/angle/+/4724768 Bug: angleproject:5509 Change-Id: I650e598580539fbe404f2ec4b56b20b56b948f6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4903079 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mohan Maiya 6b0ddce0 2023-09-22T13:13:38 Backends need to handle invalid render area during a clear 1. Frontend no longer noops empty scissors during clear 2. FramebufferVk is updated to handle invalid render area by restaging deferred clears in clearImpl(...) if render area is invalid Bug: angleproject:8348 Tests: EGLSurfaceTest*WindowThenScissoredClear* Change-Id: Iec51914a083a59bad7f939798c932dffada56a6c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4867641 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: mohan maiya <m.maiya@samsung.com>
Charlie Lao 9ca025d2 2023-09-18T15:50:48 Flatten BufferVariable/ShaderVariableBuffer/InterfaceBlock struct InterfaceBlock inherits from ShaderVariableBuffer, ShaderVariableBuffer is not a trivially copyable struct, this made InterfaceBlock not trivially copyable. InterfaceBlock is being used by some app traces for uniform blocks. BufferVariable inherits from sh::ShaderVariable which is very complicated and not trivially copyable. This CL flattens all of these three structs to simple structs without inheritance, and wraps all trivially copyable data into one POD struct, thus load/save are cheaper. Bug: b/275102061 Change-Id: I96f89176ce3d3131cb1d3ea3280c3c36c257560f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4874610 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 4b724130 2023-06-27T18:08:27 Rename SharedContexMutex into ContexMutex Follow up after: Replace (Single/Shared)ContextMutex classed with ContextMutex Renamed build option: angle_enable_shared_context_mutex -> angle_enable_context_mutex Renamed because there is no more SharedContexMutex class and ContextMutex is now used for both Shared and not Shared Contexts. Bug: angleproject:8226 Change-Id: I68eea84aa59441d9c5b19870910b2bb499311e08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4650350 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Igor Nazarov ca4dc52e 2023-06-22T15:20:12 Replace (Single/Shared)ContextMutex classed with ContextMutex This CL removes `SingleContextMutex` class and not 100% safe `Context::lockAndActivateSharedContextMutex()` method. `SharedContextMutex<>` was replaced with `ContextMutex` with static mutex type which is defined in "SharedContextMutex.h": - ContextMutexType = std::mutex Above refactoring also allows storing `State::mContext` by value, instead by pointer. Actual mutex is referenced by `ContextMutex::mRoot` member. This removes extra pointer indirection and slightly improves performance. If newly created Context uses shared textures/samplers, then it uses `Display::mManagersMutex` root as its root. Performance in Single/Shared cases now will be the same, and it should be slightly faster then old Shared case (because of the reduced complexity). Bug: angleproject:8226 Change-Id: I7ca4d9ea008c665cbea98ace1c6e7bbc544f54b5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4632729 Commit-Queue: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: 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>
Shahbaz Youssefi 68bfa1ed 2023-08-22T22:02:15 Support for link to be entirely parallelized The link job is split as such: - Front-end link - Back-end link - Independent back-end link subtasks (typically native driver compile jobs) - Post-link finalization Each step depends on the previous. These steps are executed as such: 1. Program::link calls into ProgramImpl::link - ProgramImpl::link runs whatever needs the Context, such as releasing resources - ProgramImpl::link returns a LinkTask 2. Program::link implements a closure that calls the front-end link and passes the results to the backend's LinkTask. 3. The LinkTask potentially returns a set of LinkSubTasks to be scheduled by the worker pool 4. Once the link is resolved, the post-link finalization is run In the above, steps 1 and 4 are done under the share group lock. Steps 2 and 3 can be done in threads or without holding the share group lock if the backend supports it. Step 2 is not yet made independent of the Context on some backends, and a frontend feature is used to make that step either run on the main thread or as a worker thread. Bug: angleproject:8297 Change-Id: I12f1e6bbaf365543dfcac969e166e0b5aa622104 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4808191 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 7b0bb0f6 2023-09-01T13:52:28 Properly "install" program executables According to GL: - The program has an executable - The executable is overwritten during link. - After a failed link, queries of the executable may return half-linked information - On glUseProgram, the executable is installed in the context - On glUseProgramStages, the executable is installed in the program pipeline - After a successful link, the executable is updated wherever the previous executable of the program was installed. This change implements exactly the above: - The program's and the program pipeline's executables are now shared_ptr. References to an executable in the context and PPO are also through a shared_ptr. Installing an executable thus translates to sharing the executable. - The context and PPOs are made to not reference the program directly, but work solely through the executable. As a result, the program is free to create a new executable for link. With this change, the link job will be free to modify the executable as necessary because that will not be accessed until the link is done. Note that previous changes made the backend executable accessed through the frontend one, and moved all link results to the frontend and backend executables as appropriate. Bug: angleproject:6358 Bug: angleproject:8297 Change-Id: Ie636b23ff7420ad284d18b525ec4f5fb559dd9d1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4823089 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 6ff209bc 2023-08-30T00:02:30 Clean up InfoLog usage during link The info log doesn't really belong to ProgramExecutable; it belongs to ProgramState. However, it is placed there for convenience since many functions access it. This change cleans up usage of InfoLog so the one in ProgramExecutable is consistently used, but also that is turned into a reference to ProgramState's InfoLog. This is necessary for a follow up change that restores the previous executable on link failure (and would thus otherwise lose the info log of the failing link). Bug: angleproject:8297 Change-Id: I088408e3fce9ebb35b1ec4ad3dc599bdb90bf5c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4825624 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 44b5715c 2023-08-15T15:06:25 D3D: Remove link job dependence to context The part of link that needs the context is moved up. Usage of gl::Context and gl::State is eliminated from the rest of the link. Bug: angleproject:8297 Change-Id: I2064b21a6724d602f6a84f53a8ae5fe42fe4e837 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4781566 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 8f64b51d 2023-08-09T16:51:13 Reland: Vulkan: Move default uniform init to link job This is a reland of d8cd4dcdc9c55c88f030f7fca41357e99e600ed2 Bug: angleproject:8297 Change-Id: Ib4f8e9dd258da71d44983bbb619b6b4abda0b109 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4793218 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f3c1de36 2023-08-17T15:29:24 Make shader recompile while parallel linking safe Prior to this change, Program* objects held references to Shader* objects. This poses a problem where a shader recompile can race with a program link, if the program link is done in parallel. As a result, a good chunk of the link job is done serially and under the share group lock. After this change, that is no longer a problem, and most of the link can be made lockless/parallelized. This change separates out the "compiled state" from the rest of the shader state. This was already done for the front-end state (for the sake of caching), but is also now done for the backends that need it. The compiled state in turn is placed in a shared_ptr, and is shared with the program. When a shader is compiled, its own shared_ptr is replaced with a new object, leaving all programs currently compiling unaffected and using the previous compilation results. Once a program is linked, its references to compiled shader states is updated. Bug: angleproject:8297 Change-Id: Iff7094a37088fbad99c6241f1c48b0bd4c820eb2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4791065 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Shahbaz Youssefi 4ba4af61 2023-08-17T11:28:18 Revert recompile blocking on link Causing timeouts on some platforms. An alternative implementation will follow. This change also reverts two changes that depend on it: Vulkan: Move SPIR-V set up to link job 10f54902e816fa7e4cf314384e00590e2b9bfa1d. Vulkan: Move default uniform init to link job d8cd4dcdc9c55c88f030f7fca41357e99e600ed2. Bug: angleproject:8297 Change-Id: I9a258460e7bcaeac214be5e63c16c20681e0bcde Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4789843 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Shahbaz Youssefi d8cd4dcd 2023-08-09T16:51:13 Vulkan: Move default uniform init to link job Bug: angleproject:8297 Change-Id: I5bab916f452439d92afa65b9172574000ee0b587 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4762838 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Shahbaz Youssefi 6c1bab07 2023-08-02T12:25:51 Add surface to eglAcquireExternalContextANGLE Bug: angleproject:5509 Change-Id: I51284ae4dc865dc31d1c5540c24e1e0abb95fe0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4743719 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 01ee134b 2023-08-02T13:43:36 Revert "GL: Remove EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE" This reverts commit 4e0250f1926d25e39023c4ad7862ed358a0ec4b6. Reason for revert: Chromium change was reverted. crbug.com/1468956 Original change's description: > GL: Remove EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE > > Now that Chromium no longer uses it. > > Bug: angleproject:5509 > Change-Id: Ibb8d9cdc4d67dad77ca50437423b18d81e838203 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4724768 > Reviewed-by: Peng Huang <penghuang@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:5509 Change-Id: Id8143b1715ec8162be9351437fbd34a2aa4c2e00 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4742521 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 4e0250f1 2023-07-27T10:51:07 GL: Remove EGL_EXTERNAL_CONTEXT_SAVE_STATE_ANGLE Now that Chromium no longer uses it. Bug: angleproject:5509 Change-Id: Ibb8d9cdc4d67dad77ca50437423b18d81e838203 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4724768 Reviewed-by: Peng Huang <penghuang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov faca95f7 2023-07-27T21:28:08 Fix memory leak destroying never current Context Regression from the very old CL: Fix gl::Context::unMakeCurrent crashes https://chromium-review.googlesource.com/c/angle/angle/+/3017210 Memory leak may happen when releasing invalid Contexts in `destroyInvalidEglObjects()`. Bug: chromium:1171371 Change-Id: I282baa92cf3ce7faf1b4239c7ed4b85bd52543a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4732893 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Shahbaz Youssefi 7ea61cb3 2023-07-23T21:53:50 GL: Complete EGL_ANGLE_external_context_and_surface This change implements two new entry points added for EGL_ANGLE_external_context_and_surface: glAcquireExternalContextANGLE and glReleaseExternalContextANGLE. These functions remove the need to overload eglMakeCurrent for the purposes of syncing to and from the external context. Bug: angleproject:5509 Change-Id: I5d46299ee0c8addaef7066914a8a8aacb0ea2c17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706027 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2d5fb09d 2023-07-22T22:34:20 Stubs for EGL_ANGLE_external_context_and_surface Bug: angleproject:5509 Change-Id: I8e2395784abcd2b4e3e1f888e70a879ef49287bc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4706026 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi bd8001e5 2023-07-17T11:32:23 Fix deadlock on device loss Some backends generate a device loss (propagated to all contexts) while querying the device status. The latter is held under a lock, and the former would attempt to hold the lock when marking the calling context with device loss. Bug: chromium:1465262 Change-Id: I55fd96f3573732953daf2a305b0120dbcae6ea30 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690063 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi c9a42949 2023-07-12T15:07:17 Make validation make straight calls to ErrorSet ... and avoid going through the context (just to get a const cast). This change is also in preparation for an follow up where some entry points directly use ErrorSet and don't access context at all. Bug: angleproject:8224 Change-Id: Idef0a88d9407870e7a84b4fe6967fbff175c269b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678350 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 79f5b73a 2023-07-12T12:55:51 Make error handling and debug messages thread safe Bug: angleproject:8135 Bug: angleproject:8224 Change-Id: I1527b6a02d917724034873b5206f2006ae0eaf05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678284 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 8ae9f28d 2023-07-11T16:35:19 Make context-loss state atomic This state can be set by other threads, including those without a context in the share group; context loss can originate from the Display and is propagated to all contexts. This change makes the relevant flags atomic which are read with relaxed memory order to minimize their impact on performance. Bug: angleproject:8224 Change-Id: I1f0a29210e07cd153db79fdc01d551cf96df4143 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678784 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9962f078 2023-07-11T15:39:50 Pass only context-private state to private entry points This change ensures that the implementation for these entry points cannot access anything other than context-private state. Bug: angleproject:8224 Change-Id: I988672b138d861db25e91d71ab8c34baa4e8ebee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678783 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 491c2a54 2023-07-11T15:20:09 Split the context-private part of the state cache In preparation for passing it directly to entry point implementations, ensuring no access to the share-group-accessible part. Bug: angleproject:8224 Change-Id: I705e6a8fb5204bab71caffff4dcb56d16c3d6e10 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678782 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 40111c68 2023-07-11T14:21:21 Rename context-local to context-private state Bug: angleproject:8224 Change-Id: I1bb39475043f8fb14d683d11a038b4850692a8c6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4678781 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Yuxin Hu 6ee402f6 2023-07-06T16:56:28 Clamp the max Framebuffer width and height to 16 bit GraphicsDriverUniforms struct packs framebuffer width and height into a 32 bit uint, meaning the maximum width and height supported are 16 bit each. We should make sure below values do not exceed the maximum value of a 16-bit uint: caps.maxFramebufferWidth caps.maxFramebufferHeight caps.maxRenderbufferSize so that the application won't try to create a FBO with width/height exceeding 16-bit. We have clamped the caps.max2DTextureSize to 32768, it makes sense to clamp the FBO width and height to the same value. Bug: b/286921997 Change-Id: Iae598b37215c58d1a0f6a50bba9f391d4d23d1f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4671327 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi eb205e68 2023-07-06T13:34:28 Make the glPatchParameteri entry point lockless This entry points only sets context-local state and thus doesn't require locking. Bug: angleproject:8224 Change-Id: I17975a97aa7f68c3ddf2ef78069b8f519fdc4c1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4670405 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Shahbaz Youssefi 5869fb3b 2023-07-06T22:13:36 Remove big-GL files from normal builds of ANGLE Bug: angleproject:7533 Change-Id: I3616296d9923310200830a921190813e3ecfe80b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4672146 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>