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

Task list for VK_EXT_scalar_block_layout #854

Open
Tobski opened this Issue Nov 16, 2018 · 2 comments

Comments

Projects
None yet
3 participants
@Tobski
Contributor

Tobski commented Nov 16, 2018

A group of vendors have recently created a new extension VK_EXT_scalar_block_layout. This extension enables C-like structure layout for uniform and storage buffers, allowing non-scalar types to be aligned solely based on the size of their components. This issue will track the release of various components as they are made available.

The task list for the VK_EXT_scalar_block_layout extension release is:

As each component is made public, the task will be checked off. When all tasks have been completed this issue will be closed and the extension will be fully released.

If you have any questions or feedback, please leave comments below.

@oddhack

This comment has been minimized.

Contributor

oddhack commented Nov 19, 2018

Specs / headers published in the v1.1.93 spec update.

antiagainst added a commit to Microsoft/DirectXShaderCompiler that referenced this issue Nov 20, 2018

@antiagainst

This comment has been minimized.

Member

antiagainst commented Nov 20, 2018

Microsoft/DirectXShaderCompiler#1716 is merged. DXC work for this is done.

ehsannas added a commit to ehsannas/DirectXShaderCompiler that referenced this issue Dec 13, 2018

ehsannas added a commit to google/DirectXShaderCompiler that referenced this issue Dec 13, 2018

Merge MS/master into google/v2 (#283)
* 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.

ehsannas added a commit to ehsannas/DirectXShaderCompiler that referenced this issue Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment