Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextureGather and TextureGatherCmp are missing f16 and i16 return type #739

Closed
markherdeg opened this issue Oct 27, 2017 · 0 comments
Closed
Labels
bug Bug, regression, crash

Comments

@markherdeg
Copy link
Collaborator

In hctdb.py, these should both have "hfwi" instead of "fi".

@hekota hekota added the bug Bug, regression, crash label May 15, 2018
ehsannas added a commit to google/DirectXShaderCompiler that referenced this issue Dec 13, 2018
* Fix order of source content metadata: main file first, then sorted by name (microsoft#1606)

* Move DxilRootSignature to its own directory. (microsoft#1609)

* Move DxilRootSignature to its own directory.
* Move DxilContainer into its own directory.
* Move DxilLoadMetadata into DxilUtil.

* Add string type (microsoft#1601)

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.

* Always try to legalize sample offsets (microsoft#1610)

* Add Subobjects: classes, metadata, serialization, reflection, disasm

* [spirv] Refresh SPIRV-Tools for new validation and bug fixes (microsoft#1615)

Fixes microsoft#1598

* Added a dce to properly clean up unused resources involved in convergent computations

* Fixed comment

* Add the HLSL-spirv cookbook. (microsoft#1618)

Add a document to give examples of what HLSL code patterns will generate
valid Vulkan SPIR-V.

* Fixed comment

* Update to DXIL 1.4 and Shader Model 6.4

* Add dot2add and dot4add_*8packed intrinsics

* Add SV_ShadingRate plus optional feature flag

- Move/fix flag collection based on signature properties to be computed
  per entry function (including for libraries)

* Fix mixed line endings in CGHLSLMS.cpp (microsoft#1619)

* Address feedback, remove unused extra RDAT version.

* [spirv] Remove duplicated impl for HasHLSLMatOrientation() (microsoft#1624)

* Disasm: Additional feedback and rename state object flags to match hlsl

* Support pragma pack_matrix. (microsoft#1623)

* Move struct defs outside union to avoid warning [-Wnested-anon-types]

* Stop checking generated binaries in Travis CI

* Compile DxilLibraryReflection.inl on Linux and macOS

* Specialize std::hash in namespace std

* Propagate convergent operands only once (microsoft#1626)

* Report error for mismatched types in initialization lists (microsoft#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.

* Resolve compiler warnings on Linux and macOS (microsoft#1628)

* Removed unused functions and fields
* Turned off switch enumeration value not handled warnings
* Fixed initialization issues

* Fix modf implementation (microsoft#1630)

* Fix string interning for Subobjects (microsoft#1640)

* 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

* Change normalize implementation. (microsoft#1641)

* Change normalize implementation.
  From  a / length(a) to a * (rsqrt(dot(a))).

* Make return value the first output element. (microsoft#1622)

* Add DxilContainerReader and refactor PSV/RDAT into DxilContainer lib (microsoft#1642)

* Fix dynamic indexed row_major matrix from cbuffer (microsoft#1643)

* Fix microsoft#1629 - crash when using NonUniformResourceIndex (microsoft#1646)

Fix crash caused by NonUniformSet being invalidated before use
Instead of using NonUniformSet, defer lowering of
NonUniformResourceIndex until last, then mark all GEPs that use
the incoming value.

This will mark all uses of the value used in NonUniformResourceIndex
as non-uniform, including indexing that was not marked non-uniform,
if it ends up being the same index.  This matches the prior behavior,
and avoids loss of non-unifom metadata when merging GEPs, but could
be considered not quite correct, although the difference in indexing
would probably not have been intentional.

* Only propagate WaveSensitive when target BB not post dom current BB. (microsoft#1648)

* Remove using namespace llvm from DxilSubobject.h (microsoft#1649)

* Fix dependency on HL/DxilModule from llvm::Module (microsoft#1651)

- use function pointers for HL/DxilModule remove function callbacks
- move ReducibilityAnalysis to llvm/Analysis

* Fix lower memcpy for nested struct with single element (microsoft#1650)

* Fixed failure on including empty files, and added test.

Addresses microsoft#861

* Add Subobjects to compiler front end (microsoft#1645)

- Add HLSL subobject classes to clang and enable their initialization
  via initialization lists.
- Translate declared subobjects and add to DXIL module.
- Fix bugs in subobject metadata serialization and disasm.
- Preserve original input string in root signature subobject.
- Remove unused IsHlslObjectType method from CGHLSLRuntime.
- Remove unnecessary collection of global strings in CGHLSLRuntime
- Change type printer to report 'literal string' for constant char arrays.

* Fix remaining HLModule/DxilModule dependencies from llvm::Module, etc. (microsoft#1656)

- Use one callback for global removal - Function and GlobalValue use this
- Share callback for HLModule and DxilModule, transfer is handled by
  setting callback on construction and checking pointer before clearing

* Reorder RDAT sections back to previous order (microsoft#1658)

* Disable eliminate output dynamic indexing for HS. (microsoft#1655)

* Disable eliminate output dynamic indexing for HS.

* Fix build warning and remove test.

* Use CHECK-DAG on validation test when error order may be different (microsoft#1659)

* BUILD (disabled opt.exe): fix opt.cpp include path

* Subobject tests (microsoft#1657)

Add error on empty root signature value or subobject to export association.

* Add root signature flags (microsoft#1663)

* Add root signature flags

- Add LOCAL_ROOT_SIGNATURE flag in RootFlags
- Add DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS flag in DescriptorTable
- New DxilRootSignatureCompilationFlags argument on Compile/ParseRootSignature
  to specify whether the root signature is local or global.

* Fix root signature flag issues, add cmd test for root sig from define

* Changed default compilation options to honor #line directives and added tests. (microsoft#1665)

* Added support for custom include paths when compiling with /P (microsoft#1666)

The include paths were not piped as preprocessor command args. Includes a test.

Fixes microsoft#1636

* Fix ViewportOrRTArrayIndex feature bit compat with validator 1.3 (microsoft#1664)

* [spirv] Add support for casting involving vector decomposition (microsoft#1677)

Fixes microsoft#1673
Fixes microsoft#1675
Fixes microsoft#1676

* Fix memory allocation issues (microsoft#1679)

- DxilModule was not freed
- PragmaMatrixHandler was freed twice when the compiler execution was aborted
  prematurely by an exception
- Improve diagnostic tracing in CompilerTest::CompileWhenNoMemThenOOM

* [spirv] Add half as allowed (RW)Buffer element type (microsoft#1678)

Fixes microsoft#1672

* Fixed [unroll] being interpreted as [unroll(1)]. (microsoft#1669)

* Add D3DPreprocess to d3dcompiler_dxc_bridge. (microsoft#1681)

* Add D3DPreprocess to d3dcompiler_dxc_bridge.

* Avoid throw in D3DCompile and D3DPreprocess.

* Remove unsupported /O4 option from help text. (microsoft#1662)

* HitGroup subobject changes (microsoft#1688)

- Replace HitGroup subobject by TriangleHitGroup and ProcedurePrimitiveHitGroup
- Add internal HitGroupType enum that maps to D3D12_HIT_GROUP_TYPE
- Add corresponding HitGroupType field to metadata, RDAT and reflection

* [spirv] Allow aliasing builtin variables (microsoft#1691)

This behavior is supported by FXC.

Fixes microsoft#1690

* Added a test for gather/load of textures of 16-bit types. (microsoft#1689)

Fixes microsoft#739

* DxilSubobjectDesc: Reorder Name/Kind for runtime alignment (microsoft#1696)

* Updated comment to fix typo (microsoft#1637)

* Set default floating-point environment at compiler boundaries (microsoft#1703)

Restore floating-point environment at compiler boundaries, and add a test for this.

* Fix Validation for RDAT and other issues with Subobjects (microsoft#1706)

- re-serialize module when changed by removing either subobjects or
  root signature metadata
- improve error detection/handling for loading/creating subobjects
- load subobjects from RDAT if not in DxilModule for RDAT comparison
- fix subobjects missing from desc in DxilRuntimeReflection
- default ReducibilityAnalysis to pass so it doesn't fail when no
  functions are present
- report error on subobject if validator (< 1.4) will not accept
  them, so they will not be captured
- container validation for required/disallowed parts for libraries

* Fix missing hitgroup type in DxilRuntimeReflection (microsoft#1707)

* Update hctstart.cmd to be able to find CMake from VS Professional and Enterprise (microsoft#1699)

* Fix subobject raw bytes storage; don't point into RDAT for reflection (microsoft#1710)

* Fix subobject raw bytes storage; don't point into RDAT for reflection

DxilSubobject:
- combine string and raw bytes storage in m_BytesStorage
- use StringRef as key, since memcmp is used with explicit length

DxilRuntimeReflection:
- add m_BytesMap for local unique copy of raw bytes in RDAT
  to prevent pointing into RDAT blob for root sig
- clean up some insertion patterns

* Rename Get[SubobjectString/RawBytes] to Intern[String/RawBytes]

* Fixed disassembler structured buffer layout output and added tests. (microsoft#1708)

* Fix crash when assigning to global matrix in compat mode (microsoft#1709)

* An earlier bitcast instruction would create an unused GEP instruction referencing the matrix, which the matrix lowering code couldn't handle. Removed that GEP.
* A special case for single-index matrix access was probably meant to catch `m._11` and assumed a value type of float, but it also applied to the first subscript of `m[0][0]`, which returns `floatn`, hence a crash due to mismatched types. The condition was updated to test for non-vector values.

* Better support for D3D12_SHADER_DESC reflection. (microsoft#1704)

Implemented filling out fields related to shader stage properties.

* Fixed crash when static methods are used. (microsoft#1714)

We were unconditionally trying to manipulate the `this` pointer.
Also added a simple test.

* Changed cbuffer-promoted global vars to have external linkage as to not have initializers (microsoft#1713)

Per LLVM rules, globals must be initialized unless they have external linkage. It makes sense to consider constant buffer values as having external linkage, since they are "linked in" by the application, so this change:
* Changes CBuffer globals to have external linkage and no initializer
* Fixes a few cases not handling the lack of initializers properly
* Fixes some tests which were testing for initialization
* Added a test for non-initialization of cbuffer-promoted globals

* Disable quick-test/d3dreflect/lib_hs_export1.hlsl (microsoft#1680)

- this test, along with lib_hs_shaders_only.hlsl indicate a flaky bug
  in the compiler that still needs investigation.

* Fix assert following reflection changes. (microsoft#1717)

DxilModule::GetTessellatorPartitioning didn't follow the model of other methods of returning Undefined when it does not apply to the shader stage and would assert.

* Support for barycentric tests. Note that this is not the complete implementation as there will be tiers introduced for barycentrics support for preserving provoking vertex.
The current test only tests SV_Barycentrics value.

* Fix crash when casting structs with identical layout (microsoft#1718)

* Add an error when bitfields are used. (microsoft#1719)

* Fix implicit unique_ptr to bool conversion error when compiling with GCC. (microsoft#1720)

* [spirv] Add support for VK_EXT_scalar_block_layout (microsoft#1716)

Ref: KhronosGroup/Vulkan-Docs#854

* Added support for pre-SM5.1 resource allocation algorithm (microsoft#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

* Mark built-in types as 'final' to prevent inheritance. (microsoft#1726)

* Barycentric test update; Add RawBuffer Load/Store HLK test entries (microsoft#1727)

Add ExecutionTest / HLK test entries for testing RawBuffer Load/Store
Modify HLSL for Barycentric test

* Skip external libraries if they are already included in parent project (microsoft#1728)

* Fix row_major being lost through typedefs. (microsoft#1723)

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.

* [spirv] '++' and '--' for RWTextures/RWBuffers. (microsoft#1731)

* [spirv] Fix Linux/macOS build. (microsoft#1735)

Fixed ternary op ambiguity.

* Remove use of `NoSerializeHeapMalloc` mem manager. (microsoft#1729)

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.

* [spirv] Support non-fp MAD intrinsic function. (microsoft#1730)

* Fix CompileWhenNoMemThenOOM test failure (microsoft#1747)

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.

* Prevent texture of structs/matrices/arrays, and don't crash (microsoft#1744)

* Add a diagnostic error for non-scalar/vector texel types
* Harden semantic analysis logic against unexpected types

* Skip inserting redundant phi nodes on struct type (microsoft#1748)

* Change in-memory representation of bool vectors to use i32's (microsoft#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.

* Fix use-after-free in parameter SROA (microsoft#1746)

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).

* Revert "Skip inserting redundant phi nodes on struct type (microsoft#1748)" (microsoft#1755)

This reverts commit 545bf5e.

* Fix invalid CmpEQ(%bool,0) for converting bools (microsoft#1756)

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.

* Fix SROA bug when lowering a memcpy from a cbuffer

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.

* Fix SROA for StreamOutput failing based on argument processing order (microsoft#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.

* Created custom unroll pass to optionally include certain exit blocks. (microsoft#1752)

* Update dxexp for newer shader models and features (microsoft#1762)

* [spirv] Update Spriv-tools and Spriv-Headers (microsoft#1764)

* 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.

* [linux-port] Fix linux build break. (microsoft#1767)

* Fix a potential bug in dynamic structbuf indexing (microsoft#1754)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash
Projects
None yet
Development

No branches or pull requests

2 participants