* Only promote local resource when has store of handle.
* Report error when cannot map local resource usage to global resource.
* Promote static resource when optimization is disabled too.
* Take care PHINode on local resource.
* Fix ValidateDxilBitcode PSV generation for Root Signature validation.
- also fix validation for empty patch constant signature.
* Test container and root signature validation.
* Fix DXASSERT when PC in/out patch sig mismatch HS.
- zero DxilProgramSignatureElement to prevent garbage in signature
- rewrite bitcode when stripping root signature
- use correct part when reading debug module in ValidateDxilContainer
- report general error message when signature validation fails
* Write thread group uniform value will not cause race condition.
* Only report race condition when know the data is not uniform.
* Disable race condition check.
- Implement and centralize container validation components in DxilValidation
- Strip RootSignature from module metadata before serializing to container
- Use existing DxilModule when serializing rather than constructing new one
- Add DxilModule::TryGetDxilModule for capturing diagnostics on metadata load
- Expose DxilPartWriters/DxilContainerWriter for use elsewhere (such as in validation)
This commit adds support for extension intrinsics that work as
methods on resources. For example, we could have an extension
on buffers called `MyBufferOp`
Buffer<float2> buf;
float2 val = buf.MyBufferOp(int2(1, 2))
To support extension methods we add a new resource lowering strategy
that does three transformations to the intrinsic call
1. Expand vectors in place in the call arguments.
2. Convert non-void return value to dx.types.ResRet.
3. Convert resource parameter to dx.types.Handle value.
For example, assuming that MyBufferOp has opcode 138. The resource
lowering strategy would convert the call as HL-dxil to dxil as
follows
call <2 x float> MyBufferOp(i32 138, %class.Buffer %3, <2 x i32> <1 , 2> )
==>
call %dx.types.ResRet.f32 MyBufferOp(i32 138, %dx.types.Handle %buf, i32 1, i32 2 )
This commit improves the support for intrinsics added through
the IDxcIntrinsicTable interface:
- Only rewrite unsigned opcode for builtin intrinsics
- Allow replication to work when only vector is return value
- upconvert to 6.0 in dxc.exe and d3dcompiler_dxc_bridge
- restrict to 6.0 in dxcompiler API
- restrict to 6.0 in DxilValidator
- allow loading of SM < 6.0 for now on DXIL 0.7
- Add DxilSignatureAllocator for signature packing
- Fix signature validation. Add more validation.
- Fix and add validation tests.
- Fix codegen for inout params with SV like SV_Coverage
- fix m_SemanticStartIndex on DxilSignatureElement::Initialize
- fix DxilSignatureElement::GetColsAsMask for start col == 2
- Add diags for signature allocation failures
- Use Regex in ValidationTest
This commit adds initial support for extension intrinsics and defines, including:
-Support for recognizing hlsl extensions as new intrinsic functions.
-Support for requesting lowering of extensions.
-Support for preserving semantic defines.
-Support for validating semantic defines.
This commit adds support for hlsl extensions in the form of additional
intrisic functions and semantic defines.
We now allow a dxcompiler instance to register that it can handle
additional intrinsic functions beyond the standard hlsl intrinsics. These
new intrinsics are called extensions. For each extension, the compiler
supplies a lowering strategy that is used by the dxcompiler to translate
from the source level intrinsic to a high-level dxil intrinsic.
We initially support the two lowering strategies: replicate and pack.
The replicate strategy will scalarize the vector elements in the call
and replicate the function call once for each element in the vector.
The pack strategy changes the vector arguments into literal struct
arguments.
We also now include support for "semantic defines". A semantic define is
a source level define whose value is preserved in the final dxil as
metatdata. The source level define can come as either a #define in
the hlsl source or a /D define from the command line.
We provide a hook to validate that a semantic define has a legal value
(for example to ensure that the value is an integer). Validation failures
can produce warnings and errors that will be emitted through the standard
clang diagnostic mechanism.
This code was originally written by marcelolr and modified by dmpots to
support packed lowering of intriniscs and validation of semantic defines.