src/libANGLE/GLES1Renderer.cpp


Log

Author Commit Date CI Message
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 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 82c0ba93 2023-12-21T16:18:40 Set dirty bit when GLES1 texture state changes During experiments, it was seen that some devices fail to use the tex coord pointer properly after GL_TEXTURE_2D is re-enabled and there is a draw without updating any additional attribute pointers. * The GLES1 renderer will now also set the dirty bit for the vertex array when GL_TEXTURE_2D state changes. * (via setEnableVertexAttribArray()) * Updated the following test: DrawWithTexCoordPtrThenDisableTexture2DAndDrawAnother * Updated so after GL_TEXTURE_2D is enabled, we draw without updating the vertex pointer to check that simply enabling textures is enough to use the texture data. Bug: b/310688730 Change-Id: I0d93bd6fae3d07ea86cf0e5e094ce7a29f2e5f1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5147197 Reviewed-by: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@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 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>
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 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 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 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 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 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>
Shahbaz Youssefi 44395930 2023-07-05T11:59:23 Make various state setting entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: I428c23cc862e9356d571bc085b5df0bf48017175 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661700 Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 9daac2b7 2023-07-05T11:36:46 Make glEnable/Disable entry points lockless These entry points only set context-local state and thus don't require locking. Bug: angleproject:8224 Change-Id: Id4eab729115bd75f82e1ec7a27355c821a7c4320 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4661697 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>
Mark Lobodzinski 1810995c 2023-04-25T13:09:27 Capture/Replay: Initialize MEC alpha test state Fixes Street Fighter IV CE rendering issues when capturing. Test: angle_trace_tests --gtest_filter="*street_figher_iv_ce*" Bug: b/278606770 Change-Id: Ifb44c45b19514e4cabed1e81be99bce5706ac4d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4475732 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Cody Northrop 3dd79798 2023-04-07T12:57:05 GLES1: Convert ints to uints for mediump values Mobile drivers are limiting mediump values to 16 bits, which follows the GLSL spec. Our shader was using signed mediump ints for enum values. That limits their value range to [-2^15, 2^15-1], which is [-32768, 32767]. We started failing tests that use TexEnv mode GL_COMBINE (0x8570) which converts to 34160 in decimal, exceeding the range. This translated to a failure to switch on envMode in textureFunction. To fix, convert all the mediump ints in the shader to mediump uints. Test: GLES1ConformanceTest.TexCombine/ES1_Vulkan Test: angle_trace_tests --gtest_filter="*wayward_souls*" Bug: b/277220840 Change-Id: I5219fe1e725c80929906aee3eebd0729a2a29a9b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4409684 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Geoff Lang 18657894 2023-01-25T13:05:56 Add features to dump and replace shader source. dump_shader_source writes shader source strings to files named with the hash of the source and shader type. enable_shader_substitution allows subsituting the shader source with the strings contained in a file. The same file naming scheme as dump_shader_source is used so shaders can be dumped in one run, modified and subsititued in the next run. Use the ANGLE_SHADER_DUMP_PATH and debug.angle.shader_dump_path environment variables to control where files are written. If they are unspecified, write to the temp directory. Based upon Cody's CLs: https://chromium-review.googlesource.com/c/angle/angle/+/2755841 https://chromium-review.googlesource.com/c/angle/angle/+/3961670 Bug: angleproject:7760, chromium:1385510 Change-Id: I43b9827b977079b88daa794e867637f7a126b080 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4192347 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 91d6c3e6 2022-12-05T17:12:49 GLES1: Reduce pressure on vertex input / varyings Typically, not all texture units are used. This change ensures no vertex input / varying is consumed when fewer than maximum textures are used. Bug: angleproject:6644 Change-Id: Iea0e35dc12ec4fcb342818786f307286bf7fc5bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4081116 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Constantine Shablya ef8350a6 2022-10-21T06:30:51 GLES1Renderer: Handle GL_BGRA the same way we handle GL_RGBA Fixes minetest Bug: angleproject:7774 Change-Id: Iacbe8cb9aa434ec624bfaf056092b77bda468b3f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3970417 Commit-Queue: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Auto-Submit: Constantine Shablya <constantine.shablya@collabora.com>
Shahbaz Youssefi bc447ca4 2022-09-20T22:38:16 GLES1: Move lighting to vertex shader In the spec, lighting is done as part of vertex processing, and results in a new vertex color. Texturing is applied later. ANGLE however did lighting in the fragment shader. With this change, lighting is moved to the vertex shader. This fixes rendering of lit objects, as interpolation is done linearly or flat between the vertices per spec, instead of done precisely per fragment. While typically this is inferior to per-fragment lighting, it's what the spec mandates. On the dr_driving trace, this reduces the render pass time by ~20% on Pixel 6. Bug: angleproject:6201 Bug: angleproject:6644 Change-Id: I10e37df8c56c22d520a738af8f8630bc6a01ca7f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3906394 Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 2f1f9500 2022-09-14T15:52:11 GLES1: Fix behavior with incomplete mipmap textures GLES1 requires texturing to be disabled when a mipmap-enabled texture is incomplete. Bug: angleproject:3408 Change-Id: I2c3b0206282a71f9a54d77ecdf2c7e42c7175fe5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3896212 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 69714184 2022-09-16T00:38:03 GLES1: Implement logic op through framebuffer fetch Bug: angleproject:7654 Change-Id: Id5ee7aee8d38eb295b2fd9ff484f4755962c279a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3900513 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Shahbaz Youssefi 2796cbfd 2022-09-15T16:18:47 GLES1: Implement logic op through ANGLE_logic_op Bug: angleproject:7654 Change-Id: I88c784d87c1cb7cb7e5ccf8f020203553513bbb3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3899381 Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Eddie Hatfield 2ebd5100 2022-08-11T10:43:32 Add gl::Context as a parameter to Shader::resolveCompile This prepares us to access the Context's shader cache in resolveCompile in the next commit. Bug: angleproject:7036 Change-Id: I7995c54b290a5a48f0c8985cb56ea0048598ab2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827642 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Cody Northrop f44a6fd2 2021-11-18T20:15:31 GLES1: Hard code integer values in the ubershader This CL continues the process of removing uniform values from the GLES1 ubershader to increase speed on mobile platforms. The first phase removed bools 2091451e. We've identified integers (enums) as providing the biggest bang for buck to optimize speed while having acceptable program generation. Allowing floats as well proved too much specialization. Many GLES1 conformance tests would grind to a halt while providing little to no benefit to app traces. This CL does the following: * Create a GLES1ShaderState class that contains hashable data * Populate it with all states influencing ubershader generation * Hash the class to perform the lookup of existing programs Frame times on Android ARM with locked GPU clocks: Trace Before After dr_driving: 4.2986 -> 0.8155 sonic_the_hedgehog: 2.8223 -> 0.6254 summoners_war: 15.9810 -> 2.3937 wordscapes: 7.6167 -> 1.1496 zillow: 2.9368 -> 1.9318 Test: end2end, perftests, gles1_conformance Bug: angleproject:6644 Change-Id: I060280e282d7b514d3e410c4f8c5e09659e85d3b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3280355 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 2091451e 2021-10-27T22:57:34 GLES1: Create multiple shaders based on state This CL introduces the concept of having optimized shaders for given state combinations. In this first pass, all uniform bools have been moved to hard coded values in the GLES1 ubershader. Frame times on Android ARM with locked GPU clocks: Trace Before After dr_driving: 27.8145 -> 4.2986 sonic_the_hedgehog: 17.9779 -> 2.8223 summoners_war: 93.2040 -> 15.9810 wordscapes: 53.9227 -> 7.6167 zillow: 15.0323 -> 2.9368 Bug: angleproject:6644 Bug: angleproject:6652 Change-Id: I548bc5c6aa24bad5fbd740b9552c4a703ae41354 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3251688 Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Doug Horn 4e1fd371 2021-06-17T10:26:26 Ensure GLES1 state is cleared on context switch. GLES1 support in multi-context D3D mode is broken prior to this change as state in the GLES1Renderer is not being properly dirtied on context switch. The immediate result is a crash on draw commands due to a null program. Introduce a new dirty bit to specify that the program is dirty and should be re-initialized. Test: GLES1 applications work with the D3D11 backend in multi-context mode. Bug: b/191158936 Change-Id: Ib53c1471514ff2cf36ef9fc0d6bfb99a8bb7cf66 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2969789 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Doug Horn <doughorn@google.com>
Lubosz Sarnecki e40edf92 2021-05-06T17:06:58 FrameCapture: Add GLES1 support to CaptureVertexArrayData. Implement CaptureVertexPointerES1 that captures specific GLES1 vertex pointer functions depending on the attribute index. Use GLES1 capture functions in CaptureVertexArrayData by detecting the current context version. Implement VertexArrayType function in GLES1Renderer to get a ClientVertexArrayType enum from a vertex attrib index. Bug: angleproject:5893 Change-Id: I442b2e29475ca817860388cafc120db90a0fb9c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2846838 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Tim Van Patten ae937aae 2021-03-19T20:10:42 Detach separable shaders This effectively reverts the following CL: Vulkan: Don't detach separable shaders in Program::detachShader() https://chromium-review.googlesource.com/c/angle/angle/+/2084399 Bug: angleproject:3570 Bug: b/182409935 Test: ProgramPipelineTest31.DetachAndModifyShader Change-Id: Id69f732d1d4f3eea70b2de8c008452878eaf1682 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2776267 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten c859c0ac 2020-11-24T17:21:38 Batch replace std::unordered_map with angle::HashMap in src/ There are a few places that will remain std::unordered_map due to build or run-time errors, which will need to be evaluated more closely to determine if they should remain std::unordered_map or if there is another Abseil data structure that would be more efficient while still working correctly. Bug: angleproject:4873 Change-Id: Ib04253e3ad6398e63f4cc2bfe12c0f9e57cb112b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558873 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Jamie Madill 57d95828 2020-04-30T17:35:50 Revert "Add type for attribute locations." This reverts commit 9349c14344b2d1fd6bc357063b602bc2626c140f and commit d43b057435e6c9e3194dd20627681ffca0c0808e. It's no longer needed after we bind attribute locations before link. Original CL message: This will allow the capture/replay tool to easily intercept and label attribute locations for remapping. There's some inconsistency in implementation in the GL desktop front- end. This is a quick fix and the full implementation is left for when we implement the full desktop GL API set. Bug: angleproject:4598 Change-Id: Ic510159d4d1982eff41560503cabf983a1be0381 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2174076 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 9349c143 2020-04-29T16:36:17 Add type for attribute locations. This will allow the capture/replay tool to easily intercept and label attribute locations for remapping. There's some inconsistency in implementation in the GL desktop front- end. This is a quick fix and the full implementation is left for when we implement the full desktop GL API set. Bug: angleproject:4598 Change-Id: Ibf11bcb8669d27265ea376494a2e3124825cf3be Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2171933 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tim Van Patten 4db77367 2020-03-03T12:04:26 Vulkan: Don't detach separable shaders in Program::detachShader() To support Program Pipeline Objects, we need to hold on to the shaders in separable programs, rather than detaching them during glDetachShader()/glCreateShaderProgramv(). This is necessary due to requiring the shader information for validating shader interfaces, varyings, etc. Instead, a new ShaderMap of bools will be stored in ProgramState::mAttachedShadersMarkedForDetach to track when a caller attempts to detach a shader from a separable Program. Later, when a new shader is attached, we will first validate that the old shader is marked to be detached, and if so, release it then. Bug: angleproject:3570 Change-Id: I63fac2e5914c1c1a73f0b37863bac0f185ecb44c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084399 Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Tim Van Patten 7e0699a2 2020-02-05T17:04:06 Create the ProgramExecutable Class The ProgramExecutable class is being created to collect data structures that are common to both Programs and ProgramPipelines, as well as any shared functions. This allows callers to request the current ProgramExecutable from the State and make Program-/ProgramPipeline-specific queries without needing to know exactly which responded. This will also allow the necessary data structures to only be populated and stored within the ProgramExecutable when necessary and reused as often as necessary. Bug: angleproject:3570 Change-Id: I101f08ab03421894667b4a426a04d2147489f0e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2040512 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill a18f4145 2020-02-19T22:42:12 Trace/Replay: Add uniform location type. This is a large refactor that replaces instances of "GLint location" for uniform locations with "UniformLocation location". This boxed type is similar to the ResourceID types that we use to capture resource IDs more easily. Eventually this will give us a more portable replay. Bug: angleproject:4411 Change-Id: I848e861c3956d95b6b953f57f8b6a2c4a676766f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2066117 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jiacheng Lu 120b61d3 2019-08-21T12:51:58 Use ShaderProgramID in place of GLuint handles Bug: angleproject:3804 Change-Id: I5dc640004c2cc054c53261e8e939b6a9f5fc23bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762363 Commit-Queue: Jiacheng Lu <lujc@google.com> Reviewed-by: Tobin Ehlis <tobine@google.com>
Lingfeng Yang 603ad164 2018-12-04T07:34:23 GLES1: dirty bit pass This CL introduces a coarse layer of dirty bits and on-demand sending of some uniforms to the underlying driver, instead of sending all uniforms every draw, which should improve performance in cases where not much is changing between draws. BUG=angleproject:2306 Change-Id: I530515dfad2e4be74c73d8659acd4fe5decaa8b0 Reviewed-on: https://chromium-review.googlesource.com/c/1361222 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Jamie Madill 60a50cfc 2018-12-29T16:04:05 Inline Context::DrawArrays and Context::BindBuffer. This reduces the call depth of both of these two hotspots. Reduces time spent in the CPU overhead benchmarks by about 10%. Bug: angleproject:2966 Change-Id: I5052e56dcc1dfb80274326a7f0891fafba7d6655 Reviewed-on: https://chromium-review.googlesource.com/c/1392389 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
Jamie Madill 7c985f5c 2018-11-29T18:16:17 Make angle::Result an enum. This moves away from a class type to a value type. This should improve performance when using angle::Result as a return value. Previously the generated code would return a pointer instead of a value. Improves performance in the most targeted microbenchmark by 10%. In more realistic scanarios it will have a smaller improvement. Also simplifies the class implementation and usage. Includes some unrelated code generation changes. Bug: angleproject:2491 Change-Id: Ifcf86870bf1c00a2f73c39ea6e4f05ca705050aa Reviewed-on: https://chromium-review.googlesource.com/c/1356139 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill e3e680ca 2018-12-03T17:49:08 Remove State::syncProgramTextures. Removes the concept of the program textures dirty object. Instead we use a set of dirty bits to represent dirty texture samples. We mark certain textures dirty and update state structures whenever there is a new Texture/Program/Sampler bound, or when Texture/Program/Sampler state changes. This is in preparation for making clearing the uncleared active textures into a dirty bit as well. Also includes new dirty bit handling for texture image units. These are a GLES 3.1 feature. Bug: angleproject:2966 Change-Id: Ibb8619dd2669bb39fdbcd75e3685be9a8aeeee91 Reviewed-on: https://chromium-review.googlesource.com/c/1346649 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 4f6592fa 2018-11-27T16:37:45 Remove gl::Error. Removes several TODOs. Only egl::Error remains. Also slightly decreases binary size. Bug: angleproject:2491 Change-Id: I3a9d1c22eb0884ca9e37362463fddd0083faf826 Reviewed-on: https://chromium-review.googlesource.com/c/1337462 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill b980c563 2018-11-27T11:34:27 Reformat all cpp and h files. This applies git cl format --full to all ANGLE sources. Bug: angleproject:2986 Change-Id: Ib504e618c1589332a37e97696cdc3515d739308f Reviewed-on: https://chromium-review.googlesource.com/c/1351367 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 526392dd 2018-11-16T09:35:14 Use angle::Result in front-end (Part 9) This removes the ANGLE_TRY_HANDLE macro. Also the internal uses of gl::ErrorStreamBase. There are remaining uses in the validation code. Further progress will be blocked on removing egl::Error and the use of gl::Error in the validation layer. Also reduces binary size by up to 4k. Bug: angleproject:2491 Change-Id: I3e0481f99738f9f24256c10e73f3efcce9826a35 Reviewed-on: https://chromium-review.googlesource.com/c/1334427 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 77abad8d 2018-10-25T17:03:48 Remove Context::gatherParams. This won't be used in the future. It saves a few instructions on each entry point. Also refactors a bit of touched code. Also adds in a missed entry point: "glTexStorage2DMultisampleANGLE". Removes related code and moves remaining helper code in params.h into a new file entry_point_utils.h. In total this patch series reduces overhead by up to 5%. Bug: angleproject:2933 Change-Id: Ifb49564597cde6ba82dfc3e185227619fdc62612 Reviewed-on: https://chromium-review.googlesource.com/c/1299478 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6f755b21 2018-10-09T12:48:54 Use angle::Result in front-end. (Part 1) This covers most of the hot paths used in draw calls. Gives in the order of a 5% reduction in draw call overhead. Bug: angleproject:2491 Change-Id: I2d53afb1163eaceed61fb9cd9ce6c1267c85c0fa Reviewed-on: https://chromium-review.googlesource.com/c/1258149 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 785e8a0b 2018-10-04T17:42:00 Remove gl::LinkResult. Instead of returning a small struct from LinkProgram calls we use angle::Result. Linking can have 3 cases: - the link was successful -> angle::Result::Continue - the link failed -> angle::Result::Incomplete - there was an internal error -> angle::Result::Stop Note that any unexpected Incomplete is still an error. Each function that accepts Incomplete must check explicitly. This is the last user of ErrorOrResult. Bug: angleproject:2491 Change-Id: Idba23be27efe4b561720a4bdd8fe486b40779497 Reviewed-on: https://chromium-review.googlesource.com/c/1255645 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com>
Jamie Madill e3bb6b79 2018-10-03T17:51:15 Update Textures immediately on program change. Instead of deferring this work, we can process it immediately. We have access to the information we need in the prior and current states so can optimize the update more effectively. Bug: angleproject:2763 Change-Id: I77482b0ea490fddf403ccc4a4f32665301fd6e7a Reviewed-on: https://chromium-review.googlesource.com/c/1254042 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 44a6fbfd 2018-10-02T13:38:56 Optimize resolveLink. This changes the program query to resolve the link if required. If the validation layer is skipped the link is resolved in the gl::Context. Resolving the link on program query allows us to avoid resolving the link on most of the gl::Program query APIs. This improves inlining and particularly affects uniform update. It fixes a performance regression introduced by the parallel shader linking extension. Gives a 17% increased score on a uniform benchmark. Also fixes two missing cases of checking for the extension in our validation code. Note that some bugs might still exist when the validation layer is disabled. Bug: angleproject:2851 Change-Id: I5d725eede3fa147cedf2ce0129791b3412a97a61 Reviewed-on: https://chromium-review.googlesource.com/1255509 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@google.com>
jchen10 3fd614d0 2018-08-13T12:21:58 Refactor Context dependency for resolveCompile The context parameter of Shader::resolveCompile method causes a bad impact that many methods in Shader, Program etc. have to have a same context parameter. By removing it, these methods can be decoupled from Context. BUG=chromium:849576 Change-Id: Ia5545ee9dce45794550f6086bc0e6c4707e1276e Reviewed-on: https://chromium-review.googlesource.com/1172202 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2eb65034 2018-07-30T10:25:57 Add Context::getActiveBufferedAttribsMask. This will enable more caching for ValidateDrawAttribs. It requires some minor refactoring of the GLES 1 code. Bug: angleproject:1391 Change-Id: I52b73c9384d14cdb90ba6337bfc1ab345866fff0 Reviewed-on: https://chromium-review.googlesource.com/1147436 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 0df813c3 2018-07-12T12:52:06 GLES1: GL_OES_draw_texture BUG=angleproject:2306 This implements GL_OES_draw_texture using a few bits of new state in the renderer and adding a code path for it in the shader, using gl_VertexID to draw the quad backing the texture draw. This allows us to avoid allocating a separate vertex array for the texture draw and reuses the current shader as much as possible, plugging in to the existing multitexturing pipeline. - Add unit test and sample - No new test expectations, but advertising GL_OES_draw_texture makes the DrawTex GLES1 conformance test non-trivial and actually test glDrawTex*. Change-Id: I1485098249fe44d46a01cab4bb7b2c39d0492923 Reviewed-on: https://chromium-review.googlesource.com/1135930 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Lingfeng Yang 9c4c0926 2018-06-13T09:29:00 Reland "GLES1: Point rasterization (partial implementation)" This is a reland of 4004ae0e033a0169de3cb53c0a036833ad47178a Fix: Put the missing early-out in ValidatePointParameterCommon Original change's description: > GLES1: Point rasterization (partial implementation) > > - Not included: Smooth points > > - GL_OES_point_sprite > - Update test expectations. Note: due to different random sampling, > edge cases were hit in UserClip. Disabling that test for now. > > BUG=angleproject:2306 > > Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa > Reviewed-on: https://chromium-review.googlesource.com/1101910 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Commit-Queue: Lingfeng Yang <lfy@google.com> Bug: angleproject:2306 Change-Id: Id8e71352a77ff0ce71cb604965effbfb8aca613e Reviewed-on: https://chromium-review.googlesource.com/1108458 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Frank Henigman a58d69e9 2018-06-20T18:07:11 Revert "GLES1: Point rasterization (partial implementation)" This reverts commit 4004ae0e033a0169de3cb53c0a036833ad47178a. Crash in PointParameterTest.NegativeEnum/ES1_OPENGL. https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac%20FYI%20GPU%20ASAN%20Release/1178 angle_end2end_tests on Intel GPU on Mac on Mac-10.12.6 angle_end2end_tests on ATI GPU on Mac Retina on Mac-10.12.6 Original change's description: > GLES1: Point rasterization (partial implementation) > > - Not included: Smooth points > > - GL_OES_point_sprite > - Update test expectations. Note: due to different random sampling, > edge cases were hit in UserClip. Disabling that test for now. > > BUG=angleproject:2306 > > Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa > Reviewed-on: https://chromium-review.googlesource.com/1101910 > Reviewed-by: Corentin Wallez <cwallez@chromium.org> > Commit-Queue: Lingfeng Yang <lfy@google.com> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,lfy@google.com Change-Id: I776ce0506d349382b3af035c962aa2c3f6826b99 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2306 Bug: angleproject:2680 Reviewed-on: https://chromium-review.googlesource.com/1108457 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Reviewed-by: Lingfeng Yang <lfy@google.com> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Lingfeng Yang 4004ae0e 2018-06-13T09:29:00 GLES1: Point rasterization (partial implementation) - Not included: Smooth points - GL_OES_point_sprite - Update test expectations. Note: due to different random sampling, edge cases were hit in UserClip. Disabling that test for now. BUG=angleproject:2306 Change-Id: If8367bc3321804b3299d3bc381d6a8e236754baa Reviewed-on: https://chromium-review.googlesource.com/1101910 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Lingfeng Yang 6c60641d 2018-06-08T14:39:29 GLES1: Multitexture pipeline - Update test expectations BUG=angleproject:2306 Change-Id: I4a0376db1d095d7b14e00a5779631dcf2a6c427c Reviewed-on: https://chromium-review.googlesource.com/1093795 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 7ba3f425 2018-06-01T09:43:04 GLES1: Fog API and rendering - Update test expectations BUG=angleproject:2306 Change-Id: Ic5aa5f052bcbe9c5adaf0eb0c6c06df66fd1720c Reviewed-on: https://chromium-review.googlesource.com/1082978 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 060088a5 2018-05-30T20:40:57 GLES1: Clip plane API and rendering - Add unit tests for the API - Update test expectations + Pass through point size from the vertex array to the shader, required for new tests to pass. BUG=angleproject:2306 Change-Id: Ib19436c1f4cb12873adea94f734c821363f9e27d Reviewed-on: https://chromium-review.googlesource.com/1079993 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Lingfeng Yang 32749b94 2018-05-30T19:24:18 GLES1: Alpha test - Update test expectations BUG=angleproject:2306 Change-Id: Ib49900c7c4d6b808ebfab9483d42d3fd98644f9e Reviewed-on: https://chromium-review.googlesource.com/1079991 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Lingfeng Yang 1478afaf 2018-05-17T10:43:34 GLES1: Lighting and materials (renderer) - Update test expectations - Add gles1 sample app that shows simple lighting. BUG=angleproject:2306 Change-Id: I545dcf860374abd9d628b0d554153cb634098f6d Reviewed-on: https://chromium-review.googlesource.com/1065501 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Lingfeng Yang 461b09a8 2018-04-23T09:02:09 GLES1: Renderer (minimal) This is the renderer code for GLES1 that delivers basic vertex attributes, matrices, and allows texturing for unit 0 only (more units mean implementing the multitexturing pipeline). + Sample + Update test expectations for GLES1 conformance tests BUG=angleproject:2554 BUG=angleproject:2306 Change-Id: I398edc764f982fbfc4c5e0f9d6bfef1e91aec47c Reviewed-on: https://chromium-review.googlesource.com/1057356 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Lingfeng Yang <lfy@google.com>
Frank Henigman 66aafcb4 2018-05-12T19:21:31 Revert "GLES1: Renderer (minimal)" This reverts commit a69099212f7b3be8e6113ba349eee56af589f3de. Reason for revert: New tests failing on gpu fyi bot. anglebug.com/2554 Original change's description: > GLES1: Renderer (minimal) > > This is the renderer code for GLES1 that delivers basic vertex > attributes, matrices, and allows texturing for unit 0 only (more units > mean implementing the multitexturing pipeline). > > + Sample > + Update test expectations for GLES1 conformance tests > > BUG=angleproject:2306 > > Change-Id: Id5d5603c967e577290085e5946f2cb7a03d7e017 > Reviewed-on: https://chromium-review.googlesource.com/1023988 > Commit-Queue: Lingfeng Yang <lfy@google.com> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,lfy@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: angleproject:2306 Change-Id: Ib6fd9db433cd1a13589d5a9e82cb2c40f3cf71ff Reviewed-on: https://chromium-review.googlesource.com/1056229 Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Frank Henigman <fjhenigman@chromium.org>
Lingfeng Yang a6909921 2018-04-23T09:02:09 GLES1: Renderer (minimal) This is the renderer code for GLES1 that delivers basic vertex attributes, matrices, and allows texturing for unit 0 only (more units mean implementing the multitexturing pipeline). + Sample + Update test expectations for GLES1 conformance tests BUG=angleproject:2306 Change-Id: Id5d5603c967e577290085e5946f2cb7a03d7e017 Reviewed-on: https://chromium-review.googlesource.com/1023988 Commit-Queue: Lingfeng Yang <lfy@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>