src/libANGLE/VaryingPacking_unittest.cpp


Log

Author Commit Date CI Message
Jamie Madill d654ac9b 2020-12-30T12:28:41 Program: Support multiple varying packings. Instead of using a single varying packing for all program stages, we switch to using a varying register packing for each pair of input/output shaders. This allows several valid use cases that use many varying to succeed. For instance Geometry Shaders have both an input and output varying packing. With tessellation shaders the upper bound of valid varying packings in one Program goes up even more. We keep multiple varying packings at once inside a new "ProgramVaryingPacking" class. Internally the class keeps a unique varying mapping for each input/output interface in the program. Separable programs with "open" interfaces are handled specially. Fixes a bug where varying counting was artificially limited for programs with more than two shaders. This CL also disables GS support when we're emulating line raster so we don't have to figure out the details on how to place the special position varying. Bug: angleproject:5496 Change-Id: I1f9a327c4750caef570c608d86953e9d0cc5eea3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606532 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill d9669322 2020-12-30T14:33:02 Remove "init" from VaryingPacking. Instead we can pass the pack mode and size to the collectAndPack method. This cleans up the interface and also allows us to merge two separate code blocks in Program and ProgramPipeline. Bug: angleproject:5496 Change-Id: I390b5d2e8a3b033374ccc5a250597be1f03dec96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606531 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill d33ffb22 2020-12-30T11:14:00 Organize VaryingPacking methods. This clarifies the difference between "collect" and "pack" methods. Previously the naming was overlapping between the two. Also makes the "packUserVaryings" method private. Refactoring change only. Will enable further improvements for capturing varyings with multiple shader stages. Bug: angleproject:5496 Change-Id: I854590ceab39f3a0e7a785516e0d1fd44e4ccc98 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2606529 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Jamie Madill 92e7bc89 2020-12-23T15:18:42 Remove ProgramLinkedResources from ProgramExecutable. Instead of storing the entire LinkedResources struct, we can keep it only for the duration of the linking calls. Refactoring change only. It sets the stage for more refactoring. This change also switches the link call to use LinkingState's ProgramLinkedResources directly to avoid the need to copy the varying packing or use a pointer. Bug: angleproject:4514 Bug: angleproject:5496 Change-Id: Iefea3c16a33213dc338cc54efaa7c3064ea6ae08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2601403 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi f764fc02 2020-02-03T10:33:58 Fix varying linking by location This change breaks the assumption everywhere that varyings can be identified uniquely by name throughout all stages of the pipeline. It further implements linking of varyings by location, if specified. Bug: angleproject:4355 Change-Id: Ie45e48879008c3f0c22d1da3d0d26f37c655e54e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2030026 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Tim Van Patten 90a58622 2019-09-04T15:39:58 Refactor ShaderVariable to Remove Specializations The following structs are being refactored and moved into the parent struct ShaderVariable: VariableWithLocation Uniform Attribute OutputVariable InterfaceBlockField Varying Bug: angleproject:3899 Test: CQ Change-Id: I389eb3ab4ed44a360e09fca75ecc78d64a277f83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1785877 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> Commit-Queue: Tim Van Patten <timvp@google.com>
Victor Costan ffd39978 2019-02-20T10:45:24 test: Replace _TEST_CASE_ with _TEST_SUITE_. Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports _TEST_SUITE_ macros instead of _TEST_CASE_, so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature Bug: chromium:925652 Change-Id: Ia0deec0bc4216ef1adabc33985a7cbda89682608 Reviewed-on: https://chromium-review.googlesource.com/c/1477418 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@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>
Jiawei Shao da92a476 2018-07-02T15:55:19 Clean up VaryingPacking This patch intends to clean up some issues in VaryingPacking to implement geometry shader easiler. 1. Use emplace_back() instead of push_back() when necessary. 2. Remove unnecessary parameter in VaryingPacking::packUserVaryings(). 3. Remove the assignment of semanticIndex and only handle them in D3D11 back-ends. BUG=angleproject:1941 Change-Id: Ia09c07f01dc442ce95cb4984e4b768d0c79872c7 Reviewed-on: https://chromium-review.googlesource.com/1128576 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Jamie Madill 3c1da04e 2017-11-27T18:33:40 Isolate GlslangWrapper header from most of ANGLE. Since we might want to use the ANGLE PoolAlloc in the Vulkan back-end, we want to make completely sure that it doesn't show up in any header that might be included with the Glslang headers, since this could cause a conflict. This change moves as much as possible to forward-declaring instead of including headers directly in ProgramLinkedResources.h. This means making several internal Program helper classes external. I.E. instead of Program::Bindings, we have ProgramBindings. It also redeclares a "using" in two places, since it isn't possible to forward declare these, and it seemed overdesigned to put the using in a separate header. Bug: angleproject:2264 Change-Id: Idd08706580c927327dddf46e86acbcd2c4e3286f Reviewed-on: https://chromium-review.googlesource.com/792270 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Olli Etuaho 465835d6 2017-09-26T13:34:10 Support arrays of arrays in the API The ShaderVariable class that is used as an interface between the compiler and the rest of the code gets arrays of arrays support. Array of array variables are passed from the compiler just like any other variables. However, when stored in Program state each innermost array constitutes a separate variable. This is done to make the implementation match the GLES specification for program interface query APIs. This will be tested more fully once support for parsing arrays of arrays lands in the compiler. TEST=angle_end2end_tests, angle_unittests BUG=angleproject:2125 Change-Id: I0f7159000f039be92a87a52b3b68cd9a215a21cb Reviewed-on: https://chromium-review.googlesource.com/684742 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
jchen10 85c93c41 2017-11-12T15:36:47 Refactor VaryingPacking Move all packing related logic from Program to VaryingPacking. Do linkValidateTransformFeedback check first to simplify packing. Make getPackedVaryings collect all required VaryingPackings in one run pass, so that packUserVaryings can focus on packing merely. BUG=angleproject:2241 Change-Id: I5e84e6e4688c80ba7a77a265b8ffaf79f4ddbb87 Reviewed-on: https://chromium-review.googlesource.com/764821 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Jamie Madill 192745a7 2016-12-22T15:58:21 Add varying packing validation for WebGL. This CL moves the varying packing from the D3D layer up to Program. This is necessary for WebGL validation, and gives us consistency for the various back-ends. There may be some additional cleanup work on the VaryingPacking class, because it does some work that is D3D- specific. WebGL requires strict varying packing. Instead of allowing success unconditionally, it's an explicit error to succeed to pack a set of varyings that the sample algorithm would fail to pack. Introduce a new packing mode option to the varying packing class to handle this different packing style, while keeping our old more relaxed packing method for ES code. BUG=angleproject:1675 Change-Id: I674ae685ba573cc2ad7d9dfb7441efa8cb2d55fc Reviewed-on: https://chromium-review.googlesource.com/423254 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>