util/shader_utils.h


Log

Author Commit Date CI Message
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 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>
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>
Olli Etuaho 624fbdcf 2018-10-01T11:54:05 Refactor CompileProgram utility Tests often need to call gl functions to set up program related state after glCreateProgram has been called but prior to glLinkProgram is called. Add a callback function to the CompileProgram utility function to fulfill this need. This reduces code duplication considerably in several tests. An alternative way to improve CompileProgram would be to split it into several different utility functions. This might be slightly easier to read, but would also be a larger refactoring and require more checks at the call site. This will make it easier to implement EXT_blend_func_extended tests, which need to bind fragment outputs to different slots. BUG=angleproject:1085 TEST=angle_end2end_tests Change-Id: I3ac8b7bdc21c6a1f14517bc7df0cf6f35abd7612 Reviewed-on: https://chromium-review.googlesource.com/1254062 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill b36a4816 2018-09-25T10:15:11 Vulkan: Add OpenGL line segment rasterization. Line rasterization rules are implemented using a shader patch. The patch does a small test and discards pixels that are outside of the OpenGL line region. The feature is disabled on Android until we can determine the root cause of the test failures. Bug: angleproject:2598 Change-Id: Ic76c5e40fa3ceff7643e735e66f5a9050240c80b Reviewed-on: https://chromium-review.googlesource.com/1120153 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
jchen10 a155bacf 2018-08-16T15:26:39 ParallelCompile: Parallelize shader translation This changes to construct a new ShHandle of compiler for each Shader, and use it to translate the shader source in a background thread. Bug: chromium:849576 Change-Id: Ib49952c7292321ee6aa1c5996f8f7927f40d8f04 Reviewed-on: https://chromium-review.googlesource.com/1177195 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Olli Etuaho dff32a0d 2018-08-28T14:35:50 Support multisample arrays in shader programs The added tests check that using textureSize() and texelFetch() on textures with a fixed point format return expected results. texelFetch is also covered for integer format textures. dEQP GLES 3.1 tests also cover a variety of multisampled array texture formats. BUG=angleproject:2775 TEST=angle_end2end_tests, angle_deqp_gles31_tests Change-Id: I99b422e24b39e3563ed72f0fb85c9c1907df807d Reviewed-on: https://chromium-review.googlesource.com/1196521 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 7ae70d8f 2018-07-06T13:47:01 ParallelCompile: Parallelize D3D linking This adds a new linking state to Program. If a Program is in linking state, on the one hand the foreground thread may continue issuing more GL calls, and on the other hand the background linking threads may be accessing Program internally too. Without a proper constraint there must be conflicts between them. For this purpose, we block any further GL calls to Program until it's actually linked. In addition, we prohibit parallel linking an active program, so that ProgramD3D does not have to worry about such similar conflicts. Also changes the WorkerThread to support limiting the number of concurrently running worker threads. BUG=chromium:849576 Change-Id: I52618647539323f8bf27201320bdf7301c4982e6 Reviewed-on: https://chromium-review.googlesource.com/1127495 Commit-Queue: Jie A Chen <jie.a.chen@intel.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Luc Ferron 94ae660d 2018-04-23T13:58:59 Vulkan: Create tests to validate we created the pipeline when needed 1- Link program with a shader and draw with it, relink with another shader and draw again. 2- Release program that is reading from a uniform. Bug: angleproject:2397 Change-Id: Icb4211c5cf71efaf41833d9d5afd83ce8410c598 Reviewed-on: https://chromium-review.googlesource.com/1028580 Commit-Queue: Luc Ferron <lucferron@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Jiawei Shao 4ed05da2 2018-02-02T14:26:15 ES31: Add link validation on geometry shader itself This patch intends to support program link validation on geometry shader itself. A link error should occur when linking a program with a geometry shader that lacks input primitive or output primitive or the declaration of 'max_vertices'. This patch also adds the support of linking a program with geometry shader in angle_end2end_tests. BUG=angleproject:1941 TEST=angle_end2end_tests dEQP-GLES31.functional.shaders.linkage.es31.geometry.varying.rules.unspecified_* Change-Id: I25fb08514753102f5dd3ab86211c05d2ca4fd185 Reviewed-on: https://chromium-review.googlesource.com/898842 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Jamie Madill 401345e4 2017-08-21T10:52:40 D3D11: Move more state into StateManager11. This moves the input layout cache and vertex and index data managers and related info into the state manager. This makes it easier to manage the state application with regards to dirty bits. Also updates the dirty current value handling in StateManager11. BUG=angleproject:1156 BUG=angleproject:2052 Change-Id: I8de968a1f8416363aa1c49d9e9da129942d21275 Reviewed-on: https://chromium-review.googlesource.com/616783 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill a7d12dc7 2016-12-13T15:08:19 Store uniform block bindings in program binaries. This affects all back-ends - we weren't saving this. Note that bindings can only be set after program linking. The spec is fairly clear in that any programs saved must be loadable and runnable under the same set of state, which would include block bindings. Also add validation for zero binary formats in GetProgramBinary. Also add a workaround for AMD where the block bindings were not applied properly after link, similarly to our original bug. This CL also includes a few fixups for GLProgram (raii). BUG=angleproject:1637 Change-Id: Iae068eb4e1e4c763aa9f9332c033e38708026c8f Reviewed-on: https://chromium-review.googlesource.com/418393 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuly Novikov e3352f94 2016-08-12T20:40:14 Change angle_util to be a shared library So that there will be one instance of static thread synchronization variables in AndroidWindow. Previously there was one instance in lib_angle_deqp_gles2_tests__library and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize waiting forever. Also make the change in GYP build to fix standalone build, and fix rpath issues on Mac. BUG=angleproject:1471 TEST=end2end and deqp tests on standalone Win10 and end2end on GN Mac 10.11 Change-Id: I731578459400bb47d269df129aabed9b67b555e6 Reviewed-on: https://chromium-review.googlesource.com/376202 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Martin Radev 4c4c8e72 2016-08-04T12:25:34 Add compute program compilation and linking support Compute shaders can be now compiled and linked to create programs. Some tests are added to verify successful and unsuccessful compute shader linking. The patch also replaces std::array<int, 3> with a custom struct WorkGroupSize. BUG=angleproject:1442 TEST=angle_end2end_tests TEST=angle_unittests Change-Id: I4ab0ac05755d0167a6d2a798f8d7f1516cf54d84 Reviewed-on: https://chromium-review.googlesource.com/366740 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Olli Etuaho <oetuaho@nvidia.com> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Yuly Novikov 55033e58 2016-08-25T17:32:12 Revert "Change angle_util to be a shared library" This reverts commit 2f9b5e6f79cd576bd3b7110272d58f143801bf0f. Change-Id: I90a7ba0596e79795c9549bc268eabff69c96d572 Reviewed-on: https://chromium-review.googlesource.com/376079 Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Yuly Novikov 2f9b5e6f 2016-08-12T20:40:14 Change angle_util to be a shared library So that there will be one instance of static thread synchronization variables in AndroidWindow. Previously there was one instance in lib_angle_deqp_gles2_tests__library and one in libangle_deqp_libgles2, resulting in AndroidWindow::initialize waiting forever. BUG=angleproject:1471 Change-Id: Ia529c91e34960eb352730c1bb89a91ce6336c8a0 Reviewed-on: https://chromium-review.googlesource.com/368983 Commit-Queue: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang ee48376c 2015-09-15T13:12:07 Update to the latest versions of the GL and EGL headers. Add GLES 3.1 and 3.2 headers. Remove GLES 3.0 extension headers and entry point files. Re-land fixes double define from different style defines in libGLESv2.gypi and other projects. Re-land fixes missing defines in angle_util project in gn. Change-Id: I1952413cd4390e6f5450df809f8f5867bf6f49e2 Reviewed-on: https://chromium-review.googlesource.com/299771 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 0393310f 2015-09-15T16:59:59 Revert "Update to the latest versions of the GL and EGL headers." Issues with GN build. This reverts commit 8284436798dd184afe61cbb586185cb68e503d6f. Change-Id: I99d186019135bbbe250e95c9567854108d31c556 Reviewed-on: https://chromium-review.googlesource.com/299870 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 82844367 2015-09-11T13:52:12 Update to the latest versions of the GL and EGL headers. Add GLES 3.1 and 3.2 headers. Remove GLES 3.0 extension headers and entry point files. Re-land fixes double define from different style defines in libGLESv2.gypi and other projects. Change-Id: I6204dc767bd83b7aa7e4d6e2fa338b2ce7f304d8 Reviewed-on: https://chromium-review.googlesource.com/299401 Tested-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang e12150fe 2015-09-11T20:06:27 Revert "Update to the latest versions of the GL and EGL headers." Linux compile failures to do gyp defines. This reverts commit 8bbeabc1795473f7b3141219be3970fea3b95a71. Change-Id: Icb31dd817414b3a9ab36e88cedab9c725af26b6b Reviewed-on: https://chromium-review.googlesource.com/299173 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8bbeabc1 2015-09-11T13:52:12 Update to the latest versions of the GL and EGL headers. Add GLES 3.1 and 3.2 headers. Remove GLES 3.0 extension headers and entry point files. Change-Id: Icaa444efa52f3b9d1497189da92bc364545a6e3a Reviewed-on: https://chromium-review.googlesource.com/299172 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill 7aef6020 2015-09-11T19:04:00 Revert "Update to the latest versions of the GL and EGL headers." Broke the Clang compile. In file included from ../../third_party/angle/include/GLSLANG/ShaderLang.h:28: ../../third_party/angle/include/KHR/khrplatform.h:282:30: error: no newline at end of file [-Werror,-Wnewline-eof] #endif /* __khrplatform_h_ */ Several other similar errors. BUG=None This reverts commit aac2035d851fc92b159dc8e01cfd2ebb86e99e4a. Change-Id: I407e7e65bb6a46d1d941c54cdf14a14758e22d96 Reviewed-on: https://chromium-review.googlesource.com/298834 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Geoff Lang aac2035d 2015-09-11T13:52:12 Update to the latest versions of the GL and EGL headers. Add GLES 3.1 and 3.2 headers. Remove GLES 3.0 extension headers and entry point files. Change-Id: I8e9df6262dc1b2536a409c5791734e4a4d63b115 Reviewed-on: https://chromium-review.googlesource.com/299341 Tryjob-Request: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Geoff Lang <geofflang@chromium.org>
Jamie Madill ca03b35c 2015-09-02T12:38:13 Re-land "Compute packed varyings in ProgramD3D only." Instead of storing varying information in the shader, use a temporary set when linking a D3D program. This also means we won't have to modify information in the Shader object when linking a D3D program. This completes the refactoring for PackedVaryings. Re-land with fix for missing init of PackedVarying::vertexOnly. BUG=angleproject:1123 Change-Id: If110809c3817d88b0370ac575d739d7385b067d9 Reviewed-on: https://chromium-review.googlesource.com/296731 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill c437046f 2015-09-01T17:27:40 Revert "Compute packed varyings in ProgramD3D only." Likely the cause of Windows bot failures. BUG=angleproject:1123 This reverts commit 532061bbfb160586a06f0e47b6bbb5350e735203. Change-Id: Ia4f0161b97bfbf2adb4cafaa5fa5484f04fad245 Reviewed-on: https://chromium-review.googlesource.com/296710 Reviewed-by: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 532061bb 2015-08-31T15:16:45 Compute packed varyings in ProgramD3D only. Instead of storing varying information in the shader, use a temporary set when linking a D3D program. This also means we won't have to modify information in the Shader object when linking a D3D program. This completes the refactoring for PackedVaryings. BUG=angleproject:1123 Change-Id: I241610e87f7d14f3e18b0d8bd84f1a3509c05dfd Reviewed-on: https://chromium-review.googlesource.com/295193 Reviewed-by: Geoff Lang <geofflang@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Jamie Madill 5704d6e8 2014-08-26T13:16:38 Add some shared utility methods to the utils project. BUG=angle:730 Change-Id: I268c7f76ee9a14ab82f646ae8ebf4eed100bf86d Reviewed-on: https://chromium-review.googlesource.com/213509 Reviewed-by: Brandon Jones <bajones@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>