Skip to content

Commit 9298954

Browse files
authored
Merge branch 'main' into texture1d
2 parents 6b7fab5 + 0f17d5a commit 9298954

141 files changed

Lines changed: 1715 additions & 7492 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmake/config-ix.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ string(REPLACE " " ";" LLVM_BINDINGS_LIST "${LLVM_BINDINGS}")
573573

574574
# HLSL Change Begin - Metal IR Converter
575575
find_package(MetalIRConverter)
576-
if (METAL_IRCONVERTER_FOUND)
576+
if (MetalIRConverter_FOUND)
577577
set(ENABLE_METAL_CODEGEN On)
578578
message(STATUS "Enabling Metal Support")
579579
add_definitions(-DENABLE_METAL_CODEGEN)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
find_path(METAL_IRCONVERTER_INCLUDE_DIR metal_irconverter.h
1+
find_path(MetalIRConverter_INCLUDE_DIR metal_irconverter.h
22
HINTS /usr/local/include/metal_irconverter
33
DOC "Path to metal IR converter headers"
44
)
55

6-
find_library(METAL_IRCONVERTER_LIB NAMES metalirconverter
6+
find_library(MetalIRConverter_LIB NAMES metalirconverter
77
PATH_SUFFIXES lib
88
)
99

1010
include(FindPackageHandleStandardArgs)
11-
FIND_PACKAGE_HANDLE_STANDARD_ARGS(METAL_IRCONVERTER
12-
REQUIRED_VARS METAL_IRCONVERTER_LIB METAL_IRCONVERTER_INCLUDE_DIR)
11+
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MetalIRConverter
12+
REQUIRED_VARS MetalIRConverter_LIB MetalIRConverter_INCLUDE_DIR)
1313

14-
message(STATUS "Metal IR Converter Include Dir: ${METAL_IRCONVERTER_INCLUDE_DIR}")
15-
message(STATUS "Metal IR Converter Library: ${METAL_IRCONVERTER_LIB}")
16-
mark_as_advanced(METAL_IRCONVERTER_LIB METAL_IRCONVERTER_INCLUDE_DIR)
14+
message(STATUS "Metal IR Converter Include Dir: ${MetalIRConverter_INCLUDE_DIR}")
15+
message(STATUS "Metal IR Converter Library: ${MetalIRConverter_LIB}")
16+
mark_as_advanced(MetalIRConverter_LIB MetalIRConverter_INCLUDE_DIR)

cmake/modules/HCT.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ function(add_hlsl_hctgen mode)
6767
${opcodes_json})
6868

6969
get_filename_component(output_extension ${full_output} LAST_EXT)
70+
string(SUBSTRING ${output_extension} 1 -1 output_extension_no_dot)
71+
set(target_name "${mode}_${output_extension_no_dot}")
7072

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

135-
add_custom_target(${mode}
137+
add_custom_target(${target_name}
136138
DEPENDS ${temp_output}.stamp)
137139

138-
add_dependencies(HCTGen ${mode})
140+
add_dependencies(HCTGen ${target_name})
139141
endfunction()

docs/DXIL.rst

Lines changed: 292 additions & 302 deletions
Large diffs are not rendered by default.

docs/ReleaseNotes.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ line upon naming the release. Refer to previous for appropriate section names.
2424

2525
#### Experimental Shader Model 6.10
2626

27-
- Moved Linear Algebra (Cooperative Vector) DXIL Opcodes to experimental Shader Model 6.10
28-
- The Cooperative Vectors API was moved to `coopvec.h` header and under the `dx::coopvec` namespace.
27+
- Removed experimental Cooperative Vector, this has been replaced by LinAlg matrix.
2928
- Implement GetGroupWaveIndex and GetGroupWaveCount in experimental Shader Model 6.10.
3029
- [proposal](https://github.com/microsoft/hlsl-specs/blob/main/proposals/0048-group-wave-index.md)
3130
- 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.

include/dxc/DXIL/DxilConstants.h

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ enum class MatrixScope : uint32_t {
204204
ThreadGroup = 2,
205205
};
206206

207+
enum class LinalgMatrixLayout : uint32_t {
208+
RowMajor = 0,
209+
ColumnMajor = 1,
210+
MulOptimal = 2,
211+
OuterProductOptimal = 3,
212+
};
213+
207214
// Must match D3D_INTERPOLATION_MODE
208215
enum class InterpolationMode : uint8_t {
209216
Undefined = 0,
@@ -524,9 +531,8 @@ static const OpCodeTableID TableID = OpCodeTableID::ExperimentalOps;
524531
// Enumeration for ExperimentalOps DXIL operations
525532
enum class OpCode : unsigned {
526533
//
527-
ReservedD1 = 30, // reserved
528-
ReservedD2 = 31, // reserved
529-
ReservedD3 = 32, // reserved
534+
ReservedE0 = 31, // reserved
535+
ReservedE1 = 32, // reserved
530536

531537
// Debugging
532538
DebugBreak = 33, // triggers a breakpoint if a debugger is attached
@@ -545,6 +551,8 @@ enum class OpCode : unsigned {
545551
9, // returns committed triangle vertices in object space as <9 x float>
546552

547553
// Linear Algebra Operations
554+
LinAlgConvert =
555+
30, // Convert vector components from one interpretation to another
548556
LinAlgCopyConvertMatrix =
549557
13, // Converts and copies the element and use type of the source matrix
550558
// to the destination matrix with optional transpose
@@ -647,6 +655,10 @@ enum class OpCode : unsigned {
647655
ReservedC7 = 300, // reserved
648656
ReservedC8 = 301, // reserved
649657
ReservedC9 = 302, // reserved
658+
ReservedD0 = 305, // reserved
659+
ReservedD1 = 306, // reserved
660+
ReservedD2 = 307, // reserved
661+
ReservedD3 = 308, // reserved
650662

651663
// Amplification shader instructions
652664
DispatchMesh = 173, // Amplification shader intrinsic DispatchMesh
@@ -876,19 +888,6 @@ enum class OpCode : unsigned {
876888
CreateHandleForLib =
877889
160, // create resource handle from resource struct for library
878890

879-
// Linear Algebra Operations
880-
MatVecMul =
881-
305, // Multiplies a MxK dimension matrix and a K sized input vector
882-
MatVecMulAdd = 306, // multiplies a MxK dimension matrix and a K sized input
883-
// vector and adds an M-sized bias vector
884-
OuterProductAccumulate =
885-
307, // Computes the outer product between column vectors and an MxN
886-
// matrix is accumulated component-wise atomically (with device
887-
// scope) in memory
888-
VectorAccumulate = 308, // Accumulates the components of a vector
889-
// component-wise atomically (with device scope) to
890-
// the corresponding elements of an array in memory
891-
892891
// Mesh shader instructions
893892
EmitIndices = 169, // emit a primitive's vertex indices in a mesh shader
894893
GetMeshPayload =
@@ -1351,12 +1350,13 @@ enum class OpCode : unsigned {
13511350
ExperimentalOps,
13521351
LinAlgMatrixOuterProduct), // Outer products an M sized vector and a N
13531352
// sized vector producing an MxN matrix
1354-
// ReservedD1 = 0x8000001E, 2147483678U, -2147483618
1355-
EXP_OPCODE(ExperimentalOps, ReservedD1), // reserved
1356-
// ReservedD2 = 0x8000001F, 2147483679U, -2147483617
1357-
EXP_OPCODE(ExperimentalOps, ReservedD2), // reserved
1358-
// ReservedD3 = 0x80000020, 2147483680U, -2147483616
1359-
EXP_OPCODE(ExperimentalOps, ReservedD3), // reserved
1353+
// LinAlgConvert = 0x8000001E, 2147483678U, -2147483618
1354+
EXP_OPCODE(ExperimentalOps, LinAlgConvert), // Convert vector components from
1355+
// one interpretation to another
1356+
// ReservedE0 = 0x8000001F, 2147483679U, -2147483617
1357+
EXP_OPCODE(ExperimentalOps, ReservedE0), // reserved
1358+
// ReservedE1 = 0x80000020, 2147483680U, -2147483616
1359+
EXP_OPCODE(ExperimentalOps, ReservedE1), // reserved
13601360
// DebugBreak = 0x80000021, 2147483681U, -2147483615
13611361
EXP_OPCODE(ExperimentalOps,
13621362
DebugBreak), // triggers a breakpoint if a debugger is attached
@@ -1522,6 +1522,7 @@ enum class OpCodeClass : unsigned {
15221522
CreateHandleForLib,
15231523

15241524
// Linear Algebra Operations
1525+
LinAlgConvert,
15251526
LinAlgCopyConvertMatrix,
15261527
LinAlgFillMatrix,
15271528
LinAlgMatVecMul,
@@ -1541,10 +1542,6 @@ enum class OpCodeClass : unsigned {
15411542
LinAlgMatrixSetElement,
15421543
LinAlgMatrixStoreToDescriptor,
15431544
LinAlgMatrixStoreToMemory,
1544-
MatVecMul,
1545-
MatVecMulAdd,
1546-
OuterProductAccumulate,
1547-
VectorAccumulate,
15481545

15491546
// Mesh shader instructions
15501547
EmitIndices,
@@ -1731,7 +1728,7 @@ enum class OpCodeClass : unsigned {
17311728
NodeOutputIsValid,
17321729
OutputComplete,
17331730

1734-
NumOpClasses = 225, // exclusive last value of enumeration
1731+
NumOpClasses = 222, // exclusive last value of enumeration
17351732
};
17361733
// OPCODECLASS-ENUM:END
17371734

@@ -1911,29 +1908,6 @@ const unsigned kHitObjectTraceRay_RayDescOpIdx = 7;
19111908
const unsigned kHitObjectTraceRay_PayloadOpIdx = 15;
19121909
const unsigned kHitObjectTraceRay_NumOp = 16;
19131910

1914-
// MatVec Ops
1915-
const unsigned kMatVecMulInputVectorIdx = 1;
1916-
const unsigned kMatVecMulIsInputUnsignedIdx = 2;
1917-
const unsigned kMatVecMulInputInterpretationIdx = 3;
1918-
const unsigned kMatVecMulMatrixBufferIdx = 4;
1919-
const unsigned kMatVecMulMatrixOffsetIdx = 5;
1920-
const unsigned kMatVecMulMatrixInterpretationIdx = 6;
1921-
const unsigned kMatVecMulMatrixMIdx = 7;
1922-
const unsigned kMatVecMulMatrixKIdx = 8;
1923-
const unsigned kMatVecMulMatrixLayoutIdx = 9;
1924-
const unsigned kMatVecMulMatrixTransposeIdx = 10;
1925-
const unsigned kMatVecMulMatrixStrideIdx = 11;
1926-
const unsigned kMatVecMulIsOutputUnsignedIdx = 12;
1927-
1928-
// MatVecAdd
1929-
const unsigned kMatVecMulAddBiasInterpretation = 14;
1930-
const unsigned kMatVecMulAddIsOutputUnsignedIdx = 15;
1931-
1932-
// Outer Product Accumulate
1933-
const unsigned kOuterProdAccMatrixInterpretation = 5;
1934-
const unsigned kOuterProdAccMatrixLayout = 6;
1935-
const unsigned kOuterProdAccMatrixStride = 7;
1936-
19371911
// TODO: add operand index for all the OpCodeClass.
19381912
} // namespace OperandIndex
19391913

@@ -2506,13 +2480,6 @@ extern const char *kHostLayoutTypePrefix;
25062480

25072481
extern const char *kWaveOpsIncludeHelperLanesString;
25082482

2509-
enum class LinalgMatrixLayout : uint32_t {
2510-
RowMajor = 0,
2511-
ColumnMajor = 1,
2512-
MulOptimal = 2,
2513-
OuterProductOptimal = 3,
2514-
};
2515-
25162483
} // namespace DXIL
25172484

25182485
} // namespace hlsl

0 commit comments

Comments
 (0)