src/tests/gl_tests/GLSLTest.cpp


Log

Author Commit Date CI Message
Shahbaz Youssefi 06de90c6 2019-05-16T12:46:54 Vulkan: Re-enable a handful of suppressed ES3 tests Few features are already implemented but the suppressions were not removed. Bug: angleproject:2392 Bug: angleproject:2394 Bug: angleproject:3199 Bug: angleproject:3219 Bug: angleproject:3423 Change-Id: Iefd6c10f5ec774e174901114b35410c0d397085f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1614428 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 5cbaa3f8 2019-05-07T15:49:22 Don't inherit ANGLETest SetUp and TearDown. Instead of inheriting from testing::Test's SetUp and TearDown we add new methods 'testSetUp' and 'testTearDown'. This helps prevent a common error of forgetting to call the base class method. Also add a check in the ANGLETest destructor that SetUp and TearDown have been called. Bug: angleproject:3393 Change-Id: Iab211305cc06ffea9ca649e864ddc9b180f2cba0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593960 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@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 216f73d0 2019-04-12T13:32:30 Vulkan: add uniform buffer object support Support for layout qualifiers in interface blocks are added. All interface blocks are adjusted to either be in std140 or std430. In the Vulkan backend, a new descriptor set is added for UBOs. A dirty bit is added for UBO updating and pipeline layouts and descriptor bindings are updated. Bug: angleproject:3199, angleproject:3220 Change-Id: I271fc34ac2e1e8b76dee75e54a7cff0fe15fe4ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565061 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 3e62561c 2019-05-06T11:48:52 Suppress test hitting Nvidia shield driver bug The same test was hitting a bug with the Nvidia driver on windows+gles. Bug: angleproject:3413, angleproject:3417 Change-Id: I39426291eac731bcda068829686e09cf406ff661 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1595438 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi e25ff9d8 2019-05-01T00:02:05 Vulkan: Fix qualifiers for varyings `out` variables in the vertex shader and `in` variables in the fragment shader were not decorated with `layout(location=?)` as they should according to the Vulkan GLSL spec. This change makes sure these decorations are present regardless of whether the compiler sees these variables as EvqVaryingIn/Out or EvqVertexOut/FragmentIn. Bug: angleproject:3412 Change-Id: I66473e876cb989a60b0c6d6a5850a8b2c763d8e2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1590694 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yi Xu 80147d11 2019-04-30T16:21:24 Add support for dynamically allocate initial stack for Angle By updating YYLTYPE_IS_TRIVIAL to true, YYSTACK_RELOCATE can be enabled, so we can dynamically allocate stack size based on needs. BUG=angleproject:3028 Change-Id: I1b9cc0768cd0c6955589695e703595c56d43f24a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1593954 Commit-Queue: Yi Xu <yiyix@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi 051b0896 2019-04-15T15:39:39 Vulkan: Fix layout substitution for struct varyings If the shader contains code such as the following: struct S { vec4 field; }; out S varStruct; The layout qualifier macro is defined as @@ LAYOUT-varStruct @@. However, the Vulkan backend was replacing @@ LAYOUT-field @@. Bug: angleproject:3220 Change-Id: Iae15003867e0bed2cc939159a6653429c7a431e0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1571389 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill ddc4d33a 2019-05-01T15:11:46 Remove several underused platform configs. * Removes D3D11 Warp and Reference configs from tests. * Removes several permutations of OpenGL back-end specific configs. * Removes FL 9_3 since it is no longer supported. * Removes present path "Copy" since it's redundant with normal D3D11. Reduces number of configs from over 60 to 25. Bug: angleproject:3393 Change-Id: Ia5a23de3c4865b17ee50673a4066757b901a4b5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574675 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill b8149075 2019-04-30T16:14:44 Clean up ANGLE test extension functions. None of these functions needed to be member functions. Also make the naming more consistent. Bug: angleproject:3393 Change-Id: I7aafe2269a48af703a87bd9a8cf4cfab9e177dd3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1574673 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 422c94bd 2019-04-12T13:37:19 Vulkan: Enable ES3 fragment output attribute locations GLSLTest_ES3 end2end tests are enabled for Vulkan, though with suppressions for other features that are missing. Bug: angleproject:3199 Change-Id: Ie744e160eab2df9a5a4f2c67ea5acf4b865ea5bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565058 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 5646a7cc 2019-04-12T16:42:56 Uniform buffers not dirtied for gl_VertexID workaround on D3D11. Related to: https://chromium-review.googlesource.com/c/angle/angle/+/1520988 The program uniform buffers were dirtied for this edge case, but it should have been the driver uniform buffers. This CL fixes this and adds a tests case which catches this. Bug: 945903 Change-Id: I6142771e200513ed0251fc97cec68d371d39ec1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1565059 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Shrek Shao <shrekshao@google.com>
Tim Van Patten f39b4f02 2019-04-09T12:04:51 Vulkan Android: Remove workaround to clamp the point size This is to remove the workaround introduced by anglebug.com/2599 since Nexus 5x devices aren't in the farm anymore and the tests pass on Pixel devices. Bug: angleproject:2599 Test: angle_deqp_gles2_tests Test: angle_end2end_tests Change-Id: I14f724494909486a2164ddd734a95b6980429f29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1559202 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jonah Ryan-Davis 9078c6a7 2019-03-19T11:10:15 Update necessary angle_end2end_tests to check the Android device name Some tests fail only on specific devices, so the tests should be updated to reflect that, and allow more tests to run on more devices. Bug: angleproject:3275 Change-Id: I8e3183c1769c0bb8ed6d2605afcaf399cb1d9ed0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1534463 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Jonah Ryan-Davis eaf56133 2019-03-13T12:56:49 gl_VertexID is incorrect if offset argument to glDrawArrays is non-zero On D3D the vertex ID is always indexed from 0, unlike GL. The D3D backend had assumed the wrong behavior. This forwards the true offset to D3D by using the ConstantsBuffer. Bug: angleproject:3090 Change-Id: Ia19e3490503c97541af14979b75af0c94c67ab6b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1520988 Commit-Queue: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 aead8edf 2019-02-13T13:55:09 Mute worker context creation warnings This moves the warnings to InfoLog. Bug: chromium:931294 Change-Id: I1627aa63bdda6f92fc89b8921eb260302ba9063f Reviewed-on: https://chromium-review.googlesource.com/c/1469721 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jie A Chen <jie.a.chen@intel.com>
Jamie Madill d3fac74a 2019-02-12T13:40:28 Disable warnings-as-error in GLSLTest. This disables the warnings in the FragData test. We were getting errors in Debug from the multithreading compile implementation. Bug: chromium:931294 Change-Id: I6d1424e54335534f794884e40f527b5464113084 Reviewed-on: https://chromium-review.googlesource.com/c/1465960 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 00f43c91 2019-02-09T11:41:12 Vulkan: Suppress layer warnings about unbound outputs. This warning could pop up whenever an OpenGL app would write to a particular output and not bind an attachment. This is valid in OpenGL. Also it could happen when writing to gl_FragData instead of gl_FragColor. Since it's hard to fix every usage we can just suppress the warning. Also adds a way to change test platform warnings into errors. Bug: angleproject:2866 Change-Id: I9793f58121ac848d74d6b0131e79ebab2c70f45c Reviewed-on: https://chromium-review.googlesource.com/c/1462057 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Natasha Lee 75d577fb 2019-02-04T16:28:28 Fixed Bug where array initialized with same name of previously declared variable fails on DirectX. Combined user defined variables with their unique ids to avoid overwriting same name variables of different scope. Bug: angleproject:2126 Change-Id: If9ad9e48f629d83b105d43ee28a50b8176d0e0a1 Reviewed-on: https://chromium-review.googlesource.com/c/1456484 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Rafael Cintron <rafael.cintron@microsoft.com>
Jamie Madill fa7ca18f 2019-01-15T11:20:58 Vulkan: Enable dEQP point limit raster test. This requires enabling a workaround in the ANGLE shader translator to clamp the point size. Bug: angleproject:2599 Change-Id: I3171bdca5dd2e5af965e94ee2a955f46f8d706da Reviewed-on: https://chromium-review.googlesource.com/c/1412235 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Corentin Wallez 6ae34889 2019-01-18T11:44:54 Suppress test crashing on Mac ASAN AMD too. The initial suppression didn't apply to AMD but the test crashes there too. BUG=angleproject:3087 BUG=chromium:923399 Change-Id: I8ccffbb7746dd6fc6aa3eb6edaaef30aaae8c097 Reviewed-on: https://chromium-review.googlesource.com/c/1423057 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Corentin Wallez 3159b2e5 2019-01-17T16:39:03 Suppress test crashing on Mac ASAN. GLSLTest_ES3.LargeNumberOfFloat4Parameters/ES3_OPENGL started crashing after the parallel compile enablement on OpenGL and disabling the workers didn't fix it. BUG=angleproject:3087 Change-Id: I317b140e66b04102059486381ef70e16600fad12 Reviewed-on: https://chromium-review.googlesource.com/c/1419007 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Corentin Wallez <cwallez@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>
Jamie Madill ba319ba3 2018-12-29T10:29:33 Re-land "Load entry points dynamically in tests and samples." Fixes the Android/ChromeOS/Fuchsia builds by using consistent EGL headers. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I5a8772f41a0f89570b3736b785f44b7de1539b57 Reviewed-on: https://chromium-review.googlesource.com/c/1392382 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 9f088621 2018-12-29T20:46:15 Revert "Load entry points dynamically in tests and samples." This reverts commit 03923558a7103827ffec6a4d2a1453ed91f01c6f. Reason for revert: fails compilation on Android, ChromeOS and Fuchsia during roll https://chromium-review.googlesource.com/c/chromium/src/+/1392624 Original change's description: > Load entry points dynamically in tests and samples. > > This CL adds a dynamic loader generator based on XML files. It also > refactors the entry point generation script to move the XML parsing > into a helper class. > > Additionally this includes a new GLES 1.0 base header. The new > header allows for function pointer types and hiding prototypes. > > All tests and samples now load ANGLE dynamically. In the future this > will be extended to load entry points from the driver directly when > possible. This will allow us to perform more accurate A/B testing. > > The new build configuration leads to some tests having more warnings > applied. The CL includes fixes for the new warnings. > > Bug: angleproject:2995 > Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 > Reviewed-on: https://chromium-review.googlesource.com/c/1359516 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> TBR=ynovikov@chromium.org,jmadill@chromium.org,syoussefi@chromium.org Change-Id: I902bec2d733c2b879be29c02ab52a0b7d4eaa077 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:2995 Reviewed-on: https://chromium-review.googlesource.com/c/1392381 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 03923558 2018-12-29T10:29:33 Load entry points dynamically in tests and samples. This CL adds a dynamic loader generator based on XML files. It also refactors the entry point generation script to move the XML parsing into a helper class. Additionally this includes a new GLES 1.0 base header. The new header allows for function pointer types and hiding prototypes. All tests and samples now load ANGLE dynamically. In the future this will be extended to load entry points from the driver directly when possible. This will allow us to perform more accurate A/B testing. The new build configuration leads to some tests having more warnings applied. The CL includes fixes for the new warnings. Bug: angleproject:2995 Change-Id: I6726d4163f7a6e54d2482f094c0a952f59702a05 Reviewed-on: https://chromium-review.googlesource.com/c/1359516 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 2b35654d 2018-12-20T12:43:37 compiler: Fix const non-square matrix component mult. It seems like there weren't any dEQP tests for constant folding of nonsquare matrices component-wise multiplication. There were a couple bugs in our implementation which could lead to undefined behaviour. Fixes the code and cleans up a few style issues. Also includes a regression test. Bug: chromium:912505 Bug: chromium:912508 Change-Id: I7fb85d1404a32950fa9fe4c3bbba9edc9f38ddd1 Reviewed-on: https://chromium-review.googlesource.com/c/1387065 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 35cd7332 2018-12-02T12:03:33 Refactor test shader style. This change enforces a lot more consistency. We pass const char * to the Compile functions instead of std::string. Also fixes the indentation of C++11 block comments to be more consistent. Bug: angleproject:2995 Change-Id: Id6e5ea94055d8cbd420df4ea2e81b2d96cb5ce78 Reviewed-on: https://chromium-review.googlesource.com/c/1357103 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Shahbaz Youssefi 0864a7ac 2018-11-07T15:50:15 Vulkan: Enable end2end tests for ES2_VULKAN everywhere Used a script to find test files that have more ES2_OPENGL() invocations than ES2_VULKAN(), and added ES2_VULKAN() to those. There may be false negatives. Bug: angleproject:1578 Change-Id: I938eb3571c909879e9276b355a9f1d324880f99a Reviewed-on: https://chromium-review.googlesource.com/c/1324350 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill c3bef3e7 2018-10-03T07:35:09 Allow 'defined' in define in non-WebGL. This is needed to pass dEQP conformance. Several of the harder dEQP tests around this behaviour are excluded from the mustpass list. This is presumably because the behaviours weren't implemented portably. Nevertheless we need to support conformant behaviour for GLES 2.0 Contexts for the most simple uses. This also leaves the error behaviour intact for WebGL specs. Bug: angleproject:1335 Change-Id: Ia80b4f71475efa928488ee6c2ee35c566d4602d4 Reviewed-on: https://chromium-review.googlesource.com/c/1242013 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov 79207e6e 2018-09-28T16:09:26 Skip tests failing on Pixel XL RobustBufferAccessBehaviorTest.NoBufferData/ES2_OPENGLES RobustBufferAccessBehaviorTest.NoBufferData/ES3_OPENGLES RobustBufferAccessBehaviorTest.NoBufferData/ES3_1_OPENGLES ClearTest.ChangeFramebufferAttachmentFromRGBAtoRGB/ES2_OPENGLES ClearTest.ChangeFramebufferAttachmentFromRGBAtoRGB/ES3_OPENGLES WebGLGLSLTest.InitUninitializedGlobals/ES2_OPENGLES Bug: angleproject:2861,angleproject:2689,angleproject:2862 Change-Id: I142594c952b6e7de24057784794b5725f3486212 Reviewed-on: https://chromium-review.googlesource.com/1252701 Reviewed-by: Yuly Novikov <ynovikov@google.com> Commit-Queue: Yuly Novikov <ynovikov@google.com>
Jamie Madill 8e9d2340 2018-09-10T13:29:37 Vulkan: Fix FragCoord scaling when a viewport is applied. We were using the pivot based on the viewport dimensions which is only valid if the viewport is the size of the framebuffer. The more correct pivot size is actually based on the Framebuffer height. Also updates the driver uniforms block to be a bit simpler. Bug: angleproject:2598 Change-Id: I1cb500cded7141d10e8db6862b6ed29758cc7fb4 Reviewed-on: https://chromium-review.googlesource.com/1214205 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org>
Jamie Madill fb19e084 2018-09-06T15:39:09 Vulkan: Correct gl_FragCoord with default FBO. The viewport flipping we use would give incorrect values. Correct them using the same logic we do for gl_PointCoord. Also corrects the viewport scale driver uniform. It was not being updated after the draw framebuffer setting was adjusted. Also corrects the naming of the replaced builtin variables so it can't possibly conflict with a user variable. This was affecting the OpenGL line raster emulation. Bug: angleproject:2598 Change-Id: I843b5ac7b02160a5ec81a6f8ed2d937b0937198b Reviewed-on: https://chromium-review.googlesource.com/1208515 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fda46aa5 2018-08-31T17:19:15 Vulkan: Enable GLSLTest.ScopedStructsOrderBug. This was fixed upstream in glslang. Bug: None Change-Id: I21751dba101fe39f94c91de6e73853ee9ad8c8f2 Reviewed-on: https://chromium-review.googlesource.com/1200366 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 76301e09 2018-07-19T11:48:30 Vulkan: Fix compound nested sampler struct params. Replace the struct type of binary and symbol parameter nodes with a lookup of the struct type in the tree. Bug: angleproject:2494 Change-Id: I1e892e0f1b1f97302d1cdce1035f51c01d0efd9e Reviewed-on: https://chromium-review.googlesource.com/1135695 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 06235df9 2018-07-20T14:26:07 Make HLSL shaders use only one main function Instead of having separate main() and gl_main() functions in HLSL shaders, add initializing outputs and inputs directly to the main function that's in the AST. This works around some HLSL bugs and should not introduce name conflicts inside main() since all the user-defined variables are prefixed. BUG=angleproject:2325 TEST=angle_end2end_tests Change-Id: I5b000c96aac8f321cefe50b6a893008498eac0d5 Reviewed-on: https://chromium-review.googlesource.com/1146647 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Luc Ferron e835609c 2018-07-12T12:36:47 Vulkan: Implement gl_DepthRange support using driver uniform Bug: angleproject:2592 Change-Id: Iec3d111df4d8e5cef205c8afb177f0514ffac5c8 Reviewed-on: https://chromium-review.googlesource.com/1135448 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 84c11c53 2018-07-11T10:12:39 Vulkan: Implement sampler structs as function args. Bug: angleproject:2494 Change-Id: Ia8e374846427b7140ab2565ae5b9b18409a76d96 Reviewed-on: https://chromium-review.googlesource.com/1117323 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill cdf50444 2018-06-26T15:05:42 Add test for sampler struct rewriting indexing. The concern originally was that rewriting sampler structs could lead to incorrect behaviour for indexing. The test attempts to cover this but doesn't repro. It possibly is not an issue. Bug: angleproject:2494 Change-Id: Ibc34b08b5cee3b6ff82d150a64f1768aae64396f Reviewed-on: https://chromium-review.googlesource.com/1117321 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron e9c0b262 2018-06-22T09:50:04 Vulkan: Add drawQuad to a sampler test Bug: angleproject:2675 Change-Id: I3774ca4602e9eea7c191e99a95939043ac0d8777 Reviewed-on: https://chromium-review.googlesource.com/1111901 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4da0d315 2018-06-20T11:46:38 Vulkan: Handle embedded struct uniforms. Also known as nameless structs. Uniform structs without a struct name would not be parsed correctly. This fixes the bug by adding a tree transformation. The transformation gives an internally scoped name to the embedded struct. Bug: angleproject:2665 Change-Id: I43e4dad7d9ad64a40e382066bb136e4f8f719797 Reviewed-on: https://chromium-review.googlesource.com/1101566 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 3237f759 2018-06-20T14:45:43 Vulkan: Fix issue when a sampler2D was not used in FS or VS Bug: angleproject:2675 Change-Id: Idbf2590a763fd7b81d2bcc5850180a1bb931360e Reviewed-on: https://chromium-review.googlesource.com/1108490 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Jamie Madill 50cf2be0 2018-06-15T09:46:57 Reformat some style in touched files. This was triggered by running the code generation script. Bug: angleproject:2665 Change-Id: Id639c78eb618182ee1859678590cf0f559b572c2 Reviewed-on: https://chromium-review.googlesource.com/1101564 Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Luc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 4cc753e0 2018-06-13T13:25:33 Vulkan: Implement sampler arrays. Bug: angleproject:2462 Change-Id: If9c9cb69624d6f9f0895f6883e1eed19a27e6cb4 Reviewed-on: https://chromium-review.googlesource.com/1089809 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Frank Henigman <fjhenigman@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>
Jiawei Shao 7a8fe156 2018-04-28T12:59:58 ES31: Add link validation on MAX_COMBINED_SHADER_OUTPUT_RESOURCES This patch adds the link validation on the maximum combined shader output resources required in OpenGL ES 3.1 SPEC. OpenGL ES 3.1 SPEC has restrictions on the sum of the number of all active images, shader storage blocks and fragment shader outputs. A link error will be generated if this sum exceeds the implementation- dependent value of MAX_COMBINED_SHADER_OUTPUT_RESOURCES. In order not to affect the existing image tests, this patch also sets a temporary value for maxCombinedShaderOutputResources on D3D11 back-ends. We will set more accurate values for all the UAV related resource limits in the next patch. BUG=angleproject:2345 TEST=dEQP-GLES31.functional.state_query.integer.max_combined_shader_output_resources_* Change-Id: Ib83a19ef0ae0b9af3422b5c970c7c07d96b2359d Reviewed-on: https://chromium-review.googlesource.com/1039155 Commit-Queue: Jiawei Shao <jiawei.shao@intel.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 03bb2231 2018-05-03T15:21:20 Add test for D3D11 nested floor() bug The test fails on D3D11, which seems to ignore floor() calls if they're nested in a particular way with magic multipliers inside. BUG=chromium:838885 TEST=angle_end2end_tests Change-Id: I2c8749defa923553bfee69149da15f8e4ddf5096 Reviewed-on: https://chromium-review.googlesource.com/1041959 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jiawei Shao 40786bdf 2018-04-18T13:58:57 ES31: Add validation on geometry shader interface blocks matching This patch adds the validation on checking if there is any mismatch among geometry shader interface blocks and the ones defined in other graphics shaders in the same program. BUG=angleproject:1941 TEST=angle_end2end_tests Change-Id: I1f65e3c49390135bbe9f9323098daf28c9b838c7 Reviewed-on: https://chromium-review.googlesource.com/1016175 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Luc Ferron 3ec304db 2018-04-18T14:14:25 Vulkan: Support struct initializers in shaders Also adds a new test in GLSLTest to validate the initialization of a struct on the same line as its declaration. Bug: angleproject:2459 Change-Id: Ib37e20378f8ec76541db26392663bcba03390756 Reviewed-on: https://chromium-review.googlesource.com/1017340 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com>
Luc Ferron fe22e23a 2018-04-16T14:15:11 Vulkan: Use SH_INITIALIZE_UNINITIALIZED_LOCALS in ShaderVk Re-enable the flaky test InitUninitializedStructContainingArrays that was failing because of this option missing. Bug: angleproject:2460 Change-Id: Icf794a5fdca48619756d575faa4cb04f0323712e Reviewed-on: https://chromium-review.googlesource.com/1014271 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Luc Ferron f1d3c20c 2018-04-16T07:44:27 Vulkan: Fix the issue with unused attributes / varyings When an attribute, a uniform or a varying isn't used, we now remove their layout and in/out qualifiers so that the shader can still refer to these var names. Bug: angleproject:2456 Change-Id: I5f1241d91bd46f663750adfab2562ef87ce69ae5 Reviewed-on: https://chromium-review.googlesource.com/1014009 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Luc Ferron ef2fda72 2018-04-18T07:44:14 Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation (2nd try) The layout needed to also have a component qualifier so that the registerColumn wouldn't be ignored. Bug: angleproject:2460 Bug: angleproject:2483 Change-Id: I3adcd6208aca4afebd45311ded93d00087b60a99 Reviewed-on: https://chromium-review.googlesource.com/1016680 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 5804dc8e 2018-04-13T14:11:46 Refactor GL tests to use a shader library Instead of having the same simple shaders repeated over and over in the test code, reuse a single shader library. BUG=angleproject:2474 TEST=angle_end2end_tests Change-Id: I13f8ca8c0125e6d30f1761639bf8c3f69e0e77d2 Reviewed-on: https://chromium-review.googlesource.com/1012078 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Jamie Madill c97e900c 2018-04-17T19:11:39 Revert "Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation" This reverts commit 1d882aaa0720b0dee0e8fc807d93d0e3f3e6bc67. Sorry about this Luc. I think there was a missing suppression. You can even see a flaky failure in the CQ when you landed this - it seems the flakiness of the failure let it through. This is blocking another fix from landing which fixes the fact the CQ is on fire. The revert button is also missing from Gerrit which means this is a manual revert. Failures: https://ci.chromium.org/p/chromium/builders/luci.chromium.try/win_angle_rel_ng/361 Original CL Message: The layout needed to also have a component qualifier so that the registerColumn wouldn't be ignored. Bug: angleproject:2460 Bug: angleproject:2483 No-Try: True Change-Id: I84c38497fbda43d9defbc6d5d3ff0f9c133e6e46 Reviewed-on: https://chromium-review.googlesource.com/1015323 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Luc Ferron 1d882aaa 2018-04-13T10:12:05 Vulkan: Fix issue in GlslWrapper and maxVaryingVectors calculation The layout needed to also have a component qualifier so that the registerColumn wouldn't be ignored. Bug: angleproject:2460 Bug: angleproject:2483 Change-Id: Ib5b15c4dc0ce42633f4994648f1eb22d8b63336a Reviewed-on: https://chromium-review.googlesource.com/1011680 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron bfb5df15 2018-04-12T12:45:26 Vulkan: Suppress flaky test in GLSLTest on Windows Bug: angleproject:2460 Change-Id: I4dba274e29a147c3066848a729f37297951a7f77 Reviewed-on: https://chromium-review.googlesource.com/1010405 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 6d5af92b 2018-04-09T14:37:15 Vulkan: Enable GLSLTest tests for Vulkan - Suppress tests that don't pass yet. Bug: angleproject:2460 Change-Id: I7c95ae9504a8d5e112fd9d1bb8536cc9bbf16e7b Reviewed-on: https://chromium-review.googlesource.com/1003099 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Luc Ferron d91c3793 2018-04-06T09:36:36 Vulkan: Implement support for structs in uniforms - Also enables 174 additional dEQP tests. Bug: angleproject:2446 Change-Id: I07cce46815d2f7a80fd48e7fd9407f7d528b397f Reviewed-on: https://chromium-review.googlesource.com/998406 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Luc Ferron <lucferron@chromium.org>
Olli Etuaho 94bbed1e 2018-03-20T14:44:53 Collect static use information during parsing We now collect metadata for variables in the symbol table. The metadata is stored in a map using the variable unique id as a key, so we can store the variables themselves as constexpr while still having dynamic metadata. For now we collect whether a variable is statically read or written. This can be used to more accurately determine whether a variable is statically used, but can also enable more optimizations in the future, such as pruning variables that are never read or folding variables that are never written after initialization. The collection is done during parsing, so that nothing is pruned from the AST before the static use is recorded. Static writes are flagged in ParseContext::checkCanBeLValue, as that function is already called for all variables that are written. Static reads are flagged whenever there's an operation that requires a variable to be read. This includes: * Unary and binary math ops * Comma ops * Ternary ops * Assignments * Returning the variable * Passing the variable as an in or inout argument to a function * Using the variable as a constructor argument * Using the variable as an if statement condition * Using the variable as a loop condition or expression * Using the variable as an index * Using the variable as a switch statement init expression In case there are statements that simply refer to a variable without doing operations on it, the variable is being treated as statically read. Examples of such statements: my_var; my_arr[2]; These are a bit of a corner case, but it makes sense to treat them as static use for validation purposes. Collecting correct static use information costs us a bit of compiler performance, but the regression is on the order of just a few percent in the compiler perf tests. BUG=angleproject:2262 TEST=angle_unittests, angle_end2end_tests Change-Id: Ib0d7add7e4a7d11bffeb2a4861eeea982c562234 Reviewed-on: https://chromium-review.googlesource.com/977964 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yunchao He 9550c603 2018-02-13T14:47:05 Code refactoring for end2end tests. This change: 1) uses the new style ANGLE_SKIP_TEST_IF to skip tests. 2) replaces compile-time definition for OSX to skip tests by run-time function IsOSX() to skip tests, in order to align with ANGLE_SKIP_TEST_IF. 3) fixes a couple of typos. BUG=angleproject:2005 Change-Id: I5af77d82257536b9eb79e26afa502f5b91ff6d31 Reviewed-on: https://chromium-review.googlesource.com/915861 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yunchao He 2f23f35a 2018-02-11T22:11:37 Clean up end2end tests for Intel OSX. BUG=angleproject:2205 BUG=angleproject:2041 BUG=angleproject:2155 Change-Id: I26bcbb63e147787cd342ec80a86d60cf230be4c9 Reviewed-on: https://chromium-review.googlesource.com/913108 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Geoff Lang ed04619a 2018-02-08T14:57:14 Fix typo in bug link. BUG=angleproject:2205 Change-Id: I7ff1c3d0bb380c73c07dad0a30a4a4a19c17e397 Reviewed-on: https://chromium-review.googlesource.com/909577 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 06b95582 2018-02-08T13:48:44 Re-supress VerifyMax*UniformVectors on Ozone Intel. BUG=angleproject:2205 Change-Id: Icff414dc7a521205fd3e39af4652b0fdef1cb900 Reviewed-on: https://chromium-review.googlesource.com/909291 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Yunchao He 8e5ba8bb 2018-02-05T17:52:27 Clean up end2end tests for Intel Linux platform. Removed tests can pass on Intel Linux Desktop (Intel KabyLake, Ubuntu 17.04) with system default mesa and latest upstream mesa. BUG=angleproject:2205 BUG=chromium:680631 Change-Id: Ie3f0f34b9708a7dab81f66d9ec83a469658deee7 Reviewed-on: https://chromium-review.googlesource.com/901382 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 61d5325e 2018-01-31T14:49:24 D3D9: Improve varying packing failure mode. D3D9 has a special limitation on varying packing, where each variable takes up a full register width, and cannot share space with other packed varyings. A bug was counting registers incorrectly on D3D9. Fix this by introducing a new limitation exposed to the ANGLE front-end via the gl::Limitations structure. Now varying packing will fail correctly in the ANGLE linking front-end with a more descriptive error message, as such: "Could not pack varying blah" "Note: Additional non-conformant packing restrictions are enforced on D3D9." Also change the packing so that input built-in variables are counted towards varying limits (e.g. gl_PointSize), except for gl_Position. On D3D9 we don't pack gl_PointSize, since it is used in a special extra PSIZE register. Also update some tests to be more robust. Bug: chromium:804799 Change-Id: I9027266a8b66a28626f038f259bff42ebf09dcd2 Reviewed-on: https://chromium-review.googlesource.com/889898 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Jiawei Shao 881b7bfa 2017-12-25T11:18:37 ES31: Refactor link mismatch error log This patch intends to refactor the structure of logging link mismatch errors to meet the new GLES 3.1 program link requirements and support linking program with geometry shader. This patch is mainly focusing on the following 4 issues: 1. There are totally 14 places that log the link mismatch errors in almost same format. 2. A temporary string is created (STRUCT_NAME.FIELD_NAME) before checking a field of a block, which is of no use if link succeeds. 3. LinkValidateVariablesBase needs to know "shaderTypes" if we support geometry shader based on current structure. Since uniforms are checked in the range of the whole program, it is unnecessary to know in which shader a uniform is defined if link succeeds. 4. GLES 3.1 regards varyings with same location but different names as matched, so it isn't enough to log errors only by one name. This patch can solve all these issues by the following 3 changes: 1. Replace "infoLog" and "variableNames" by "mismatchedFieldName" (the complete field name if the mismatch occurs on a field of a struct or block). 2. Use enum LinkMismatchError as the return value of all linkValidate* functions to reflect the detail of the link mismatch error. 3. Log all the link mismatch errors by InfoLog::logLinkMismatch where we can get shader types instead of passing them into linkValidate* functions. BUG=angleproject:1941, angleproject:2144 TEST=angle_end2end_tests Change-Id: I3ed876d61f812cc7a45a6a3c5fec0b4a88b9cc2c Reviewed-on: https://chromium-review.googlesource.com/844215 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Yuly Novikov 4e36db8c 2018-01-19T17:35:33 Skip FindMSBAndFindLSBCornerCases on Android OpenGLES Due to a bug in Adreno N5X Oreo driver BUG=angleproject:2304 Change-Id: I209d9b227557571f45a93aa68a003378e12402a1 Reviewed-on: https://chromium-review.googlesource.com/876995 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jiawei Shao 02f15239 2017-12-27T10:10:28 Clear error logs when starting a new link process This patch intends to fix a bug in logging link errors. OpenGL ES requires glGetProgramInfoLog return a string that contains information about last link or validation attempt on a program object (GLES 2.0 Chapter 6.1.8, GLES 3.0 Chapter 6.1.12). So all the link error logs should be cleared when a new link process is begun. This patch also removes several redundant allocations of mLazyStream in ProgramD3D::compileProgramExecutables. Calling "<<" on InfoLog objects will initialize its member mLazyStream from heap, so we will skip using "<<" if there is actually nothing to output. BUG=angleproject:2295 TEST=angle_end2end_tests Change-Id: Ib81fffd3d05919a8ebccd9145ff780548ca86a70 Reviewed-on: https://chromium-review.googlesource.com/848324 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho b8cb939f 2017-12-20T14:23:19 Fix tracking variables in folded ternary operators The result of folding a ternary operator may be a TIntermSymbol node where the qualifier doesn't match the qualifier of the variable that the node is referring to. Get the qualifier from the variable instead of directly from TIntermSymbol when collecting variables in CollectVariables or when tracking referenced variables in OutputHLSL. BUG=angleproject:2288 TEST=angle_unittests, angle_end2end_tests Change-Id: If294a7fe9dca50f2ebcea3feff887e72a521d395 Reviewed-on: https://chromium-review.googlesource.com/836893 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 629a6449 2017-12-11T10:55:43 Fix HLSL integer pow workaround The exponent should be rounded prior to casting it to an integer. Also if the exponent has a significant fractional part the expression should not be turned into a multiplication. The previous code failed to check this correctly if the exponent's fractional part was greater than 0.5. The test case is expanded to cover the previously failing cases. BUG=chromium:793115 TEST=angle_end2end_tests Change-Id: Ic72cd6ddc7f3d2495f7c87a3e3cfac5791445e72 Reviewed-on: https://chromium-review.googlesource.com/817299 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 7caa80e7 2017-11-14T15:03:14 Edit tests to reference temporary variables The shader translator is intended to prune unreferenced variables in the future. To maintain test coverage when this is done, most tests that used to have unreferenced GLSL locals and globals are edited to use built-ins or reference the necessary variables instead. BUG=angleproject:2166 TEST=angle_unittests, angle_end2end_tests Change-Id: I3964e7a80d52fc04a95f57e73da6095e433095e8 Reviewed-on: https://chromium-review.googlesource.com/768740 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 703671e9 2017-11-08T17:47:18 Unify extension behavior checks Some supportsExtension and isExtensionEnabled checks are now turned into checkCanUseExtension checks. Using checkCanUseExtension is preferable so that warnings are generated correctly when an extension is used and a warn directive is present. isExtensionEnabled is still used in some places where an error message about the extension could be confusing, particularly when a core spec version adds support for something that is also present in an extension. Also make it possible to disable ARB_texture_rectangle extension using an extension directive. ARB_texture_rectangle extension functionality is enabled by default in GLSL when the extension is supported. BUG=angleproject:2238 TEST=angle_unittests Change-Id: I7455293412ff469f54bc7da79df146e7bc127379 Reviewed-on: https://chromium-review.googlesource.com/760737 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> 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>
Olli Etuaho bd3cd506 2017-11-03T15:48:52 Clean up HLSL constructor output Split generating HLSL struct constructors from generating built-in type constructors, as these didn't have much in common. Struct constructors are now only generated when they are needed, as opposed to before, when they were generated on any use of a struct. This changes built-in constructor naming to include "_ctor" and gets rid of having special built-in type names just for constructors. This will make it easier to do changes to constructor output, for example to add constructors for structs in std140 layout. This might be needed to implement SSBOs efficiently. This includes one bug fix for writing out struct declarations for varyings. Also improves const-correctness of accessing structs through TType in general. BUG=angleproject:2218 TEST=angle_unittests, angle_end2end_tests Change-Id: If865fb56f86486b9c4a2c31e016ea16427f4a5fa Reviewed-on: https://chromium-review.googlesource.com/753883 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho c1f14fbe 2017-10-28T19:17:23 Remove empty switch statements from translated shaders The native HLSL compiler does not accept switch statements with an empty statement list. The simplest way to accommodate this is to simply remove them from the AST after parsing and some initial pruning. This is done by the new RemoveEmptySwitchStatements traverser. It preserves init statements of switch statements in case they have side effects. So for example switch(++i) {} gets translated to ++i; BUG=angleproject:2206 TEST=angle_end2end_tests Change-Id: I550a3c9b010a3566016bdfd93344ac30fd860604 Reviewed-on: https://chromium-review.googlesource.com/742922 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho f6d242ed 2017-10-12T17:21:06 Wrap switch statements in blocks in HLSL If variables are declared inside a GLSL switch statement, they are scoped until the end of the switch statement. This is not compatible with HLSL rules, where the scoping is until the end of the case. To work around this, wrap switch statements in a block that declares the variables in HLSL. This is done after most other transformations done to the AST are complete, since some of the other transformations may introduce temporary variables. BUG=angleproject:2179 TEST=angle_end2end_tests Change-Id: Id0bb89affe103177fd3d6a6b2f3619b5e1ada0a6 Reviewed-on: https://chromium-review.googlesource.com/716381 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 4bd730c8 2017-10-10T14:14:19 Recognize more non-fallthrough cases in switch/case RemoveSwitchFallThrough now treats cases where break; or return; is nested inside a block as non-fallthrough to avoid unnecessary duplication of code. For example, the case 1 below would previously get treated as fall-through: switch(foo) { case 1: { break; } default: break; } Now RemoveSwitchFallThrough doesn't do anything to this code. BUG=chromium:772695 TEST=angle_end2end_tests Change-Id: Iafab6d8b05c63bcdb5f54834dbc1f41192c31dd4 Reviewed-on: https://chromium-review.googlesource.com/709197 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 923ecef6 2017-10-11T12:01:38 Fix switch statement validation corner cases The grammar needs to generate AST nodes even for no-op statements, since they might be the last statement in a switch statement that is required for switch statement validity. Change the grammar to generate nodes from empty blocks and empty declarations. We also need to do some further processing of the AST. This is because PruneEmptyDeclarations will still remove empty declarations, and at least the NVIDIA driver GLSL compiler doesn't accept some types of no-op statements as the last statement inside a switch statement. So after parsing has finished we do rudimentary dead code elimination to remove dead cases from the end of switch statements. BUG=angleproject:2181 TEST=angle_unittests Change-Id: I586f2e4a3ac2171e65f1f0ccb7a7de220e3cc225 Reviewed-on: https://chromium-review.googlesource.com/712574 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 852fe873 2017-10-10T15:13:59 Fix HLSL for switch statements that don't end in a branch In case the last case inside a switch statement is not terminated in a branch statement, RemoveSwitchFallThrough needs to add it before calling handlePreviousCase. This ensures that all preceding fall-through cases will get a copy of the branch statement and so will not fall through. This also fixes running RemoveSwitchFallThrough so that it's only executed once per each switch statement. The error was not caught by the dEQP tests, so a new ANGLE test is added. BUG=angleproject:2178 TEST=angle_end2end_tests Change-Id: I26b6989aa4d32de2d74cde56d72ee24f61195445 Reviewed-on: https://chromium-review.googlesource.com/709196 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 78507c6e 2017-10-10T15:06:45 Fix statements disappearing from switch statements in HLSL RemoveSwitchFallThrough now correctly records the existence of declaration and swizzle statements inside switch statements. BUG=angleproject:2177 TEST=angle_end2end_tests Change-Id: I1ef83997db7ae510ded002a9568c29272c00c2fe Reviewed-on: https://chromium-review.googlesource.com/709195 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Kai Ninomiya a60d3567 2017-10-02T22:10:28 Re-enable uninitialized-local test that should pass now Follow up to https://crrev.com/c/669642 Bug: angleproject:2041 Change-Id: I27bf4458f5c8be265b757fd5a3ea10f5ffa9e10e Reviewed-on: https://chromium-review.googlesource.com/696764 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho a20af6d7 2017-09-18T13:32:29 Use C++11 raw string literals instead of SHADER_SOURCE macro This is better in many ways: 1. It doesn't confuse clang format 2. \n doesn't need to be included after preprocessor directives like the version directive. 3. It's using built-in functionality instead of something custom. Raw string literals should be the preferred way to include shader source in C++ files going forward. BUG=angleproject:2157 TEST=angle_end2end_tests Change-Id: I8b236a6e2d5c25d920297e5bc5b5b143eddeba1f Reviewed-on: https://chromium-review.googlesource.com/671046 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho bb5a7e29 2017-08-30T13:03:12 Allow length() on arbitrary array expressions This is required to pass some dEQP GLES 3.1 tests for arrays of arrays, and WebGL conformance tests were also recently fixed to require this behavior. The intent of the GLSL ES spec was not to restrict usage of length(). In practice GL drivers don't implement array length() on expressions with side effects correctly in all cases. HLSL doesn't have an array length operator either. Because of this we always remove array length ops from the AST before output. BUG=angleproject:2142 TEST=angle_unittests, angle_end2end_tests, WebGL conformance tests Change-Id: I863a92e83ac5315b013af9a5626348482bad72b3 Reviewed-on: https://chromium-review.googlesource.com/643190 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho a16a84f3 2017-09-12T13:49:18 GLSL: Fix initializing globals declared after main() Initialize globals in a separate function instead of a block in the beginning of main(). This way it works also for globals declared after main(). BUG=chromium:764036 TEST=angle_end2end_tests Change-Id: I2fcbb97d046589301287757dc3dde5471172a3f6 Reviewed-on: https://chromium-review.googlesource.com/663158 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 28839f03 2017-08-15T11:38:16 Fix handling sampler arrays in structs as function arguments on HLSL Some of the code was written under the mistaken assumption that createSamplerSymbols would be splitting sampler arrays in structs into individual samplers. Fix it by adding array dimensions to sampler parameters generated by createSamplerSymbols when necessary. BUG=angleproject:2128 TEST=angle_end2end_tests Change-Id: Ie622c777d78ae65b5629d12e0ae574800c1b78f5 Reviewed-on: https://chromium-review.googlesource.com/614882 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Olli Etuaho 3860b6c0 2017-07-19T16:17:24 Fix arrays of structs containing samplers as parameters on HLSL In HLSL output, samplers are never passed to functions as arrays, but rather sampler array arguments are expanded into single sampler and/or texture arguments. This applies also when the samplers were inside arrays of structs in the original source. BUG=angleproject:2103 TEST=angle_end2end_tests Change-Id: Ib1fcba0c0ab3da592d15272eb56a03c3e536f349 Reviewed-on: https://chromium-review.googlesource.com/576041 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 06a06f5e 2017-07-12T12:22:15 Fix non statically used fragment input structs on HLSL Add static use information to struct fields that mirrors the static use information on the struct itself. This way dynamically generated HLSL doesn't need special handling for initializing fragment inputs if they are structs. This fixes a problem with the previous code where dynamically generated HLSL ended up trying to initialize structs that are not declared in the HLSL output because they were not being referenced. BUG=angleproject:2104 TEST=angle_end2end_tests Change-Id: I21283ce4fe26515d62d95e61f8155dc9a9b44cf1
Olli Etuaho 088031e6 2017-07-03T15:59:33 HLSL: Disambiguate between struct function parameters Structs with different names but identical members are treated as ambiguous by the native HLSL compiler when looking up user-defined functions. Add the struct name to the function name to work around this limitation. BUG=chromium:731324 TEST=angle_end2end_tests Change-Id: Ie80ac0f1374bc5ac05dfebef3f94e2da7cdfc581 Reviewed-on: https://chromium-review.googlesource.com/558929 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho ff526f14 2017-06-30T12:26:54 Fix variable vs. function name conflict in HLSL output GLSL ES spec accepts the case where an initializer of a variable calls a function with the same name as the variable. The HLSL compiler doesn't accept that. Work around this limitation in the HLSL compiler by disambiguating user-defined functions from variables with a different prefix. BUG=angleproject:2095 TEST=angle_end2end_test, angle_unittests Change-Id: I41b32a3fcc6fd4c548e8dc3aa680d1b07fcf8719 Reviewed-on: https://chromium-review.googlesource.com/557872 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Olli Etuaho 914b79a6 2017-06-19T16:03:19 Fix parsing GLSL loop conditions that declare a variable Now the variable declaration is included in the AST, so that the loop body may refer to the variable. The variable declaration is placed in a block that wraps the loop. This way we can still only have TIntermTyped loop conditions in the AST, which keeps the code dealing with loops fairly simple and type safe. This change includes reversing the return value of executeInitializer, so that it returns true on success and false on error. This is more in line with other ParseContext member functions. BUG=angleproject:2073 TEST=angle_end2end_tests Change-Id: I5c4ecbf1b438d3fff6d6237c0dcf191e2a19664c Reviewed-on: https://chromium-review.googlesource.com/539639 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Geoff Lang bb1e750c 2017-06-05T16:40:09 Validate that structure names match when linking uniforms. GLSL 1.017 4.2.4: Structures must have the same name, sequence of type names, and type definitions, and field names to be considered the same type. TEST=conformance/glsl/misc/shaders-with-uniform-structs BUG=angleproejct:2013 Change-Id: Ieedaaca2d28ef4e1cc0b5480f413ebd513c1dc1f Reviewed-on: https://chromium-review.googlesource.com/524036 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 2f348d2a 2017-06-05T10:50:59 Make gl::Compiler reference-counted. This is helpful for implementing program binary caching in ANGLE. in order to maintain the current behaviour in Chrome, we will need to defer shader compilation until link time. Since WebGL allows the app layer to enable and disable extensions explicitly, the app can enable or disable an extension between the calls to glCompileShader and glLinkProgram. Then, if we're deferring shader compilation, we will have to preserve the extension settings at the time of the call to compile, not the current settings at the time of link. Making the compiler reference-counted gives us a pretty simple and robust solution. This also changes the Context class to lazily init the shader compiler. Lazy init prevents any unexpected nulls, and also ensures the releaseShaderCompiler does exactly that: just releases the shader compiler, and does not immediately re-initialize it. BUG=angleproject:2044 Change-Id: I0f0eeb4eb94dc4eee238f92482804a0921c77df0 Reviewed-on: https://chromium-review.googlesource.com/522868 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 0ffc441e 2017-05-19T14:18:55 Initialize uninitialized globals in GLSL output Initializing globals is done by the DeferGlobalInitializers AST transformation, which makes sure that the global variable init proceeds in the correct order. This is important since some global variables may use other uninitialized globals in their initializers. The global variable init is only done in case the WebGL shader spec is being followed. This avoids adding global initializers twice in case the same shader goes through multiple translations, assuming only one of them is a WebGL shader translation. BUG=angleproject:1966 TEST=angle_end2end_tests, WebGL conformance tests Change-Id: Iea701d3ae40edc906abd87303f2aa27fd23bf55a Reviewed-on: https://chromium-review.googlesource.com/509689 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho df7d13eb 2017-05-30T13:53:45 Lift outdated NVIDIA test suppressions Lift some test suppressions for bugs that have been fixed in the NVIDIA driver a good while ago. Also improve code style in some suppressions - prefer IsOSX() and IsLinux() to using ifdefs. BUG=angleproject:1305 TEST=angle_end2end_tests Change-Id: Ia069f5b9696000c901956d2952801d5f5c339a11 Reviewed-on: https://chromium-review.googlesource.com/518168 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
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>
Yunchao He f81ce4a3 2017-04-24T10:49:17 Refactoring: replace NULL by nullptr for pointers (3rd CL). This CL mainly handles passing/returning NULL to/from a function. BUG=angleproject:2001 Change-Id: I34802f792e710e3d7ff697cbe4701dc1bf5ab009 Reviewed-on: https://chromium-review.googlesource.com/485060 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@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>
Olli Etuaho 8162926b 2017-04-19T11:56:01 Never add declarations without children to the AST When block nodes were being created for loop bodies that didn't have braces in the parsed source, the code didn't check if the loop body was a declaration node without children. Always use appendStatement() for adding statements to a block, so that declaration nodes without children don't end up in the AST. Similarly make sure that loop init nodes aren't declarations without children. BUG=chromium:712550 TEST=angle_end2end_tests Change-Id: I5e79b700fe6158fa2422fcf4cd13818b2bd24863 Reviewed-on: https://chromium-review.googlesource.com/481660 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>