src/libANGLE/renderer/gl/renderergl_utils.cpp


Log

Author Commit Date CI Message
Peng Huang fa9eff37 2020-02-17T23:49:36 Disable GL_EXT_semaphore_fd for Mesa version < 19.3.5 on AMD GPUs Bug: chromium:1053516 Change-Id: Idfc271ac70c8ded7d05a258beb4a7578a5a652c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2062162 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Xinghua Cao c8676d4b 2019-11-25T11:38:19 Unlimit texture size on relatively new linux If limit texture size to a small number, application may need to reshape texture, lead to more discontinuous memory access and performance loss. Bug: angleproject:4086 Change-Id: I502a90535c2e3d13738e23827f4712a77987585e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1934048 Reviewed-by: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
Alexey Knyazev d8c4b5fb 2020-01-31T16:47:51 Expose ASTC 2D on OpenGL Bug: angleproject:4372 Change-Id: Ic1800ac10b12547ca9816f7ad9dfd62f83f227c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033066 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Alexey Knyazev 9e774041 2020-01-31T15:09:01 Update S3TC GL extension strings Added avoid_dxt1_srgb_texture_format workaround Bug: angleproject:4266 Change-Id: I286a9c66f6ea1d2c9d3587f6ca85608336eb44a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033065 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Kenneth Russell 07795d47 2020-01-31T16:08:52 Disable rewriteRowMajorMatrices workaround. It's causing flaky crashes in tests. Leave the revised code in place so it's easier to debug. Disable test which required the workaround. Bug: angleproject:2273 Bug: angleproject:3843 Change-Id: Iebb682bd3c6282031cc57eda5d3d4d5636be7294 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2033870 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org>
Kenneth Russell e196bc85 2020-01-17T13:11:20 Add driver bug workaround for rewriting row major matrices. Joint work with syoussefi@, who wrote the RewriteRowMajorMatrices pass, and revised it for this CL to not rely on the NameNamelessUniformBuffers pass - which was breaking it on the GL backend. Hook up previously written RewriteRowMajorMatrices transformation, and enable on all GPU types on macOS. It is needed at least for AMD and Intel GPUs. Add a new test which verifies the behavior of dynamically-indexed arrays of row-major matrices. Bug: angleproject:2273 Bug: angleproject:3843 Change-Id: Id582f9cf6b9b1a59091aab1786539174f360b705 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2008717 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
shrekshao eca11cc8 2020-01-28T14:18:40 SH_CLAMP_INDIRECT_ARRAY_BOUNDS logic update Remain the old hardware requirement for turning on clampArrayAccess. But also turns it on universally for WebGL context. So that we won't suffer from clampArrayAccess not handled properly on some compute shader deqp tests. Bug: chromium:1042252, angleproject:4361 Change-Id: Ib11affd6df27ce7d2100980d2b8decdee36876e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2026029 Reviewed-by: James Darpinian <jdarpinian@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
shrekshao 571ceb5f 2020-01-24T13:11:54 Turn on clampArrayAccess globally but off for compute shaders out-of-bounds-uniform-array-access.html could fail on Linux Nvidia OpenGL even if GL_KHR_robust_buffer_access_behavior is available. Turning clampArrayAccess on globally but turn it off for Compute Shader, which is not used by WebGL so should be okay. FYI: The failures when turning this on globally are all in compute shaders. One could be fixed by using int cast instead of float for the clamp modifier. The other is due to array.length() couldn't return correct result for array in SSBO. Bug: chromium:1042252 Change-Id: Ic6f7adae4600d35207646881b18990a0c25a889a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2020463 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Kenneth Russell <kbr@chromium.org>
James Darpinian 512abe85 2020-01-23T13:28:01 Clamp array accesses when robust buffer access not available Apple doesn't support GL_KHR_robust_buffer_access_behavior, so we don't know if we can trust the driver to be safe with out of bounds array accesses. It's not currently failing the out of bounds access tests, but this may be coincidental. In general it makes sense to always clamp array accesses when GL_KHR_robust_buffer_access_behavior is not supported. The validating command decoder actually enables this workaround unconditionally, but that seems unnecessary. Bug: angleproject:2978 Change-Id: Ib061dd4db10e044ced0dff95d0aac6a91f15b100 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2018182 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Alexis Hetu 94de306d 2020-01-14T16:18:56 Extensions suffixes Added NV/OES suffixes to relevant Extensions members. Bug: angleproject:3104 Change-Id: Ia1798157086230bde8d11c6fcb4fe93211e996ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2013168 Reviewed-by: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Alexis Hetu e0a28ba4 2020-01-14T09:44:27 Add blendable checks to GL_EXT_color_buffer_float The GL_EXT_color_buffer_float spec https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_color_buffer_float.txt mentions that some of the formats must be blendable: "Blending applies only if the color buffer has a fixed-point or floating-point format. If the color buffer has an integer format, proceed to the next operation. Furthermore, an INVALID_OPERATION error is generated by DrawArrays and the other drawing commands defined in section 2.8.3 (10.5 in ES 3.1) if blending is enabled and any draw buffer has 32-bit floating-point format components." So any non 32-bit floating-point must be blendable. Bug: angleproject:4291 Change-Id: I850fb13b71e4ad03fd07e2a265896c9106bc0ce1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2001478 Commit-Queue: Alexis Hétu <sugoi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kenneth Russell 12ce8f68 2020-01-03T16:40:06 Upstream WebKit's iOS port of ANGLE. Added the EAGL backend authored by Dean Jackson from Apple, and the refactoring changes needed to support it side-by-side with the macOS backend. Ran "git cl format" against these diffs. Defined the EGL_ANGLE_device_eagl extension and allocated an enum out of ANGLE's reserved range. The iOS backend is not yet included in any of the GN files. Bug: angleproject:4263 Change-Id: I631c32930433c03bb16a242955ffedf55174bb29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987278 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: James Darpinian <jdarpinian@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
Kenneth Russell 7a37d3ac 2020-01-05T13:52:03 Work around Intel driver bug with CopyTex{Sub}Image2D/DeleteTextures. Dependencies seem to be incorrectly tracked in some Intel OpenGL drivers (on macOS specifically), causing crashes in glDeleteTextures if a GL command buffer is being constructed where those textures are destinations of CopyTexImage2D/CopyTexSubImage2D. Work around this bug by flushing before texture deletion if CopyTex{Sub}Image have been called recently. The tracking is only done on a per-context rather than a per-device basis, but seems sufficient to work around the problem as identified. Tested both with new ANGLE test on affected hardware, and in WebKit's ANGLE backend for WebGL. Works around the crash reported in https://bugs.webkit.org/show_bug.cgi?id=205707 . Bug: angleproject:4267 Change-Id: I2266a5590759f6a3f19080def08710ef4b66d463 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1987932 Commit-Queue: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi f8ae5dc6 2019-12-20T16:32:09 GL: Enable EXT_gpu_shader5 Bug: angleproject:3569 Change-Id: I08666bde75ac158e051817e689e2c0b82d6b6f70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1978579 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
shrekshao 81ee4d29 2019-12-04T17:05:11 Workaround EXT_texture_norm16 for OpenGL ES drivers Implement a workaround for widespread bugs calling glReadPixels with RGBA/UNSIGNED_SHORT against R16/RG16 color attachments. Read back the data using the GL_IMPLEMENTATION_COLOR_READ_FORMAT, and then rearrange the read back pixels to fit the RGBA layout. Also skip RGB16/RGB16_SNORM texture sample test on Nexus 5X/Nexus 6P due to a another driver bug. Bug: chromium:1000354, angleproject:4214, angleproject:4215, angleproject:4245 Change-Id: Iedea6f4136878cac5ad0dec3757c77b73502e1cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1952166 Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Shrek Shao <shrekshao@google.com>
Yan 17b3c2f3 2019-10-14T14:13:59 Implement SamplerVideoWEBGL for WEBGL_video_texture extension on desktop WEBGL_video_texture is an extension that will improve uploading video frame to WebGL performance. (https://www.khronos.org/registry/webgl/extensions/proposals/WEBGL_video_texture/) This extension introduced a new texture type TEXTURE_VIDEO_IMAGE_WEBGL and a new sampler type samplerVideoWEBGL to sample it. In chromium implementation, TEXTURE_VIDEO_IMAGE_WEBGL maps to different native texture type based on platform. On desktop, it maps to GL_TEXTURE2D(Currently supported). On Android, it should map to GL_TEXTURE_EXTERNAL(TODO). SamplerVideoWEBGL needs to be mapped to sampler2D or samplerExternalOES according to TEXTURE_VIDEO_IMAGE_WEBGL implementation. This patch implements samplerVideoWEBGL in Angle to support WEBGL_video_texture on desktop. In this case, samplerVideoWEBGL should map to sampler2D. Bug: chromium:776222, angleproject:3889 Change-Id: Idb0a5fcde37ca75ccc1181226b91f257212e7500 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1866274 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 63c15519 2019-12-05T12:59:13 Also use GL_RENDERER to determine vendorID ~10% or more Linux users* do not have AMD/ATI in the GL_VENDOR, only in GL_RENDERER. Our heuristics only checked GL_VENDOR, so this CL adds GL_RENDERER to the string being checked to find the vendor ID. (*According to https://feedback.wildfiregames.com/report/opengl/feature/GL_VENDOR) Bug: angleproject:4204 Change-Id: Ie89080b4431fdf02a4ca09709973ea3f271a3e84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953486 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis 11e6944e 2019-12-05T13:12:10 Linux AMD crash when src blit region outside framebuffer Linux AMD has a crash on an assert in the mesa driver that the source rectangle for blitFramebuffer be inside the framebuffer. Add Linux AMD to the existing workaround for this case. Note: this will duplicate some work on Linux AMD if the blit call is outside the framebuffer and also very large (the adjustSrcDstRegionBlitFramebuffer workaround) Bug: 1014370 Change-Id: I1afd1c92ab07dba6814d6b87ff7c3c19a19bdc0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953487 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tom Anderson 5f3456e3 2019-12-03T14:16:19 Expose GL_ARB_sync for GL BUG=chromium:1028799 R=jonahr CC=vasilyt Change-Id: Id17c4061b206953b1e904bf7938cb371612e33fd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948534 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Ethan Lee a825eb70 2019-11-21T11:37:17 Implement BaseVertex draw calls for Vulkan, OpenGL, NULL contexts. This adds support for the following functions: - glDrawElementsBaseVertex - glDrawRangeElementsBaseVertex - glDrawElementsInstancedBaseVertex Bug: angleproject:3582 Bug: angleproject:3402 Bug: angleproject:4166 Change-Id: I83770f62e3a918c0965fd4ca8c7d9e598b8b4154 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1929083 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Xinyi He 4c7db77e 2019-10-31T15:42:31 Vulkan: Set limitation on maxComputeWorkGroupCount According to Table 20.45 and Chapter 17 in the ES 3.1 spec, MAX_COMPUTE_WORK_GROUP_COUNT is get as a GLint by using GetIntegeri_v. However, it is an unsigned integer in the Vulkan. It needs to set limitation on maxComputeWorkGroupCount[] during translating. 1. Change the data type to GLint stored in Caps. 2. Ensure that the limitation is set during initialization. 3. Add workaround for angleproject:4120 Bug: angleproject:4066 Change-Id: I1659ba1d560e30b9599cace0feeab8a18890c3ff Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1890586 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 4193e212 2019-11-20T11:03:09 Clean up dontUseLoopsToInitializeVariables condition This workaround is ported from chrome's dont_use_loops_to_initialize_variables workaround, which is enabled on Qualcomm Adreno devices. Better to check for Qualcomm than !NVIDIA Bug: 784817 Change-Id: I2f8314ca97aeca7fdcea60ef9d2fb9e64f075a32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1924625 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jiawei Shao 0303cf6b 2019-10-30T16:46:38 OpenGL: Port all Intel-related workaround conditions from gpu_driver_bug_list.json This patch ports all the Intel-related shader workarounds defined in gpu_driver_bug_list.json used by Chromium validating command buffer into ANGLE so that they can also take effect in Chromium passthrough command buffer. Bug: 1020467 Bug: 642605 Bug: 403957 Change-Id: I8e4866fc34d5e8f1b2f4dbfa8e526b80249ba166 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1889386 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Eng 50919254 2019-11-07T10:52:21 Only enable addAndTrueToLoopCondition feature on Mac Intel The issue which reported the need for this workaround only found a problem on Mac. The failure doesn't happen on other the Linux OpenGL Intel driver, so it shouldn't be enabled there. Bug: chromium:1021900, chromium:644669 Change-Id: I65e7462828419aeb9182898f73977ee1c5e72ff3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1904291 Reviewed-by: Kenneth Russell <kbr@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Austin Eng <enga@chromium.org>
Geoff Lang 19dd51b0 2019-11-04T11:28:19 GL: Expose PBO extensions Ensure WebGLCompatibilityTest.EnablePixelBufferObjectExtensions functions in surfaceless mode by creating a framebuffer to do the test glReadPixels from. BUG=angleproject:4079 Change-Id: I109b3cdeb85625a6a97832ecf8130d53a4074af9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1893058 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 4db96149 2019-10-24T16:38:45 GL: Temporarily disable emulatePrimitiveRestartFixedIndex. This workaround appears to cause problems on Mac ASAN builds. Disabling it while investigating the root cause. BUG=1017337 BUG=angleproject:3997 Change-Id: I16a2f07f8fc69ec4d5ab40a5bf521c43f6854a49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879873 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 3a8b8908 2019-10-23T13:26:13 GL: Follow-up primitive restart emulation fixes. - Use the existing utility function for computing the primitive restart index. - Fix bad merge that removed the unfoldShortCircuits feature. BUG=1017337 BUG=angleproject:3997 Change-Id: I4ba5ada9816731bdd29a0e518ce225bdd69a762e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1876453 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
jchen10 b3070102 2019-10-18T16:01:34 Add SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR This is a workaround for the webgl2 conformance test case WebglConformance_conformance2_glsl3_vector_dynamic_indexing_swizzled_lvalue. Dynamic indexing of swizzled lvalue like "v.zyx[i] = 0.0" is problematic on various platforms. This removes the indexing by translating it this way: void dyn_index_write_vec3(inout vec3 base, in int index, in float value){ switch (index) { case (0): (base[0] = value); return ; case (1): (base[1] = value); return ; case (2): (base[2] = value); return ; default: break; } if ((index < 0)) { (base[0] = value); return ; } { (base[2] = value); } } ... dyn_index_write_vec3(v.zyx, i, 0.0); ... Bug: chromium:709351 Change-Id: I971b38eb404209b56e6764af1063878c078a7e88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869109 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0b779a7c 2019-10-10T14:54:09 GL: Emulate primitive restart when PRIMITIVE_RESTART_FIXED_INDEX is unavailable. PRIMITIVE_RESTART_FIXED_INDEX isn't available until desktop GL 4.3. When it is not available, emulate it by enabling PRIMITIVE_RESTART and set the primitive restart index before each draw call based on the index type. TEST=deqp/functional/gles3/primitiverestart/* BUG=angleproject:3997 Change-Id: Id736f1056cb07da91c6d592693406333142e6265 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1853885 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis ae1b7786 2019-10-16T16:42:53 Fix ANGLE_FEATURE_CONDITION style issue Macro should end with a ; Bug: angleproject:3976 Change-Id: I4aaa146464d9d7e6230a3de44c30cfd1179a89ae Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1864620 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis a21362f5 2019-10-10T15:26:19 GL: Missing check for texture format sample counts ANGLE was hitting an issue running on llvmpipe because llvmpipe doesn't properly implement texture formats with multisampling, but claims otherwise to be OpenGL 3.3 compliant. ANGLE did not validate the claim on the backend, so the frontend was hitting an ASSERT that failed. This patch makes sure to validate this part of the spec, and limits the driver to OpenGL 2 if it's not conformant. Bug: 976382 Change-Id: I6ad6d757e26f90068df83aeb3caf7685aa2f1c07 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1853889 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Kenneth Russell d01ae535 2019-10-05T23:30:29 (ANGLE) Rename CHROMIUM_compressed_texture_etc to use ANGLE_ prefix. This is the ANGLE side of a two-sided patch including Chromium to rename this synthetic OpenGL extension to use an ANGLE_ prefix. Bug: chromium:1011653 Change-Id: Ice4b526a34157ebbd8c283aacc9437fae2e35d6e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1843506 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Kenneth Russell <kbr@chromium.org>
James Darpinian dce09168 2019-10-03T13:47:47 Enable unfold_short_circuits workaround on Apple. Bug: angleproject:3957 Change-Id: I49ba77b2daeed01a2b668fc68c26663e87997ad5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1838421 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: James Darpinian <jdarpinian@chromium.org>
Jonah Ryan-Davis 7dd03446 2019-09-30T13:50:12 Ensure Features* descriptions stay up to date Created a macro to help keep Features' descriptions up to date. This will avoid confusion in the future when conditions change. Also update all descriptions to match current state. Bug: angleproject:3947 Change-Id: Ifc65e7789c916fab79f1323798dfb59d7a4efad2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1829584 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 70d79b76 2019-09-11T11:43:55 GL: Add state validation functions to GL backend These functions validate that the driver's reported state matches ANGLE's internal state. Can be useful for debugging Bug: angleproject:3900 Change-Id: I35d15e991986dcab114939c551a88549f09bd263 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1797254 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e6582161 2019-09-16T12:39:18 Convert DXT1 RGB data to DXT3 RGBA when uploading to the GPU. DXT1 has a specific 'BLACK' code that results in transparent black pixels when sampled. D3D does not have specific RGB-only DXT1 formats like OpenGL does so when this code is encountered, we sample 0 alpha for these pixels when GL would expect 1 because the alpha channel should not exist. Work around this by converting to DXT3 RGBA, adding an extra block of 1.0 alpha pixels for each color block. Mac Intel OpenGL requires additional workarounds to always sample 1.0 alpha. Set the texture swizzle parameters to force it. BUG=angleproject:3729 Change-Id: Ia3647085acd97bb01af4e95ef3f6f21dcfb6a554 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1804880 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Ian Elliott <ianelliott@google.com>
Geoff Lang d8e821aa 2019-08-29T12:38:35 Expand the TextureGL::releaseTexImage size reset workaround to Win AMD. Windows 10 AMD drivers have also had issues with generating errors when calling glTexImage2D with zero size after unbinding a surface. BUG=angleproject:3859 Change-Id: Iae3e31418b6c89056d0d4aab954519598d8f25f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1775111 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2a19c59f 2019-08-23T14:10:24 GL: Check for errors around GL calls. Add a macro to check for GL errors after each GL call to catch errors as they happen even if the debug callbacks are unavailable. GL errors are only checked when asserts are enabled unless explicitly requested with the ANGLE_GL_TRY_ALWAYS_CHECK macro to verify GL calls that may allocate memory. Updated TextureGL to use the macro. BUG=angleproject:3020 Change-Id: I7678b204899e940824b010ab4be7e7f159bee6de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1764476 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
shrekshao cd31f286 2019-06-25T14:22:41 Implement Draw base vertex and base instance functions This patch implements functionality of glDrawArraysInstancedBaseInstanceANGLE, glDrawElementsInstancedBaseVertexBaseInstanceANGLE, glMultiDrawArraysInstancedBaseInstanceANGLE, and glMultiDrawElementsInstancedBaseVertexBaseInstanceANGLE Workaround for OpenGL driver on Mac: gl_VertexID on Mac with AMD GPU doesn't include baseVertex value. So replace gl_VertexID with (gl_VertexID + angle_BaseVertex) if any. Workaround for Vulkan GLSL: gl_InstanceIndex on Vulkan includes baseInstance. So replace gl_InstanceIndex with (gl_InstanceIndex - angle_BaseInstance) when angle_BaseInstance is declared. Bug: chromium:891861, angleproject:3402 Change-Id: Ia1d94b5d4d7da7e635468c05c962c4f7eb1b1919 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1750126 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e2ea45ba 2019-08-23T14:05:53 Don't reset the texture size to zero in TextureGL::releaseTexImage on Mac. After unbinding IOSurface textures, we reset the texture size to 0 because some platforms don't correctly update their state tracking. This call ends up generating GL_INVALID_OPERATION errors on Mac for unknown reasons. Skip the call, the size reset is not required on Mac anyways. BUG=angleproject:3859 Change-Id: I5e39b6a36aaff41082a5fcc923970f8e97774675 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1769059 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Stuart Morgan 9d737966 2019-08-14T12:25:12 Standardize copyright notices to project style For all "ANGLE Project" copyrights, standardize to the format specified by the style guide. Changes: - "Copyright (c)" and "Copyright(c)" changed to just "Copyright". - Removed the second half of date ranges ("Y1Y1-Y2Y2"->"Y1Y1"). - Fixed a small number of files that had no copyright date using the initial commit year from the version control history. - Fixed one instance of copyright being "The ANGLE Project" rather than "The ANGLE Project Authors" These changes are applied both to the copyright of source file, and where applicable to copyright statements that are generated by templates. BUG=angleproject:3811 Change-Id: I973dd65e4ef9deeba232d5be74c768256a0eb2e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1754397 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang 8b2dfa0f 2019-07-04T16:22:05 GL: Implement EXT_external_objects This allows the GL backend to import Vulkan resources. BUG=angleproject:3656 Change-Id: Ie5e55ce3e1ba05e917619e3f192c13dcc36c3739 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1688507 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Clemen Deng <clemendeng@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jonah Ryan-Davis 0716ce0a 2019-07-22T15:20:47 Re-add case to blitframebuffer workaround where src is outside of bounds. On Mac, blitFramebuffer calls fail if the source region is not enclosed by the framebuffer. In this case, we must naively clip the source region and adjust the dest region accordingly. This is slightly different behavior and may cause issues with scaling so we use a separate workaround. Also, Windows NVIDIA has a driver bug that affects Vulkan device creation after blitting large textures, so it should be included in the original workaround. This CL cleans up the workaround to use more helpers from ANGLE and to generally improve readability. Bug: chromium:830046 Change-Id: I50bd97449725b738036e6bd3af82362020d7eda8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1713090 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 7151fe54 2019-07-17T15:15:27 Port adjust_src_dst_region_for_blitframebuffer workaround to ANGLE. BlitFramebuffer has issues on some platforms with large source/dest textures. As per the WebGL2 spec, this was caught with validation for sizes over 2^32, but there is a specific issue on Linux NVIDIA where it fails on sizes over 2^16. A better workaround (from chromium), resizes the blitframebuffer call based on the framebuffer size. Bug: chromium:830046 Change-Id: Ic6196db6228d0d0ac92b12a68bbced76dcbcdf8c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1707115 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang d9c17107 2019-07-10T14:56:26 Add support for GL_OES_texture_compression_astc This extension adds 3D compressed texture formats, something ANGLE has not seen before. This requires tracking a compressed block depth for validation and image size computations. Update the ldr and hdr extension checks to be in line with the spec. HDR requires LDR and is not detectable by texture formats alone. Expose all of the ASTC extensions on the GL backend. BUG=angleproject:3675 Change-Id: Id04c7c8ef8541e9556579536cdba899b64303caf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1695923 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jonah Ryan-Davis aded991b 2019-07-12T16:02:06 Fix hang on Linux Intel when allocating large textures. Intel Linux graphics drivers before kernel 5.0 can hang when allocating large textures. Limit the texture size as a workaround. Bug: chromium:927470 Change-Id: Ic8c14235396492efafd663b1cd012fd752427992 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1700146 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 2a4f36b1 2019-07-09T16:10:59 GL: Work around Intel driver bug when clearing to zeros or ones. When clearing to zeros or ones on some Intel drivers on Mac, the clear color would be incorrect. This replicates the chromium clear_to_zero_or_one_broken workaround. BUG=angleproject:3672 Change-Id: I0f065420b577bd8f8d931ccdbeeebdcbf9fd08d2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1692977 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang ecd2e3b1 2019-07-09T15:39:39 GL: Reset the texture base level before uploads on Mac. Reset the base level of textures before call glTexImage on Mac to prevent driver bugs that cause texture corruption. BUG=angleproject:3671 Change-Id: I90e94b8395a781a2142ef6be3af1d6117f084152 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1692975 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Cody Northrop 66b5ff58 2019-06-28T14:34:22 texture3D: Implement functionality and enable for Vulkan Also update test expectations for texture3D. Bug: angleproject:3188 Change-Id: If8a8e0a83a86c48c2afb0c36534c1e9d4120fe47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1682782 Reviewed-by: Ian Elliott <ianelliott@google.com> Reviewed-by: Lingfeng Yang <lfy@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Geoff Lang 2074d5f7 2019-06-27T13:18:16 GL: Clamp uniform array access on Android and AMD devices. Chrome used to clamp it everywhere but in practice it is only needed on these devices. TEST=conformance/uniforms/out-of-bounds-uniform-array-access.html Change-Id: Idffe84023f8b27733bfda209edd59bbb220b5c0c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1680054 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 5ff8cae9 2019-06-21T11:09:25 GL/D3D: Use texture uploads instead of clearing for robust init. Chrome uses regular texture uploads on all platforms except OpenGL on Mac to do robust resource init for textures because multiple bugs have been observed with texture corruption. BUG=883276 BUG=882580 BUG=941620 Change-Id: I5fcd6862147822a08c7533e6a6a9277223034ebd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1669104 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 647f2000 2019-06-19T16:18:28 Limit max texture size and max MSAA samples on Android. Android devices will often fail to allocate textures this large and it is prefereable to return an error from ANGLE instead of losing the context due to an out of memory error. This mirrors the limits Chrome applies with the max_texture_size_limit_4096 and max_msaa_sample_count_4 workarounds that are broadly applied to Android. BUG=882580 Change-Id: I63890baa8712f13b37c607fa475432e67e9384a4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1351357 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Geoff Lang 857880e5 2019-05-27T13:39:15 GL: Add extensions to enable hardware video decode on Android. The Android SurfaceTexture API has to be initialized with a texture id which Chrome has to query from an ANGLE external texture. It also rebinds and sets the texture dimensions on calls to SurfaceTexture.updateTexImage so ANGLE must be notified about these changes so that state tracking and validation continue to function. BUG=967410 Change-Id: I92e9077f75835b088da3a8caffb3ff40e9ad0361 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1630293 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis beb0eb2d 2019-06-14T15:10:33 Clean up workarounds/features to single location. Rename all workarounds structs to features, and move the lists to a shared location in include/platform (to help with documentation, see: https://cs.chromium.org/chromium/src/ui/gl/gl_switches.cc?sq=package:chromium&g=0&l=69) Bug: angleproject:1621 Change-Id: I4069f08131db5e886047a007efb5d7764dfee5f2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1660952 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 78a51911 2019-06-12T14:28:14 Clean up and expose frontend features to egl. gl::Workarounds was used to hold frontend features. Change ownership of this struct from Context to Display, so it can be exposed to egl. Also rename to features and clean up for consistency. Bug: angleproject:1621 Change-Id: I82e98e53873abb7a402c93e60f8a662a7263e0d5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1655772 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jeff Gilbert d9fa0744 2019-04-25T14:57:26 Emit OVR_multiview2 on ESSL/GLSL outputs. Add ARB_shader_viewport_layer_array support to SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER. Bug: angleproject:3404 Change-Id: Ia89517d0cc92400ce47c9118e8c1abf8285aec41 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1585452 Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 776694cd 2019-05-08T10:28:55 Change all ANGLE workarounds to use struct definition with info. Change each workaround from a simple bool to a struct with info including name, workaround set, description, and bug IDs. This will help with future workaround integration with Chrome. Bug: angleproject:1621 Change-Id: Ia27c180abaf845e280060c803e5994cc3152a057 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593917 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Mingyu Hu ebab670c 2019-04-19T14:36:45 Adding new extension GL_OVR_multiview GL_OVR_multiview functions exactly the same as GL_OVR_multiview2. All GL_OVR_multiview2 tests now also repeat the same test using GL_OVR_multiview Bug: angleproject:3341 Change-Id: I7e5294fb6bbf7692535174a15da6a42e1b5fc4e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1575904 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tobin Ehlis e9421b2c 2019-04-08T15:16:56 Vulkan:Only apply invariant pragma to output vars The "#pragma STDGL invariant(all)" directive should only be applied to shader output vars. This change also removes the workaround SH_DONT_REMOVE_INVARIANT_FOR_FRAGMENT_INPUT which is no longer needed. This change fixes two tests that were incorrectly assuming that the pragma would be applied to inputs: GLSLTest.InvariantAll[Both|In]. Bug: angleproject:1293 Bug: angleproject:3285 Change-Id: I4eb03fa89fbc7c560150ee0cc32382024b0cb3e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1558678 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tobin Ehlis <tobine@google.com> Commit-Queue: Tobin Ehlis <tobine@google.com>
Shahbaz Youssefi fc0be049 2019-04-18T09:44:06 Fix GL_MAX_COMBINED_UNIFORM_BLOCKS query This was previously returning maxCombinedTextureImageUnits instead of maxCombinedUniformBlocks. Fixing that exposed a bug in the GL backend where the combined values were sometimes capped to vertex+fragment values and sometimes not capped at all. The reasoning for such capping was that the combined limits as queried from GL contains stages not available in GLES (such as tessellation). However, the capping failed to take geometry shader limits into account. This change adjusts such capping to vertex+fragment+geometry. It also applies the cappping to all combined limits, rather than a select few. Bug: angleproject:2099 Change-Id: I7231058b5d7f80b1b2452d9f87d4b0ab6e1cdb17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1572487 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mingyu Hu 7d64c486 2019-03-12T14:27:40 GL_ANGLE_multiview has been renamed to GL_OVR_multiview2. changes include: 1) GL_OVR_multiview to GL_OVR_multiview2 extension directive change 2) Removal of all references to side by side. We no longer support multiple views in a single 2DTexture. Only 2DTextureArray's are supported 3) WebGL 2 (ES3) is required for multiview Bug: angleproject:3341 Change-Id: Ie0c1d21d7610f8feebdb2e4d01c6947f57e69328 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1552023 Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
jchen10 705f480f 2019-01-29T15:49:35 ParallelCompile: Enable worker on GL backend Except WGL AMD, WGL Intel, and GLX Nvidia. BUG=922936 Change-Id: I1bdbddd1485578465bcf6ece4b4b7173ae6f9f05 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1442312 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Kenneth Russell <kbr@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
shrekshao c87e0053 2019-02-21T11:40:28 add ext_float_blend feature and test Bug: chromium:930993 Change-Id: I8edbd01c5c9f1ed63243cc4a42f6de44c92db8bd Reviewed-on: https://chromium-review.googlesource.com/c/1481242 Commit-Queue: Shrek Shao <shrekshao@google.com> Reviewed-by: Jamie Madill <jmadill@google.com>
Jonah Ryan-Davis 2b0553ce 2019-02-08T10:07:21 Implement EXT_instanced_arrays Bug: angleproject:3015 Change-Id: Ib01cc5e0df6db27981cb843a6bd386de5d10c2db Reviewed-on: https://chromium-review.googlesource.com/c/1452740 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org>
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>