Merge MS/master into google/v2 - #283
Conversation
* Move DxilRootSignature to its own directory. * Move DxilContainer into its own directory. * Move DxilLoadMetadata into DxilUtil.
Add string type and enable top level static const declaration of strings in preparation for future features. Static const is always implied. Arrays, vectors and matrices of string are prohibited. Strings in function parameters, return values and bodies are currently not supported either.
Add a document to give examples of what HLSL code patterns will generate valid Vulkan SPIR-V.
- Move/fix flag collection based on signature properties to be computed per entry function (including for libraries)
Properly clean up resources involved in unused convergent values.
Dxil 1.4 update + packed dot intrinsics and SV_ShadingRate
Add Subobjects: classes, metadata, serialization, reflection, disasm
…1625) The compiler did not report an error when an element in initialization list could not be converted to a target element type. It went though the conversion checks but never reported an error on the clang level. The compiler then crashed in code gen. This commit fixes that.
* Removed unused functions and fields * Turned off switch enumeration value not handled warnings * Fixed initialization issues
* Fix string interning for Subobjects * DxilRuntimeReflection: Remove dependency on llvm/ADT/STLExtras.h - This file is meant to be included in other projects that do not include llvm headers or libs, so it must avoid those dependencies. * Avoid unnecessary strlen operations in GetSubobjectString * StringStorage/RawBytesStorage: use pair of unique_ptr and size
…1687) Added front-end `-flegacy-resource-reservation` to control behavior (added automatically for SM <= 5.0) Added an error for unbounded resources used with `-flegacy-resource-reservation` Added a mechanism for `DxilModule` to preserve intermediate options during its passes but not in the final DXIL Changed `HLModule` to not remove unreferenced `DxilResources` but rather make their symbol UndefValue Fixed assumptions of `DxilResources` having a valid `GlobalVariable` Added reserved resource range gather pass before elimination of unused resources (if SM <= 5.0) Changed resource allocation to account for reserved ranges
…icrosoft#1727) Add ExecutionTest / HLK test entries for testing RawBuffer Load/Store Modify HLSL for Barycentric test
The code attempted to cast a QualType to an AttributedType, which would fail if it was in fact a TypedefType. Better use the existing helper function we have.
Fixed ternary op ambiguity.
It was done to improve the compile time, but it does not seem to be better. The use of `HEAP_NO_SERIALIZE` turns off the low-fragmenataion-heap, which is what we want for this application. See microsoft#1712 for a discussion.
Workaround a regression in the VC++ STL implementation causing the std::bad_alloc to happen in a nothrow context, and re-enabled the test on appveyor.
…t#1744) * Add a diagnostic error for non-scalar/vector texel types * Harden semantic analysis logic against unexpected types
…ft#1742) This change fixes an inconsistency between scalar and vector bools, where the formers were stored as i32s in memory (as opposed to i1s in registers) while the latter remained <n x i1>s. This lead to a number of crashes in more complex bool scenarios where scalar and vector element types were expected to match. The solution is to extend Clang's strategy for scalar bools to vector of bools. Clang relies on three key functions to deal with differences between register and memory type representations which are special-cased for bools and now also for bool vectors. Several HLSL code additions did not properly leverage those functions and this was addressed wherever possible, in some cases removing the need for special cases for bools. To deal with matrices, a similar concept of register/memory representation was introduced in the matrix lowering code and the lowering passes were updated accordingly.
The parameter SROA's LowerMemcpy function deletes the memcpy and bitcast instructions after it has processed them. However, higher up the stack we created an IRBuilder pointing to the first non-alloca instruction, which happens to be the bitcast being deleted. Hence any further use of that IRBuilder will crash. The solution is to delay creating the IRBuilder until after LowerMemcpy, since the rest of the code is well-behaved with respect to instruction deletion (ie it defers them to the end).
…1748)" (microsoft#1755) This reverts commit 545bf5e.
The matrix lowering code special-cased bools and converted from i32s using CmpEQ(%bool,0) instead of CmpNE(%bool,0) in a few places. This change fixes it, where possible by leveraging MemToReg to remove the special cases.
There was already code to detect memcpy with cbuffer sources, but they only accounted for one level of GEP indirection. In the presence of complex nested structs and arrays, this might not be the case, so I extended it to support arbitrary GEP nesting.
…icrosoft#1765) When SROA processes `StreamOutput<T>.Append`, it introduces a local variable for each value being appended, but the data might either be the original `T`, or its SROA'd version (if its argument is a parameter of the enclosing function that has already been processed by the SROA pass). There was already code handling this, but it didn't correctly detect whether the data had already been SROA'd or not. Also added some regression tests.
* Update spirv-tools and spirv-headers. Update the submodules. There is no particular commit that is needed, but it is good to not fall too far behind. * Remove AtomicCounter bit on atomic operations. The bit is ignored in the vulkan environment. It does nothing. * Update tests.
This was found by code inspection. When GEPs containing dynamic indices are translated into structbuf offsets, the logic for computing field offsets did not take data layout into account. This might however be dead code since in all of our tests plus a few custom ones I wrote, nested GEPs where not merged, so the GEP for accessing struct fields only contained constant indices (because the field name is known at compile-time), hence we would never go down that branch. But better safe than sorry. Also consolidated some duplicate code for dealing with sequence types.
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
✅ Build DirectXShaderCompiler 1.0.328 completed (commit 096fdbd73b by @ehsannas) |
|
Just merging upstream to v2. |
No description provided.