An implicit object is translated into the first argument to the
method call. If the implicit object is of struct type and its
fields have associated counters, we need to assign its associated
counters accordingly like other normal arguments.
For each such method, we generate associated counters for its
implicit object. At a call site, we assign the associated counters
from the real object to the ones associated with the method implict
object.
Also refreshed SPIRV-Tools
Previously we will return defaultRowMajor as long as the type
is an array. That will hit an assertion failure in translateType()
for arrays of non-matrices.
Also refreshed SPIRV-Tools
We still want to make sure that the generated raw SPIR-V does not
have other validation errors except for allocating variables
containing pointers and returning pointers.
Uses the legalization pass recipe from SPIRV-Tools.
Also change -fcgl to disable both legalization and optimization.
Validation on some tests are turned off because of new image
instruction checking in SPIRV-Tools. Enabling them is a TODO.
When seeing opaque types within structs in function parameter,
function return, and variable definition, invoke SPIRV-Tools
legalization passes.
Also refreshed external projects
With this change, targets in the subdirectory will not be included
in the ALL target of the parent directory by default, and will be
excluded from IDE project files.
* Added effcee and its dependencies (re2) to the project.
* Introduced FileTest that uses effcee to perform checks.
* Added a sample test (check-entrypoint.hlsl)
* Refactored code so WholeFileTest and FileTest can reuse code.
This change enables CodeGenSPIRV test flow.
New tests can be added by simply adding the test file to
`tools/clang/test/CodeGenSPIRV/` directory and running:
```cpp
TEST_F(WholeFileTest, NewTest) {
EXPECT_TRUE(runWholeFileTest("new-test-name"));
}
```
The input file with the format described in `WholeFileCheck.h` is read in;
the HLSL portion is passed to the compiler with SPIR-V codegen enabled.
The resulting SPIR-V binary is disassembled and compared to the expected
result in the input file.
GoogleTest will be used for unit testing and codegen testing for
SPIR-V.
* Added SPIRV_BUILD_TESTS option in CMake to control building
of SPIR-V tests.
* Added "-spirvtest" into hctbuild to enable it.
* Added "spirv" and "spirv_only" targets for hcttest.
Running `hcttest spirv` will run ALL tests including SPIRV tests.
Running `hcttest spirv_only` will ONLY run SPIRV tests.
The default behavior of hctbuild and hcttest is not changed.