Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ string(REPLACE " " ";" LLVM_BINDINGS_LIST "${LLVM_BINDINGS}")

# HLSL Change Begin - Metal IR Converter
find_package(MetalIRConverter)
if (METAL_IRCONVERTER_FOUND)
if (MetalIRConverter_FOUND)
set(ENABLE_METAL_CODEGEN On)
message(STATUS "Enabling Metal Support")
add_definitions(-DENABLE_METAL_CODEGEN)
Expand Down
14 changes: 7 additions & 7 deletions cmake/modules/FindMetalIRConverter.cmake
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
find_path(METAL_IRCONVERTER_INCLUDE_DIR metal_irconverter.h
find_path(MetalIRConverter_INCLUDE_DIR metal_irconverter.h
HINTS /usr/local/include/metal_irconverter
DOC "Path to metal IR converter headers"
)

find_library(METAL_IRCONVERTER_LIB NAMES metalirconverter
find_library(MetalIRConverter_LIB NAMES metalirconverter
PATH_SUFFIXES lib
)

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(METAL_IRCONVERTER
REQUIRED_VARS METAL_IRCONVERTER_LIB METAL_IRCONVERTER_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MetalIRConverter
REQUIRED_VARS MetalIRConverter_LIB MetalIRConverter_INCLUDE_DIR)

message(STATUS "Metal IR Converter Include Dir: ${METAL_IRCONVERTER_INCLUDE_DIR}")
message(STATUS "Metal IR Converter Library: ${METAL_IRCONVERTER_LIB}")
mark_as_advanced(METAL_IRCONVERTER_LIB METAL_IRCONVERTER_INCLUDE_DIR)
message(STATUS "Metal IR Converter Include Dir: ${MetalIRConverter_INCLUDE_DIR}")
message(STATUS "Metal IR Converter Library: ${MetalIRConverter_LIB}")
mark_as_advanced(MetalIRConverter_LIB MetalIRConverter_INCLUDE_DIR)
6 changes: 4 additions & 2 deletions cmake/modules/HCT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ function(add_hlsl_hctgen mode)
${opcodes_json})

get_filename_component(output_extension ${full_output} LAST_EXT)
string(SUBSTRING ${output_extension} 1 -1 output_extension_no_dot)
set(target_name "${mode}_${output_extension_no_dot}")

if (CLANG_FORMAT_EXE AND output_extension MATCHES "\.h|\.cpp|\.inl")
set(format_cmd COMMAND ${CLANG_FORMAT_EXE} -i ${temp_output})
Expand Down Expand Up @@ -132,8 +134,8 @@ function(add_hlsl_hctgen mode)
DEPENDS ${output}
COMMENT "Verifying clang-format results...")

add_custom_target(${mode}
add_custom_target(${target_name}
DEPENDS ${temp_output}.stamp)

add_dependencies(HCTGen ${mode})
add_dependencies(HCTGen ${target_name})
endfunction()
594 changes: 292 additions & 302 deletions docs/DXIL.rst

Large diffs are not rendered by default.

13 changes: 9 additions & 4 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ line upon naming the release. Refer to previous for appropriate section names.

#### Experimental Shader Model 6.10

- Moved Linear Algebra (Cooperative Vector) DXIL Opcodes to experimental Shader Model 6.10
- The Cooperative Vectors API was moved to `coopvec.h` header and under the `dx::coopvec` namespace.
- Removed experimental Cooperative Vector, this has been replaced by LinAlg matrix.
- Implement GetGroupWaveIndex and GetGroupWaveCount in experimental Shader Model 6.10.
- [proposal](https://github.com/microsoft/hlsl-specs/blob/main/proposals/0048-group-wave-index.md)
- GetGroupWaveIndex: New intrinsic for Compute, Mesh, Amplification and Node shaders which returns the index of the wave within the thread group that the the thread is executing.
Expand All @@ -39,10 +38,16 @@ line upon naming the release. Refer to previous for appropriate section names.

#### Bug Fixes

- Fixed non-deterministic DXIL/PDB output when compiling shaders with resource arrays, debug info, and SM 6.6+. [#8171](https://github.com/microsoft/DirectXShaderCompiler/issues/8171)
- Fixed non-deterministic DXIL/PDB output when compiling shaders with resource
arrays, debug info, and SM 6.6+.
[#8171](https://github.com/microsoft/DirectXShaderCompiler/issues/8171)
- Fixed mesh shader semantics that were incorrectly case sensitive.
- User-defined conversion operators (e.g., `operator float4()`) now produce an
error instead of being silently ignored.
[#5103](https://github.com/microsoft/DirectXShaderCompiler/pull/8206)
- DXIL validation: added validation for `CreateHandleFromBinding`.
- DXIL validation now rejects non-standard integer bit widths (e.g. `i25`) in instructions.
- DXIL validation now rejects non-standard integer bit widths (e.g. `i25`) in
instructions.

#### Other Changes

Expand Down
78 changes: 21 additions & 57 deletions include/dxc/DXIL/DxilConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,13 @@ enum class MatrixScope : uint32_t {
ThreadGroup = 2,
};

enum class LinalgMatrixLayout : uint32_t {
RowMajor = 0,
ColumnMajor = 1,
MulOptimal = 2,
OuterProductOptimal = 3,
};

// Must match D3D_INTERPOLATION_MODE
enum class InterpolationMode : uint8_t {
Undefined = 0,
Expand Down Expand Up @@ -524,9 +531,9 @@ static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps;
// Enumeration for ExperimentalOps DXIL operations
enum class OpCode : unsigned {
//
ReservedD1 = 30, // reserved
ReservedD2 = 31, // reserved
ReservedD3 = 32, // reserved
ReservedE1 = 30, // reserved
ReservedE2 = 31, // reserved
ReservedE3 = 32, // reserved

// Debugging
DebugBreak = 33, // triggers a breakpoint if a debugger is attached
Expand Down Expand Up @@ -647,6 +654,10 @@ enum class OpCode : unsigned {
ReservedC7 = 300, // reserved
ReservedC8 = 301, // reserved
ReservedC9 = 302, // reserved
ReservedD0 = 305, // reserved
ReservedD1 = 306, // reserved
ReservedD2 = 307, // reserved
ReservedD3 = 308, // reserved

// Amplification shader instructions
DispatchMesh = 173, // Amplification shader intrinsic DispatchMesh
Expand Down Expand Up @@ -876,19 +887,6 @@ enum class OpCode : unsigned {
CreateHandleForLib =
160, // create resource handle from resource struct for library

// Linear Algebra Operations
MatVecMul =
305, // Multiplies a MxK dimension matrix and a K sized input vector
MatVecMulAdd = 306, // multiplies a MxK dimension matrix and a K sized input
// vector and adds an M-sized bias vector
OuterProductAccumulate =
307, // Computes the outer product between column vectors and an MxN
// matrix is accumulated component-wise atomically (with device
// scope) in memory
VectorAccumulate = 308, // Accumulates the components of a vector
// component-wise atomically (with device scope) to
// the corresponding elements of an array in memory

// Mesh shader instructions
EmitIndices = 169, // emit a primitive's vertex indices in a mesh shader
GetMeshPayload =
Expand Down Expand Up @@ -1351,12 +1349,12 @@ enum class OpCode : unsigned {
ExperimentalOps,
LinAlgMatrixOuterProduct), // Outer products an M sized vector and a N
// sized vector producing an MxN matrix
// ReservedD1 = 0x8000001E, 2147483678U, -2147483618
EXP_OPCODE(ExperimentalOps, ReservedD1), // reserved
// ReservedD2 = 0x8000001F, 2147483679U, -2147483617
EXP_OPCODE(ExperimentalOps, ReservedD2), // reserved
// ReservedD3 = 0x80000020, 2147483680U, -2147483616
EXP_OPCODE(ExperimentalOps, ReservedD3), // reserved
// ReservedE1 = 0x8000001E, 2147483678U, -2147483618
EXP_OPCODE(ExperimentalOps, ReservedE1), // reserved
// ReservedE2 = 0x8000001F, 2147483679U, -2147483617
EXP_OPCODE(ExperimentalOps, ReservedE2), // reserved
// ReservedE3 = 0x80000020, 2147483680U, -2147483616
EXP_OPCODE(ExperimentalOps, ReservedE3), // reserved
// DebugBreak = 0x80000021, 2147483681U, -2147483615
EXP_OPCODE(ExperimentalOps,
DebugBreak), // triggers a breakpoint if a debugger is attached
Expand Down Expand Up @@ -1541,10 +1539,6 @@ enum class OpCodeClass : unsigned {
LinAlgMatrixSetElement,
LinAlgMatrixStoreToDescriptor,
LinAlgMatrixStoreToMemory,
MatVecMul,
MatVecMulAdd,
OuterProductAccumulate,
VectorAccumulate,

// Mesh shader instructions
EmitIndices,
Expand Down Expand Up @@ -1731,7 +1725,7 @@ enum class OpCodeClass : unsigned {
NodeOutputIsValid,
OutputComplete,

NumOpClasses = 225, // exclusive last value of enumeration
NumOpClasses = 221, // exclusive last value of enumeration
};
// OPCODECLASS-ENUM:END

Expand Down Expand Up @@ -1911,29 +1905,6 @@ const unsigned kHitObjectTraceRay_RayDescOpIdx = 7;
const unsigned kHitObjectTraceRay_PayloadOpIdx = 15;
const unsigned kHitObjectTraceRay_NumOp = 16;

// MatVec Ops
const unsigned kMatVecMulInputVectorIdx = 1;
const unsigned kMatVecMulIsInputUnsignedIdx = 2;
const unsigned kMatVecMulInputInterpretationIdx = 3;
const unsigned kMatVecMulMatrixBufferIdx = 4;
const unsigned kMatVecMulMatrixOffsetIdx = 5;
const unsigned kMatVecMulMatrixInterpretationIdx = 6;
const unsigned kMatVecMulMatrixMIdx = 7;
const unsigned kMatVecMulMatrixKIdx = 8;
const unsigned kMatVecMulMatrixLayoutIdx = 9;
const unsigned kMatVecMulMatrixTransposeIdx = 10;
const unsigned kMatVecMulMatrixStrideIdx = 11;
const unsigned kMatVecMulIsOutputUnsignedIdx = 12;

// MatVecAdd
const unsigned kMatVecMulAddBiasInterpretation = 14;
const unsigned kMatVecMulAddIsOutputUnsignedIdx = 15;

// Outer Product Accumulate
const unsigned kOuterProdAccMatrixInterpretation = 5;
const unsigned kOuterProdAccMatrixLayout = 6;
const unsigned kOuterProdAccMatrixStride = 7;

// TODO: add operand index for all the OpCodeClass.
} // namespace OperandIndex

Expand Down Expand Up @@ -2506,13 +2477,6 @@ extern const char *kHostLayoutTypePrefix;

extern const char *kWaveOpsIncludeHelperLanesString;

enum class LinalgMatrixLayout : uint32_t {
RowMajor = 0,
ColumnMajor = 1,
MulOptimal = 2,
OuterProductOptimal = 3,
};

} // namespace DXIL

} // namespace hlsl
Loading
Loading