src/libANGLE/renderer/gl/renderergl_utils.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 5313c8a8 2019-01-14T17:02:52 Implement EGL_KHR_fence_sync and EGL_KHR_wait_sync EGL_KHR_fence_sync introduces the EGLSync object and associated create/destroy/clientWait functions. EGL_KHR_wait_sync adds the serverWait function on top of that. Bug: angleproject:2466 Change-Id: Iebb239a85c4471ea18b3c3a8a83b793af555e31d Reviewed-on: https://chromium-review.googlesource.com/c/1412261 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 828acb39 2019-01-22T15:01:55 Enable ParallelCompile for Mac Linked in parallel, GLSLTest_ES3.LargeNumberOfFloat4Parameters fails on the Mac asan bots. It looks a driver bug caused by handling some long GLSL expressions. This works around it by breaking down the expression in the test from: return a0 + a1 + ... + alast; to: vec4 sum = vec4(0, 0, 0, 0); sum += a0; sum += a1; ... sum += alast; return sum; This also fixes a CGLPixelFormat leak, although it's irrelevant to the bot failures. BUG=922936 BUG=angleproject:3087 BUG=angleproject:3047 Change-Id: I20249ada43e9dd226f582a568ed4ed50a0e4375d Reviewed-on: https://chromium-review.googlesource.com/c/1426430 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Yuly Novikov 5fe7c5b9 2019-01-17T12:16:34 Include common/platform.h where used Bug: 922443 Change-Id: I35b9e34266d4a15f8d0769c2770801b1b0511398 Reviewed-on: https://chromium-review.googlesource.com/c/1418091 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang c66cd693 2019-01-17T10:37:51 GL: Temporarily disable parallel shader compile. The Skia bots have been unable to roll ANGLE since parallel compile landed in ANGLE. Speculatively disable parallel compile using a workaround. Failed roll: https://skia-review.googlesource.com/c/skia/+/184705 Also seen instability on Linux, Mac and Windows in 922936. BUG=922936 BUG=849576 Change-Id: I7116b3f6541425135984c52a8077bdb98d961784 Reviewed-on: https://chromium-review.googlesource.com/c/1415729 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
jchen10 a100d8f4 2018-12-29T16:39:55 ParallelCompile: add GL backend support For GL backend, at first each worker thread must have a naitve context for its own to work in. These worker contexts have to be shared from the main context, so that all shader and program objects are seen in any context. This extends backend displays to create and destroy the worker contexts. RendererGL manages and allocates them to the worker threads. ShaderImpl has a new compile method added to do the actual glCompile work in worker thread. The ProgramGL's link method is broken down by introducing the LinkEventGL class. Bug: chromium:849576 Change-Id: Idc2c51b4b6c978781ae77810e62c480acc67ebb5 Reviewed-on: https://chromium-review.googlesource.com/c/1373015 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jeff Gilbert 465d6090 2019-01-02T16:21:18 Add GL_ANGLE_provoking_vertex on D3D11 and GL. This extension is a subset of GL_ARB_provoking_vertex without the QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION query. Bug: angleproject:2829 Change-Id: I907a4d16b7b13d3bbfb948842091eedd7b6a8b77 Reviewed-on: https://chromium-review.googlesource.com/c/1410289 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang b827f490 2018-12-14T12:09:41 GL: Work around errors generated during query caps initialization. Nexus5X drivers generate INVLAID_ENUM errors when querying GL_QUERY_COUNTER_BITS. Add device detection from renderer string. BUG=angleproject:3027 Change-Id: I367e20c79e1c4e53c26d94603d9a893604b51165 Reviewed-on: https://chromium-review.googlesource.com/c/1374274 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 4627b370 2019-01-02T18:38:32 Add gl null driver tests to DrawElements. Requires a couple tweaks to the back-end to be compatible with the null driver. Bug: angleproject:2966 Change-Id: Ia83651aabb0dd14b7d6f64152c276463a8fb28fc Reviewed-on: https://chromium-review.googlesource.com/c/1392392 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang e1f742af 2018-12-14T14:17:59 GL: Clean up workaround detection. Use functions instead of macros for platform detection so compilation can be checked from any platform. Also makes the workaround detection more readable. BUG=angleproject:3026 Change-Id: I4153f0a2a6a6d5860c7b37f7cc67561895165ed1 Reviewed-on: https://chromium-review.googlesource.com/c/1378685 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang be607ad6 2018-11-29T10:14:22 GL: Implement GL_OES_EGL_image_external and GL_OES_EGL_image_external_essl3 Chrome uses external textures as part of its hardware video decode paths on Android. BUG=angleproject:2507 Change-Id: I2af608f84a99843c99a16dcfb9fb2fa28cc8fbb6 Reviewed-on: https://chromium-review.googlesource.com/c/1361480 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
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 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>
Geoff Lang 4f2b94cb 2018-11-26T11:38:02 Expose EXT_color_buffer_half_float if RGBA16F is renderable. The EXT_color_buffer_half_float extension spec issue #2 states that none of the added color buffer formats are required to be renderable and the client must check for framebuffer completeness for using them. Chrome exposes the extension if at least RGBA16F is renderable for WebGL. Replicate Chrome's behaviour by loosening our requirements to only expose this extension if an explicit check for RGBA16F renderability succeeds. BUG=angleproject:2984 Change-Id: Id97f3043ebf3fd11b5e9e2d505e57b76baba9716 Reviewed-on: https://chromium-review.googlesource.com/c/1351350 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 7198ebc4 2018-11-22T14:36:06 GL: Work around Qualcomm sRGB ReadPixels driver bug. When calling glReadPixels on unsized sRGB textures, the data returned is not linearized. Using sized sRGB formats works around this problem. Fix SRGBTextureTest assuming that unsized SRGB formats work in ES3. BUG=angleproject:2977 Change-Id: I413c888ca0c3564ecdc364f3ea693e75ed4f8d6d Reviewed-on: https://chromium-review.googlesource.com/c/1343138 Reviewed-by: Tobin Ehlis <tobine@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 617103ed 2018-11-22T13:18:05 GL: Implement GL_NV_fence on top of GLsync objects. When ANGLE exposes an ES2 context, there is often no way to create fence objects because GL_NV_fence is not available. BUG=882580 Change-Id: Ic18539e0243317a188545f3945f6b33d3401f1a8 Reviewed-on: https://chromium-review.googlesource.com/c/1348769 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 836674c2 2018-11-19T11:45:18 Expose GL_CHROMIUM_compressed_texture_etc on top of ES drivers. This allows Chrome to expose the ETC texture formats in WebGL on top of ANGLE. BUG=angleproject:1552 Change-Id: I6a6c3912791e121826b2083421e37df7c0dc38e7 Reviewed-on: https://chromium-review.googlesource.com/c/1342420 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Geoff Lang ccad5e33 2018-11-14T11:01:16 GL: Work around driver returning negative GL_MAX_SERVER_WAIT_TIMEOUT GL_MAX_SERVER_WAIT_TIMEOUT is only allowed to be positive, ensure that with a std::max. BUG=angleproject:2961 Change-Id: I8dd66df24d35c8ae81038d6d9cd0bad0d51f1a80 Reviewed-on: https://chromium-review.googlesource.com/c/1335889 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Till Rathmann b8543630 2018-10-02T19:46:14 Support GL_OES_texture_border_clamp Added support for GL_TEXTURE_BORDER_COLOR and GL_CLAMP_TO_BORDER in OpenGL/OpenGLES, Direct3D9 and Direct3D11 backends. For integer textures in OpenGLES3 contexts these additional entry points are available now: void glTexParameterIivOES(enum target, enum pname, const int *params); void glTexParameterIuivOES(enum target, enum pname, const uint *params); void glGetTexParameterIivOES(enum target, enum pname, int *params); void glGetTexParameterIuivOES(enum target, enum pname, uint *params); void glSamplerParameterIivOES(uint sampler, enum pname, const int *params); void glSamplerParameterIuivOES(uint sampler, enum pname, const uint *params); void glGetSamplerParameterIivOES(uint sampler, enum pname, int *params); void glGetSamplerParameterIuivOES(uint sampler, enum pname, uint *params); BUG=angleproject:2890 TEST=angle_end2end_tests.TextureBorderClamp* Change-Id: Iee3eeb399d8d7851b3b30694ad8f21a2111f5828 Reviewed-on: https://chromium-review.googlesource.com/c/1257824 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yizhou Jiang 7818a85c 2018-09-06T15:02:04 Implement GL_ANGLE_texture_multisample API part Support GL_ANGLE_texture_multisample extension. This patch adds enums of multisampled texture and texStorage2DMultisampleANGLE API. TEST=angle_end2end_tests.exe --gtest_filter=TextureMultisampleTest* TEST=angle_end2end_tests.exe --gtest_filter=NegativeTextureMultisampleTest.Negtive* BUG=angleproject:2275 Change-Id: I2cab997edc33aa2d0be6082381545335423f64e0 Reviewed-on: https://chromium-review.googlesource.com/c/804613 Commit-Queue: Yizhou Jiang <yizhou.jiang@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill d4f07760 2018-10-19T19:24:07 GL: Apply dirty bit mask on sync state. This prevents us from updating some dirty bits in some operations. It can prevent us from doing things like updating the Program when we don't use it in a GPU operation. Also adds Framebuffer dirty bits to TexImage to work around a bug on the Windows Intel OpenGL driver. Bug: angleproject:2763 Bug: angleproject:2906 Change-Id: I9f69775fb930a9bbcbd40d0f9012d62a9381c9f8 Reviewed-on: https://chromium-review.googlesource.com/c/1292610 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e39e8f46 2018-10-05T08:17:38 GL back-end error refactor. Adds explicit error handling to a few scoped state handler classes. Otherwise mostly mechanical refactoring. Bug: angleproject:2753 Change-Id: I2bf969a68f45880902b6e7902297c1340a76a1c4 Reviewed-on: https://chromium-review.googlesource.com/c/1255647 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 1395134c 2018-09-30T15:24:28 Remove more uses of gl::ErrorOrResult. Only gl::LinkResult remains. Bug: angleproject:2753 Change-Id: I5e9c68c11453e8ab9db4908451957d7b3db0b110 Reviewed-on: https://chromium-review.googlesource.com/c/1254044 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov d082819c 2018-06-15T15:51:07 Fix format support conditions This fixes format support tables in formatutils.cpp and formatutilsgl.cpp to conform to the core and extension GLES specs, for a large portion of the formats. ExtsOnly SupportRequirement was enhanced to accept multiple sets of extensions. Format is supported if all the extensions in one of the sets are available. Also fixes determining support for extensions based on those formats. And some fixes to tests which fail due to more strict format support. Bug: angleproject:2567 Change-Id: I6050fff9c597f658fdcea2477bff59a603cdb7e8 Reviewed-on: https://chromium-review.googlesource.com/1105612 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@google.com>
Olli Etuaho ab5fb5ed 2018-09-18T17:23:28 Reland "Support EXT_blend_func_extended in the GLES2 context" This re-lands EXT_blend_func_extended implementation. A lot of the implementation has been rewritten on top of changes that have been done since the last attempt. For now we only expose the extension on desktop GL. To support GLES, we'd need to investigate what's the most robust way to handle the compiler output and make the binding of the fragment outputs conditional. The extension is disabled on AMD and Intel because of test failures. BUG=angleproject:1085 TEST=angle_end2end_tests Change-Id: I619ae3162769b90aad095ddec158ce6c57a114a8 Reviewed-on: https://chromium-review.googlesource.com/1233713 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 2c8f0845 2018-09-12T14:44:55 Add ANGLE_multiview_multisample We add a novel multiview multisampling extension that includes the requirement to explicitly resolve the multisampled framebuffer. The explicit resolve is much more straightforward to implement on top of OpenGL and D3D11 than implicit resolve found in the native extension OVR_multiview_multisampled_render_to_texture. It also has predictable performance characteristics. The extension allows multiview drawing to 2D multisample texture arrays and is now enabled on both the GL backend and the D3D11 backend. The implementation is fairly simple, as it involves just small changes in validation to allow multisampled framebuffer attachments. The multiview rendering logic is exactly the same regardless of whether multisampling is enabled. For the most part the same tests are used to test both multisampled and non-multisampled rendering. The tests will use a different framebuffer setup depending on the test param. They resolve the multisampled framebuffer to a non-multisampled framebuffer prior to any readbacks from the framebuffer. Some of the tests are adjusted so that they have the correct sub-pixel positioning of multisampled quads, so there won't be any pixels that would be just partially covered. The tests don't have any tolerance for partially covered pixels - if we find any platforms where the tests run into a sub-pixel positioning corner case, tolerance may need to be added later. BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: I590d7f300a92ea5439f2720d9db14a7976db2e1d Reviewed-on: https://chromium-review.googlesource.com/1221214 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 064458a8 2018-08-30T14:02:02 Remove separate ANGLE_texture_multisample_array We can just expose OES_texture_storage_multisample_2d_array instead. The compiler was already changed to accept OES_texture_storage_multisample_2d_array, and now the change is made also at the API level. Out-of-bounds access guarantees provided by ANGLE were the only big difference between the ANGLE spec and the OES spec, so it's simpler to just expose the native extension. Safe out-of-bounds accesses can be guaranteed without having them in the extension spec. This also adds missing texStorage3DMultisample entry point to the proc table, which will enable running dEQP tests. BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: Idf376ee877a3374a33de177df023f0531ec8f01d Reviewed-on: https://chromium-review.googlesource.com/1196722 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 0c5a9e22 2018-08-27T14:36:23 Implement TexStorage3DMultisample on the GL backend BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: Ic980d86cd787bcf29f622e68b0c38b0eb6ca5688 Reviewed-on: https://chromium-review.googlesource.com/1190182 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho d310a434 2018-08-24T15:40:23 Add validation and negative tests for multisample arrays This adds errors for binding and allocating multisample array textures. New tests in TextureMultisampleTest.cpp check that the errors are generated as specified. Tests for querying supported sample counts are also improved and extended for multisample array textures. BUG=angleproject:2775 TEST=angle_end2end_tests Change-Id: I6a0fe7ae04bb3d0072f6cbe09026b05e2bc47325 Reviewed-on: https://chromium-review.googlesource.com/1188576 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi c14ab2a7 2018-08-24T13:57:55 Fix dEQP_GLES3.functional.negative_api.shader.program_binary The frontend was not taking into account the fact that some drivers do not support program binaries. The fix is that now glGetProgramiv(GL_PROGRAM_BINARY_LENGTH) returns 0 under such circumstances. Bug: angleproject:2780 Change-Id: I4ea2cda6bb4612e69dbd7e00b3d43b97ee3b3c3d Reviewed-on: https://chromium-review.googlesource.com/1188768 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Geoff Lang dbd16127 2018-07-19T11:30:21 EGL: Implement EGL Image extensions. BUG=angleproject:2507 Change-Id: Ica33166e9e23e933977c3ab034d4f5a8cada9fb1 Reviewed-on: https://chromium-review.googlesource.com/1143454 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill ca2ff38b 2018-07-11T09:01:17 Refactor internal format pixel math methods. This removes the use of the ErrorOrResult class from these methods. This will enable more performant Error handling. Also cleans up the ANGLE_TRY_CHECKED_MATH macro to be more general. Bug: angleproject:2713 Change-Id: I349947d320907839ca88ec1f9251e6ddc3858a08 Reviewed-on: https://chromium-review.googlesource.com/1128920 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Geoff Lang 3f332584 2018-06-26T21:00:14 Revert "RendererGL: Limit warning output to 5 per message type." This reverts commit 7c37ca1836402b654dbbf5f00007e09bdf2a7051. Reason for revert: Causes crashes on Android. Original change's description: > RendererGL: Limit warning output to 5 per message type. > > BUG=768943 > > Change-Id: I8ed69c70d1914b56145c52ffe26f13193fb55e9e > Reviewed-on: https://chromium-review.googlesource.com/685278 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Corentin Wallez <cwallez@chromium.org> TBR=geofflang@chromium.org,cwallez@chromium.org Change-Id: I641ac5d508d238e275eaeef4fac4033d9015960d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 768943 Reviewed-on: https://chromium-review.googlesource.com/1115658 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 7c37ca18 2017-09-26T16:56:32 RendererGL: Limit warning output to 5 per message type. BUG=768943 Change-Id: I8ed69c70d1914b56145c52ffe26f13193fb55e9e Reviewed-on: https://chromium-review.googlesource.com/685278 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Rafael Cintron 05a449a7 2018-06-20T18:08:04 Replace reinterpret_cast with safer or no cast When casting types to one another in C++, the weaker the cast, the better. This change replaces instances of reinterpret_cast with static_cast or no cast where it safe and correct to do so. BUG=angleproject:2683 Change-Id: I99c9033614a65282ae1d78cf0f4b80fabd75877a Reviewed-on: https://chromium-review.googlesource.com/1109396 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron ad2ae93e 2018-06-11T15:31:17 Vulkan: Clamp the point size range to have a min value of 1.0 Bug: angleproject:2658 Change-Id: I32ff9aa27b064d9977eea0b83b18c52c4e42e38d Reviewed-on: https://chromium-review.googlesource.com/1096054 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov f15f886c 2018-06-04T18:59:41 Differentiate texture and renderbuffer framebuffer attachment capabilities ANGLE used to describe the abitily to attach textures and renderbuffers of a specific format to a framebuffer using a single notion of "renderable". However, for some formats, only one can be supported, but not the other. Split TextureCaps::renderable into textureAttachment and renderbuffer. Also, split InternalFormat::renderSupport into textureAttachmentSupport and renderbufferSupport. The only functional change is in a few places which now explicitly check for texture or renderbuffer attachement support. Information in format support tables was duplicated for the two capabilities, so behavior should remain the same. It should be corrected in future CLs. Note: additional information in those tables may need to be added in order to properly support GenerateMipmap and TexStorage2DMultisample, this is beyond the scope of this CL. Bug: angleproject:2567 Change-Id: I18bce4100525be35709d8bbf4de08ec812aab502 Reviewed-on: https://chromium-review.googlesource.com/1086491 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 0c4e08e9 2018-05-08T11:00:36 Use ShaderMap in Caps - Part II This patch is the last one in the series of putting resource limits on each shader stage into ShaderMap. With this patch, all such values are organized in the corresponding ShaderMap. This patch also cleans up all the related code by using this new type of data structure. BUG=angleproject:2169 Change-Id: I440643fe44ab63acf7da0a1611643beed1ba66d1 Reviewed-on: https://chromium-review.googlesource.com/1077748 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 6110763f 2018-05-09T11:32:46 Refactor the GL surfaces and framebuffers to not hold renderer objects. BUG=angleproject:2464 Change-Id: I20aabeef3de6cf1fc13a29b6220e040aa83184d7 Reviewed-on: https://chromium-review.googlesource.com/1039986 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jiawei Shao 54aafe58 2018-04-27T14:54:57 Use ShaderMap in Caps - Part I This patch is the first one of the series that organize implementation dependent resource limits on every type of shader into ShaderMap and clean up all the related code. In the next patch all such resource limits are put in the corresponding ShaderMaps. BUG=angleproject:2169 Change-Id: I40cb58c55b2e82df33221ddb36eff0abcd7e8b22 Reviewed-on: https://chromium-review.googlesource.com/1034108 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 983460e6 2018-05-02T17:57:39 Rewrite repeated assignments to swizzled vectors on NVIDIA This works around the most common instances of a bug that reproduces on some NVIDIA OpenGL drivers prior to version 397.31. BUG=chromium:798117 TEST=angle_end2end_tests Change-Id: Iafc6a9a64e56fa98b42117149fe6867040e932e5 Reviewed-on: https://chromium-review.googlesource.com/1042190 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
JiangYizhou aae572a5 2018-04-28T15:14:31 Disable avoid1BitAlphaTextureFormats workaround on Intel avoid1BitAlphaTextureFormats workaround was added to angle in 288584 due to an old driver bug on Intel and AMD that 1-bit alpha always rounds up when converting from float to unsigned int. The workaround uses rgba8 instead of *a1 to avoid the driver bug and optimizes precision. However, this workaround brings a new issue because 1-bit alpha can only represent u0 or u1 while 8 bits alpha covers from u0 to u255. For example, if we expect to render to a rgb5_a1 renderbuffer, the expected alpha value should be 0 or 255, but actually get a value between 0 and 255 which is incorrect. The current Intel drivers have fixed the old driver bug. So we suggest to disable this workaround for Intel drivers. TEST=dEQP_GLES2.Default/functional_fbo_render_color_clear_rbo_rgb5_a1_depth_component16_stencil_index8 --deqp-egl-display-type=angle-gl BUG=angleproject:2349 Change-Id: I14933f92fa27031ff7442fa437f77a3c67f2f1db Reviewed-on: https://chromium-review.googlesource.com/1034163 Reviewed-by: Jiajia Qin <jiajia.qin@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 3cd48fff 2017-10-03T15:37:16 Implement robust resource initialization for OpenGL. BUG=angleproject:2107 BUG=angleproject:2407 BUG=angleproject:2408 BUG=693090 Change-Id: I6444f80f9703d6341f2ec67518050adc88f71d96 Reviewed-on: https://chromium-review.googlesource.com/678482 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 99d492c2 2018-02-27T15:17:10 Use packed enums for the texture types and targets, part 2 This completes the refactor by using the packed enums in the gl:: layer and in the backends. The packed enum code generation is modified to support explicitly assigning values to the packed enums so that the TextureTarget cube map faces are in the correct order and easy to iterate over. BUG=angleproject:2169 Change-Id: I5903235e684ccf382e92a8a1e10c5c85b4b16a04 Reviewed-on: https://chromium-review.googlesource.com/939994 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang a8fe18fc 2018-02-05T13:46:05 GL: Fix usage of glGetInternalFormativ. The Target was being passed cube map faces for cube map textures. The return value is an enum, not a bool. BUG=angleproject:1932 Change-Id: I975f510fc0f6bc4d29adcbb152b0329ecbcdfa92 Reviewed-on: https://chromium-review.googlesource.com/902192 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho 0690e1aa 2017-12-21T20:51:38 Add a workaround to clamp gl_FragDepth NVIDIA OpenGL drivers at least up to version 388.59 don't clamp gl_FragDepth when it is written to a floating point depth buffer. This bug is now worked around by clamping gl_FragDepth in the shader if it is statically used. BUG=angleproject:2299 TEST=angle_end2end_tests on NVIDIA Change-Id: I61589b2b0dd2813c4901a157c8d37e470063773c Reviewed-on: https://chromium-review.googlesource.com/840842 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jiawei Shao 361df070 2017-11-22T09:33:59 ES31: Implement Geometry Shader resource queries on OpenGL This patch intends to implement all geometry shader related resource queries on OpenGL back-ends. This patch also fixes a memory leak by releasing the geometry shader compiler handle in the destructor of the Compiler. BUG=angleproject:1941, angleproject:2261 TEST=angle_end2end_tests Change-Id: Ieb69c162d2fc6c6550e145d1ec7948c3d36d4d15 Reviewed-on: https://chromium-review.googlesource.com/784552 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
JiangYizhou bcbe8e1a 2017-11-21T14:13:14 Update extension queries on OpenGL part Fix some incorrect extension queries on OpenGL part. GL_MAX_FRAMEBUFFER_WIDTH should be checked by GL_ARB_framebuffer_no_attachments. GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS should be checked by GL_ARB_shader_storage_buffer_object and GL_ARB_compute_shader. Also do code refactoring for query GL_MAX_FRAGMENT_UNIFORM_VECTORS, GL_MAX_VERTEX_UNIFORM_BLOCKS and GL_MAX_FRAGMENT_UNIFORM_BLOCKS. BUG=angleproject:2256 Change-Id: Iea2471363551019dfeb97f224eea808de19914ab Reviewed-on: https://chromium-review.googlesource.com/781239 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang c7c0d1c1 2017-11-22T14:53:03 Expose OES_vertex_array_object on the GL backend. BUG=781164 Change-Id: I92738c0f45efdf0efaecede509648fd5a4d00b8b Reviewed-on: https://chromium-review.googlesource.com/786338 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 5d5253a3 2017-11-22T14:51:12 Clean up usage of EXT_debug_marker and KHR_debug in the backends. In RendererGL, the EXT_debug_marker functions were calling the KHR_debug entry points, now they fall back only when EXT_debug_marker is missing. Separated the ContextImpl methods for the two extensions. BUG=781164 Change-Id: I615b5965b705e55eb730ebefa6e27e0ee6d86c31 Reviewed-on: https://chromium-review.googlesource.com/786337 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 89be29a5 2017-11-06T14:36:45 ES31: Implement creation and attaching geometry shader on OpenGL This patch intends to implement the creation of a geometry shader and attaching a geometry shader to a program on OpenGL back-ends. This patch also adds all geometry shader related dEQP-GLES31 test failures to deqp_gles31_test_expectations.txt. BUG=angleproject:1941 TEST=angle_end2end_tests Change-Id: Ib0b497030255b15dacd967e48bc59eef0009af46 Reviewed-on: https://chromium-review.googlesource.com/757979 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 92019431 2017-11-20T13:09:34 Make conversion from GL types to native bools consistant. Some places would compare with "== GL_TRUE" and others with "!= GL_FALSE". This behaviour is not in the OpenGL spec but "!= GL_FALSE" is the most standard and follows the same rules as C and C++. Remove un-necessary validation that params are either GL_TRUE or GL_FALSE. Update some internal storage from GLboolean to bool. BUG=angleproject:2258 Change-Id: I12adbe2d24318a206521ca6ad1099ee7e2bf677e Reviewed-on: https://chromium-review.googlesource.com/779799 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Olli Etuaho bb0775da 2017-11-10T16:20:43 Add flag for turning off initializing variables with loops This flag is needed to toggle upcoming variable initialization mode which uses for loops to optimize the compilation process. Initializing variables using for loops will be turned on by default, but it needs to be turned off in Chromium in certain cases. Chromium will use the flag added in this patch and that code will need to go into Chromium before finishing the implementation in ANGLE. BUG=chromium:735497 Change-Id: I3a0e7b7c6cebe60afa72964fbd0caf3b1eafccbc Reviewed-on: https://chromium-review.googlesource.com/763451 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 661fc487 2017-10-16T12:17:05 Work around NVIDIA GLSL vector-scalar op bug This adds a new AST transform VectorizeVectorScalarArithmetic. The AST transform works around incorrect handling of certain types of GLSL arithmetic operations by NVIDIA's GL driver. It works around only the most common cases where the bug reproduces, since detecting all the cases would take more sophisticated analysis of the code than what is currently easily implementable in ANGLE. When a float add operator has both vector and scalar operands, the AST transform turns the scalar operand into a vector operand. Example: vec4 f; f += 1.0; gets turned into: vec4 f; f += vec4(1.0); When a vector constructor contains a binary scalar float multiplication or division operation as its only argument, the AST transform turns both operands of the binary operation into vector operands. Example: float f, g; vec4(f * g); gets turned into: float f, g; vec4(vec4(f) * vec4(g)); Another example with compound assignment: float f, g; vec4(f *= g); gets turned into: float f, g; vec4 s0 = vec4(f); (s0 *= g, f = s0.x), s0; This latter transformation only works in case the compound assignment left hand expression doesn't have side effects. BUG=chromium:772651 TEST=angle_end2end_tests Change-Id: I84ec04287793c56a94845a725785439565debdaf Reviewed-on: https://chromium-review.googlesource.com/721321 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez cda6af19 2017-10-30T19:20:37 Split pixelBuffer from pack/unpack state This will refactor will help use packed enums for buffer targets. BUG=angleproject:2169 Change-Id: Ie7ed3e105f89457c67027e6598d7e29503ad355c Reviewed-on: https://chromium-review.googlesource.com/745181 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang a579ded1 2017-11-06T10:45:45 Extend BGRA8 glGetInternalformativ workaround to ES drivers. Some ES drivers also generate INVALID_ENUM errors when querying this format, particuarly on linux Mesa+nouveau. BUG=angleproject:2219 Change-Id: I7b9cf9b003a0125fabdda63038b4c8941710e1db Reviewed-on: https://chromium-review.googlesource.com/754329 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Bryan Bernhart (Intel Americas Inc) 2a35741b 2017-09-05T10:42:47 WebGLCompatibility: Disable ES format extensions by default. Prevents format validation errors with WebGL context. BUG=angleproject:1523 Change-Id: Iddc525eeb467de0139e166dad0893f3bea3ef35f Reviewed-on: https://chromium-review.googlesource.com/650807 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kai Ninomiya d63d0007 2017-10-06T13:11:13 dontInitializeUninitializedLocals on Qualcomm only SH_INITIALIZE_UNINITIALIZED_LOCALS triggers a very unpredictable crash in the shader compiler on Qualcomm Adreno (at least 4xx) on Marshmallow. Bug: angleproject:2046 Change-Id: I9a109f7ff442b4e9d3880d137f1a55a19105bcef Reviewed-on: https://chromium-review.googlesource.com/705930 Commit-Queue: Kai Ninomiya <kainino@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 10ce2d28 2017-09-16T09:47:19 GL: Fix 64-bit caps query on older GL drivers. GetInteger64v wasn't introduced until GL 3.2, but some of the enums for caps that are 64-bit in 3.2 (eg, max uniform block size) were first introduced as 32-bit values in extensions. This comes up when trying to use RenderDoc's OpenGL simulator, since it exposes some relevant extensions and only uses core version 3.1. BUG=None Change-Id: Ie4be71b5c8656aae0fe08c270a53f5ef86c99710 Reviewed-on: https://chromium-review.googlesource.com/599030 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kai Ninomiya f3d57454 2017-09-15T14:28:50 Enable SH_INITIALIZE_UNINITIALIZED_LOCALS on Mac BUG=angleproject:2041 Change-Id: Id5a85c40358b018c17984ac26ee7f97f10584d4b Reviewed-on: https://chromium-review.googlesource.com/669642 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Jiajia Qin 8a7b3a0c 2017-08-25T16:05:48 Reland 'Remove IndexRange retrieving in validation' This change adds GL_KHR_robust_buffer_access_behavior support. The old change is in https://chromium-review.googlesource.com/c/angle/angle/+/607413 BUG=755897, angleproject:1393, angleproject:1463 Change-Id: I04a1132c3ae8d3a766194df61c4ff7bf0b084f03 Reviewed-on: https://chromium-review.googlesource.com/640750 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Martin Radev ced5c86c 2017-08-17T16:05:29 D3D11: Handle multi-view Draw* calls Because the ANGLE_multiview extension uses instancing to multiply geometry for each view, Draw* calls with an active multiview program have to be handled in the follwing way: 1) Convert non-instanced Draw calls to their instanced versions. 2) Multiply the number of instances in an instanced Draw call by the number of views. The patch also applies the viewport offsets to the viewport and scissor rectangle and propagates the computed viewports and scissors to the D3D11 runtime. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I8b4295c95c2cc0c1046c67e1fb1a782a46703292 Reviewed-on: https://chromium-review.googlesource.com/618331 Commit-Queue: Martin Radev <mradev@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 47bb4933 2017-08-03T11:52:13 Implement CopyTexture functions for uint texture formats. BUG=angleproject:1932 Change-Id: I6474237cbb82b59a0bd40c1b9b9e2455952d3755 Reviewed-on: https://chromium-review.googlesource.com/600510 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 13c0dd46 2017-07-04T18:27:01 Add texture rectangle extension. This is needed to support binding IOSurfaces to textures on OSX. This commit adds support in the API and tests, but didn't need to implement compiler changes as it already supported ARB_texture_rectangle. Implementation of CHROMIUM_opy_texture for rectangle texture and the spec are left for follow-up commits. Change-Id: I45c66be763a9d3f6f619640f9f95f39b05c70867 Reviewed-on: https://chromium-review.googlesource.com/559106 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kenneth Russell 6938285b 2017-07-21T16:38:44 Fix BlitFramebuffer validation for BGRA sources and targets. It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and destinations when resolving multisampled renderbuffers. Expand BlitFramebuffer's validation to handle this case. Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work around an error generated on macOS when querying GL_MAX_VARYING_COMPONENTS. Expand the BlitFramebuffer tests to cover these cases and start running them on the OpenGL backend. Fix detectition of multisampled D3D11 rendertargets when the sample count is 1. BUG=angleproject:891 Change-Id: Ief5531756651caa66f612e647d3d5c05c8c51ff5 Reviewed-on: https://chromium-review.googlesource.com/587459 Reviewed-by: Kenneth Russell <kbr@chromium.org>
Corentin Wallez 26cf35a8 2017-07-26T11:01:02 Revert "Fix BlitFramebuffer validation for BGRA sources and targets." This reverts commit 17d270311efcd8c72f251a67e726518278e81c26. Reason for revert: - New test fails on NVIDIA and AMD on Windows when using the backbuffer FAST_PATH. - SetUp code ASSERT_GL_NO_ERROR (line 269) but a GL error happens on all Windows and Linux Intel OpenGL. Original change's description: > Fix BlitFramebuffer validation for BGRA sources and targets. > > It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and > destinations when resolving multisampled renderbuffers. Expand > BlitFramebuffer's validation to handle this case. > > Work around a bug in macOS' OpenGL driver querying the number of > samples for GL_BGRA8. > > Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work > around an error generated on macOS when querying > GL_MAX_VARYING_COMPONENTS. > > Expand the BlitFramebuffer tests to cover these cases and start > running them on the OpenGL backend. > > BUG=angleproject:891 > > Change-Id: I4829585d2b6428ce0bc7509c4734d33709a0930b > Reviewed-on: https://chromium-review.googlesource.com/582268 > Commit-Queue: Geoff Lang <geofflang@chromium.org> > Reviewed-by: Kenneth Russell <kbr@chromium.org> > Reviewed-by: Geoff Lang <geofflang@chromium.org> TBR=geofflang@chromium.org,kbr@chromium.org Change-Id: I220bc482194cf7fad5e7e732a6d043ce0d504d79 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:891 Reviewed-on: https://chromium-review.googlesource.com/586428 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Kenneth Russell 17d27031 2017-07-21T16:38:44 Fix BlitFramebuffer validation for BGRA sources and targets. It is legal to blit between GL_RGBA8 and GL_BGRA8 sources and destinations when resolving multisampled renderbuffers. Expand BlitFramebuffer's validation to handle this case. Work around a bug in macOS' OpenGL driver querying the number of samples for GL_BGRA8. Query GL_MAX_VERTEX_OUTPUT_COMPONENTS on the Core Profile to work around an error generated on macOS when querying GL_MAX_VARYING_COMPONENTS. Expand the BlitFramebuffer tests to cover these cases and start running them on the OpenGL backend. BUG=angleproject:891 Change-Id: I4829585d2b6428ce0bc7509c4734d33709a0930b Reviewed-on: https://chromium-review.googlesource.com/582268 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Olli Etuaho ab918821 2017-07-14T17:03:42 Clamp point size to maximum point size from the API on NVIDIA NVIDIA OpenGL drivers have a bug where the point size range is being reported incorrectly - it appears the core GL driver incorrectly gives the range for smooth points, when it should be giving the range for aliased points. Clamp the actual point size to the maximum point size reported from the API so that the GLES spec is followed. The same workaround seems to be necessary also on Android. The issue was revealed by the trybots, and has not been fully diagnosed though. The newly added test fails on AMD OpenGL. As a part of this change, the existing tests in PointSpritesTest are refactored to use gl_raii. BUG=chromium:740560 TEST=angle_end2end_tests Change-Id: Ic4a66c9ea16f5ae76beb3bb6577716d10c3b226e Reviewed-on: https://chromium-review.googlesource.com/574598 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Martin Radev 318f9aa5 2017-05-17T17:47:28 Initialize ANGLE_multiview caps and workaround state The patch checks whether ANGLE_multiview can be supported in the OpenGL renderer, updates the caps and adds a workaround field to enable multiview support through the NV_viewport_array2 extension. BUG=angleproject:2062 TEST=angle_end2end_tests Change-Id: I99dae10564db7bcca41d7624f8de272c1d996e09 Reviewed-on: https://chromium-review.googlesource.com/567934 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho a3e1f5f7 2017-07-06T13:21:07 Fix determining max combined uniform blocks The previous code was using a completely unrelated variable to compute max combined uniform blocks limit. BUG=angleproject:2099 Change-Id: I9e56b50a92790f525dda50adca52b6ac5edfc95a Reviewed-on: https://chromium-review.googlesource.com/562276 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 50c562de 2017-06-06T14:43:30 Re-land: Don't expose non-conformant multisampling modes on GL Re-landing with a fallback for failed internal format queries to work around issue seen on Shield TV. Also fixed wrong handling of integer RG formats in isRequiredRenderbufferFormat. Some NVIDIA GL drivers expose non-conformant multisampling modes. The conformance of multisampling modes can be queried using the extension NV_internalformat_sample_query. Use it to filter out the non-conformant modes from the modes that are exposed by ANGLE. The MAX_SAMPLES value and other similar values stored in caps also need to be lowered to match the maximum number of samples exposed for required formats. There seems to be an NVIDIA driver bug related to querying STENCIL_INDEX8 multisample format. Work around this by querying DEPTH24_STENCIL8 instead. There's also some confusion around whether RGB9_E5 should be renderable. Once the floating point texture extensions got rolled into the core GL spec, it was eventually made clear that RGB9_E5 is intended not to be renderable. The extension specs that predate float textures in the core spec do suggest that it would be renderable, but in practice drivers that advertise the extension strings don't reliably implement RGB9_E5 as renderable. Solve this by disabling it as a renderable format and adding an explanatory comment. BUG=chromium:682815 TEST=angle_end2end_tests, dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* Change-Id: I727f03045a1534d6764b571e6d839243705d25b3 Reviewed-on: https://chromium-review.googlesource.com/551957 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 27a60631 2017-06-30T15:12:01 Re-apply UBO binding workaround on program save. The workaround which was previously defined to only apply on load also seems to affect save on some AMD drivers. BUG=angleproject:1637 BUG=angleproject:1897 Change-Id: Ia01a1420a484f3c2682ce97eaab18baccfb66a50 Reviewed-on: https://chromium-review.googlesource.com/558008 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Yuly Novikov c8a8b843 2017-06-28T01:16:41 Revert "Don't expose non-conformant multisampling modes on GL" This reverts commit 3cd0dd370f08e7126fe19b761206280c64f80cd1. Reason for revert: crashes on NVIDIA Shield TV https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28NVIDIA%20Shield%20TV%29/builds/1816 Original change's description: > Don't expose non-conformant multisampling modes on GL > > Some NVIDIA GL drivers expose non-conformant multisampling modes. The > conformance of multisampling modes can be queried using the extension > NV_internalformat_sample_query. Use it to filter out the > non-conformant modes from the modes that are exposed by ANGLE. > > The MAX_SAMPLES value and other similar values stored in caps also > need to be lowered to match the maximum number of samples exposed > for required formats. > > There seems to be an NVIDIA driver bug related to querying > STENCIL_INDEX8 multisample format. Work around this by querying > DEPTH24_STENCIL8 instead. > > There's also some confusion around whether RGB9_E5 should be > renderable. Once the floating point texture extensions got rolled > into the core GL spec, it was eventually made clear that RGB9_E5 > is intended not to be renderable. The extension specs that predate > float textures in the core spec do suggest that it would be > renderable, but in practice drivers that advertise the extension > strings don't reliably implement RGB9_E5 as renderable. Solve this > by disabling it as a renderable format and adding an explanatory > comment. > > BUG=chromium:682815 > TEST=angle_end2end_tests, > dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* > > Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e > Reviewed-on: https://chromium-review.googlesource.com/525515 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> TBR=geofflang@chromium.org,jmadill@chromium.org,cwallez@chromium.org,oetuaho@nvidia.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: chromium:682815 Change-Id: I1ebdf52c3fab1526f5a561ac4c8555e305ef2243 Reviewed-on: https://chromium-review.googlesource.com/551164 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill ffe00c03 2017-06-27T16:26:55 Add program cache transform feedback workaround. On Qualcomm devices, they don't seem to correctly save transform feedback info. Work around this by disabling caching on these devices. This mirrors a Chromium workaround. BUG=angleproject:2088 Change-Id: I6496d2fb6a03788379a6968bcd5eb3a9cb9d15d4 Reviewed-on: https://chromium-review.googlesource.com/549981 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 761b02c8 2017-06-23T16:27:06 Add an applyNativeWorkarounds context impl hook. This method can allow the implementation to override the Context's workarounds. Use this design pattern now that we have access to the gl::Context everywhere - we don't need to cache a local copy in the Renderer objects. This will be used to apply a Shader Program Cache workaround on the GL level, that will only be used for the GLES back-end on Qualcomm. BUG=angleproject:2088 Change-Id: I6da25c5c29c3ba01b8820c5234d1b92dd2d2121a Reviewed-on: https://chromium-review.googlesource.com/549980 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 3cd0dd37 2017-06-06T14:43:30 Don't expose non-conformant multisampling modes on GL Some NVIDIA GL drivers expose non-conformant multisampling modes. The conformance of multisampling modes can be queried using the extension NV_internalformat_sample_query. Use it to filter out the non-conformant modes from the modes that are exposed by ANGLE. The MAX_SAMPLES value and other similar values stored in caps also need to be lowered to match the maximum number of samples exposed for required formats. There seems to be an NVIDIA driver bug related to querying STENCIL_INDEX8 multisample format. Work around this by querying DEPTH24_STENCIL8 instead. There's also some confusion around whether RGB9_E5 should be renderable. Once the floating point texture extensions got rolled into the core GL spec, it was eventually made clear that RGB9_E5 is intended not to be renderable. The extension specs that predate float textures in the core spec do suggest that it would be renderable, but in practice drivers that advertise the extension strings don't reliably implement RGB9_E5 as renderable. Solve this by disabling it as a renderable format and adding an explanatory comment. BUG=chromium:682815 TEST=angle_end2end_tests, dEQP-GLES31.functional.state_query.internal_format.renderbuffer.* Change-Id: I2218e3a23ea7b48a0615fea77a91897dc7d5fe9e Reviewed-on: https://chromium-review.googlesource.com/525515 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Corentin Wallez 80cdc376 2017-04-18T13:27:30 DisplayWGL: try all GL context version from the highest The only way to get a core profile context of the highest version using CreateContextAttrib is to try creationg contexts in decreasing version numbers. It might look that asking for a core context of version (0, 0) works on some driver but it create a _compatibility_ context of the highest version instead which might not be supported on some drivers. BUG=angleproject:1994 Change-Id: Ic8a33243909c54ea5940ee81c9c866b141bea420 Reviewed-on: https://chromium-review.googlesource.com/480739 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 9733ceef 2017-05-11T19:14:35 Initialize uninitialized locals in GLSL output Guarantee that local variables are initialized before they are used in GLSL output. In HLSL output all variables were already being initialized. Locals are initialized using an AST transform. The local variable init can only be run after some simplification of the AST, so that it is able to handle complex cases like: for (int i[2], j = i[0]; i[0] < 3; ++i[0]) { } If we're dealing with ESSL 1.00 which lacks array constructors, in this kind of case the uninitialized array initialization code needs to be hoisted out of the loop init statement, and the code also needs to make sure that j's initializer is run after i is initialized. Another complex case involves nameless structs. This can be an issue also in ESSL 3.00 and above: for (struct { float f; } s; s.f < 1.0; ++s.f) { } Since the struct doesn't have a name, its constructor can not be used. We solve this by initializing the struct members individually, similarly to how arrays are initialized in ESSL 1.00. Initializing local variables is disabled on Mac and Android for now. On Mac, invalid behavior was exposed in the WebGL 2.0 tests when enabling it. On Android, the dEQP test runs failed for an unknown reason. Bugs have been opened to resolve these issues later. BUG=angleproject:1966 TEST=angle_end2end_tests, WebGL conformance tests Change-Id: Ic06927f5b6cc9619bc82c647ee966605cd80bab2 Reviewed-on: https://chromium-review.googlesource.com/504728 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Corentin Wallez e9ed3d86 2017-05-15T15:51:37 Use unused uniform blocks workarounds on Linux AMD. The Linux AMD driver optimizes out uniform blocks where WebGL2 and maybe OpenGL ES 3 forbids it. Try to fix this by enabling the workaround that was made for the same problem on OSX. BUG= Change-Id: If3b18ec1f463582d7594221a6f2a08d25207e737 Reviewed-on: https://chromium-review.googlesource.com/506189 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 677bb6ff 2017-04-05T12:40:40 Update checks for floating point renderability. * Expose GL_CHROMIUM_color_buffer_float_rgb and GL_CHROMIUM_color_buffer_float_rgba * Fix many texture formats that were incorrectly checking the wrong extension for support or renderability. * Make all floating point texture extensions dynamically enableable. BUG=angleproject:1958 BUG=angleproject:1715 Change-Id: Iefccc8b5ae5edd97623affa9de05b1d9af5c9598 Reviewed-on: https://chromium-review.googlesource.com/468450 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang ba992ab5 2017-04-19T11:18:14 Fix HLSL 3 generation of shaders with texture LOD. BUG=angleproject:2002 Change-Id: If8e6bbaeb5769341f92f05025eafb6a202fec437 Reviewed-on: https://chromium-review.googlesource.com/481680 Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang ca27139e 2017-04-05T12:30:00 Key the format tables on internal format and type. Keying the format tables on internal format alone is not enough to fully validate the unsized formats which require additional type information. This CL has no functional changes, it just splits the tables and updates the calls to GetInternalFormat info to provide type information when the format is not sized. BUG=angleproject:1523 BUG=angleproject:1958 BUG=angleproject:1228 Change-Id: I37e5201e7f54fa8eca01b8a6e64b11a6b94484e7 Reviewed-on: https://chromium-review.googlesource.com/468449 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shao 86904b81 2017-03-21T09:30:59 ES31: Add workaround for illegal MAX_VERTEX_ATTRIB_STRIDE on Linux AMD Query of MAX_VERTEX_ATTRIB_STRIDE on some Linux AMD OpenGL drivers returns 0 even if the context is OpenGL 4.4 and 4.5, which is against SPEC and will block the implementation of ES3.1 feature Vertex Attrib Binding. This patch adds the workaround for this bug by choosing an emulated value (2048) as the value of MAX_VERTEX_ATTRIB_STRIDE on Linux AMD OpenGL drivers. BUG=angleproject:1936 TEST=angle_end2end_tests Change-Id: I831bda6cb94b2489d09735622150d35aa1948274 Reviewed-on: https://chromium-review.googlesource.com/457254 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shao 7a0b3044 2017-03-10T10:03:33 Reland "ES31: Add test on large strides" In OpenGL 4.3 there is no limit on the maximum value of stride. This patch choose an emulated value for OpenGL 4.3 to fix the fyi failure on Linux AMD. BUG=angleproject:1593 Change-Id: I83cecc2ed1a3734dc8b8df3edb48ecc16039ba6e Reviewed-on: https://chromium-review.googlesource.com/452746 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 08c24e6e 2017-02-02T18:52:43 ES: Don't expose EXT_draw_buffers if extension not present. Emulation of this extension would potentially require rewriting ESSL 1.00 shaders as 3.00 when the extension is missing, and we're on a GLES 3.0 context. For now, it's easier to disable the extension when native support is lacking. BUG=angleproject:1828 Change-Id: I8eabb8efccc2ddd5fafd3521657ea68cc9e1d1e0 Reviewed-on: https://chromium-review.googlesource.com/436144 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill cc6ac25e 2017-01-25T12:57:21 GLES: Expose OES_mapbuffer in GLES2 on GLES3. This extension is mandatory for EXT_map_buffer_range support. We can emulate it using GLES 3.0 core map functionality. BUG=angleproject:1751 Change-Id: Idba09ce7276603d5556039f4a49aa0b87cae22aa Reviewed-on: https://chromium-review.googlesource.com/431826 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Xinghua Cao 0aff35eb 2017-01-16T13:46:52 OpenGL 4.2 is required when using ARB_compute_shader extension BUG=angleproject:1702 TESTCASE=angle_end2end_tests Change-Id: I45fe21bc14310b9c873e83004a8ac8766865fbb9 Reviewed-on: https://chromium-review.googlesource.com/428690 Reviewed-by: Yunchao He <yunchao.he@intel.com> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 7b91d0c1 2016-12-16T14:46:26 OpenGL: implement GL_ANGLE_translated_shader_source BUG=chromium:668223 Change-Id: I2068370f3e6963f297d0cb6545c40abf84d543ce Reviewed-on: https://chromium-review.googlesource.com/421092 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 081b6e2b 2016-12-14T10:53:20 Extend UBO binding workaround to Android. This seems to fail on the Nexus 6P, and possibly 5X. Does not seem to affect some other devices. BUG=angleproject:1660 Change-Id: I1d456b2033fb6b2a664ac24ea0a3f7ff160922ab Reviewed-on: https://chromium-review.googlesource.com/419856 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a7d12dc7 2016-12-13T15:08:19 Store uniform block bindings in program binaries. This affects all back-ends - we weren't saving this. Note that bindings can only be set after program linking. The spec is fairly clear in that any programs saved must be loadable and runnable under the same set of state, which would include block bindings. Also add validation for zero binary formats in GetProgramBinary. Also add a workaround for AMD where the block bindings were not applied properly after link, similarly to our original bug. This CL also includes a few fixups for GLProgram (raii). BUG=angleproject:1637 Change-Id: Iae068eb4e1e4c763aa9f9332c033e38708026c8f Reviewed-on: https://chromium-review.googlesource.com/418393 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho da9fb093 2016-12-09T17:32:29 Work around atan(y, x) bug on NVIDIA atan(y, x) is not always returning expected results on NVIDIA OpenGL drivers between versions 367 and 375. Work around this by emulating atan(y, x) using the regular atan(x) function. A fix to the driver is expected in a future release. It is most convenient to implement the vector atan(y, x) functions by using the scalar atan(y, x) function. Support for simple dependencies between emulated functions is added to BuiltInFunctionEmulator. In the current implementation one function is allowed to have at most one other function as its dependency. BUG=chromium:672380 TEST=angle_end2end_tests Change-Id: I9eba8b0b7979c7c7eaed353b264932e41830beb1 Reviewed-on: https://chromium-review.googlesource.com/419016 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qiankun Miao f52fe93d 2016-12-07T13:39:15 Work around unary minus operator float issue on Intel Mac 10.11 Result of -float is wrong on Intel Mac 10.11 drivers. Replace -float with 0.0 - float to work around this issue. BUG=308366 BUG=672380 Change-Id: I53bc2eda7259fff5805bec39896fc7b7a6eaf665 Reviewed-on: https://chromium-review.googlesource.com/417169 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Corentin Wallez 729a9c97 2016-12-05T14:22:47 Don't require GL_ARB_gpu_shader5 in order to support ES 3.0. ES 3.0 doesn't require non-constant sampler array indexing, and we can't require it for ES 2 without breaking WebGL for some users. BUG=671280 Change-Id: Ib04446284acc92410a90c683a3d222871de554a8 Reviewed-on: https://chromium-review.googlesource.com/416195 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Geoff Lang a20fc005 2016-08-08T15:19:56 Implement GL_CHROMIUM_sync_query for GL. BUG=angleproject:1366 Change-Id: I9e44679754eb704b390191c28206dedc3dc7cc4f Reviewed-on: https://chromium-review.googlesource.com/367082 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Geoff Lang 57ce9ea2 2016-11-24T12:03:14 Implement EXT_discard_framebuffer for the GL backend. BUG=angleproject:1634 Change-Id: I3822b99b59d4653e4d9a2c1d3dd16734f2050fae Reviewed-on: https://chromium-review.googlesource.com/414437 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 133a2ecb 2016-11-17T16:28:03 Implement CHROMIUM_copy_texture for OpenGL. This also makes BlitGL work correctly on OpenGL ES (provided vertex arrays are available) BUG=angleproject:1356 Change-Id: Icb7cef35bebfe6672220aa0b312ab89187dbf585 Reviewed-on: https://chromium-review.googlesource.com/412452 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 76cdbd51 2016-09-23T16:51:04 Add basic initialization code for ContextNULL so it can run some tests. BUG=angleproject:1468 Change-Id: I8dfc9a3c71e5638de22bc9d9a5dadfb495ef23a7 Reviewed-on: https://chromium-review.googlesource.com/388846 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Qiankun Miao 41f9f673 2016-11-16T17:04:36 Remove invariant qualifier for ESSL 3.0 on AMD driver AMD driver in Linux requires invariant qualifier to match between shaders even for GLSL >= 4.2. This conflicts with ESSL 3.0 which disallows invariant qualifier in fragment shader. Remove invariant qualifier in vertex shader to workaround AMD driver bug. BUG=chromium:639760 TEST=webgl2_conformance Change-Id: Id5adf7e7032105486df90a1f200471ea81ee5c36 Reviewed-on: https://chromium-review.googlesource.com/411917 Reviewed-by: Zhenyao Mo <zmo@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Zhenyao Mo <zmo@chromium.org>
Qiankun Miao 89dd8f37 2016-11-09T12:59:30 Remove invariant declaration in vertex shader for translation from ESSL 3.00 to GLSL <= 4.1 This is a follow-up patch of https://chromium-review.googlesource.com/408569. This CL removes invariant declaration in ESSL 3.00 vertex shader, such like: " out vec4 foo; invariant foo; " This CL also adds the workarounds in libANGLE. BUG=chromium:639760 TEST=webgl2_conformance Change-Id: I568ab51a9a2f5da10d1aff0b63aae8805097e081 Reviewed-on: https://chromium-review.googlesource.com/409157 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Qiankun Miao 705a9194 2016-08-29T10:05:27 Reland "Remove invariant qualifier for input in fragment shader" This relands https://chromium-review.googlesource.com/#/c/400005/. ESSL and GLSL are not consistent on invariant matching in vertex shader and fragment shader. See the following rules: ESSL 1.00 - input and output must match ESSL 3.00 - only output, inputs cannot be declared as invariant. GLSL 1.10.59 - does not exist GLSL 1.20.8 - input and output must match GLSL 1.30.10 - input and output must match GLSL 1.40.8 - input and output must match GLSL 1.50.11 - input and output must match GLSL 3.30.6 - input and output must match GLSL 4.00.9 - input and output must match GLSL 4.10.6 - input and output must match GLSL 4.20.11 - input can omit invariant GLSL 4.30.8 - input can omit invariant GLSL 4.40.9 - input can omit invariant GLSL 4.50.5 - input can omit invariant Since GLSL 4.20, invariant qualifier description were changed to: " Only variables output from a shader (including those that are then input to a subsequent shader) can be candidates for invariance. This includes user-defined output variables and the built-in output variables. As only outputs need be declared with invariant, an output from one shader stage will still match an input of a subsequent stage without the input being declared as invariant. " It's not very clear if input in fragment can be declared as invariant. Mesa driver disallows use of input declared as invariant in fragment shader, while other drivers may allow it. This CL removes invariant declaration for input in fragment shader except AMD driver in Linux. AMD's driver obviously contradicts the spec by forcing invariance to match between vertex and fragment shaders. BUG=chromium:639760, chromium:659326 TEST=conformance/glsl/misc/shaders-with-invariance.html and conformance/glsl/bugs/invariant-does-not-leak-across-shaders.html Change-Id: I0aa9be14f0cee7a11a249c91fba27c570c52ca1b Reviewed-on: https://chromium-review.googlesource.com/404228 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Geoff Lang 1d2c41d6 2016-10-19T16:14:46 Implement GL_EXT_sRGB_write_control for GL. BUG=angleproject:1547 BUG=655247 Change-Id: I3f04ddc7032e4a47eb21ff3b8586c5b47415bb64 Reviewed-on: https://chromium-review.googlesource.com/400958 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>