* [spirv] Respect the -auto-binding-space option in SPIR-V backend.
* [spirv] Use default space if vk::binding doesn't provide dset.
* Address code review comments.
* Hide Unix symbols by default
Using the -fvisibility=hidden by default only exposes symbols that have
the __attribute__((visibility("default"))) attribute applied to them.
There are only a couple of functions that are meant to be exposed from
libdxcompiler. To expose the proper functions, the macros used to create
the UUIDs for class types are redefined with the attribute and
DXC_API_IMPORT is defined with the attribute above for non-windows
platforms.
Since we're hiding everything now, the portions that were explicitly
hidden to make MacOS work are removed.
This exposed a number of missing dependencies of libraries and unit
tests. Namely clang-hlsl-tests, clang-spirv-tests, and libclangCodeGen.
Resolves#2203
* Remove explicit marking of DxcThreadMalloc hidden
This was a workaround that is not longer necessary since all symbols are
hidden by default on Unix platforms now.
Before this change, decision of creating temporary variables for
function arguments were affected by three things: storage class,
param type, out or inout keyword. For example, if storage class of
a function arg is different from the param, we create a temporary
variable whose storage class is the same with the param and store
the function arg before the function call. After the function call
we store the value to the actual arg if needed.
Now based on HLSL legalization supported by spirv-opt, we do not
need to consider storage class. Similarly, we do not need to
consider type difference between arg and param if they have an
isomorphic type e.g., same structure but different names.
* Moves the implementation of DxcThreadMalloc to dxcmem.cpp; removes DxcSwapThreadMalloc
* Remove DxcSetThreadMalloc(OrDefault) -- they were always been used for installing the default allocator
* Deletes copy and move ctors and assignment
* stores the allocator in the TLS slot.
* DxcSwapThreadMalloc should be able to install a null allocator
* Marks the DxcThreadMalloc members as hidden (linux only)
/Zi should be used with much care in FileCheck tests, because the contents of the test file gets embedded into the output, so any CHECK: lines will match by default because they will match themselves in the quoted source file.
This change removes /Zi from most tests which should not have it anyways. Several tests had to be updated or deleted because they weren't actually passing. All tests with /Zi remaining are now under the debug subfolder and reference the readme file that explains the gotcha.
Deleted some old code where we manually delete users of resource GV's while stripping debug modules. This is normally unnecessary but harmless, because we are guaranteed to have reduced all resource variables, and any failure to do so would result in a validation failure. However, library shaders can have resource variables. Removing the instructions here would result in incorrect code.
To complement the new [RW]ByteAddressBuffer.Load/Store<T> feature, it's useful to have operator sizeof to compute offsets. This supports both type and expression forms of the operator, as in C++. The size returned is consistent with struct layouts in StructuredBuffer, but not necessarily with that of constant buffers, which use different rules. Using sizeof on resources or aggregates containing resources will result in a compile-time error. It is only supported for "blittable" types.
* Modifies DxilDia's to use factories instead of lambdas for creating symbols
DxilDia used to hold a vector of lambdas -- constructors -- for the symbols
it knew about. When the user requested a symbol, said constructor was to be
invoked, creating a brand new symbol.
C++ lambdas can be hard to debug (i.e., how does one inspect the lambda's
state?), so the library is modified to hold a vector of factories -- i.e.,
objects with fields and a CreateSymbol method.
* fixes typo when creating Typedef symbols
* caches the VarInfo when creating the LocalVariable factories
This change adds support for : register(spaceN), where a space is specified but no register, such that the resource allocator runs on the given space.
For backwards compatibility, -auto-binding-space applies to resources without register bindings but not to those with an explicit register assignment like : register(t0) - those always go in space 0. To support this, I had to add state to represent "unspecified space". In the UnusualAnnotation, it's a Optional<uint32_t>. In the DxilResource, it's UINT_MAX, like we do for unspecified registers.
Adds support for templatized RWRawByteBuffer.Store<T>. To avoid SROA making us lose the original layout of any struct arguments, a new pass runs before SROA and breaks down such cases into per-element stores. So better be careful with the likes of buf.Store(0, (int[65536])0);...
Several tests could not be added to the batch run folder because they had a SkipDxilVersion test. This change allows this test to be performed in a // RUN: line, so that the tests can be moved to the batch folder. It also includes a small refactoring of FileRunCommandPart