Skip to content

[0035] LinAlg Matrix DXIL enum naming #730

@tex3d

Description

@tex3d

enum class DXILMatrixUse {

This spec defines DXIL enumerations: DXILMatrixUse, DXILMatrixScope, and DXILComponentType. There are a couple issues with this:

DXIL enumerations are already defined under a DXIL namespace, so adding DXIL to the name is redundant.

There already exists a DXIL::ComponentType, and it already contains the new types referenced in this enum, only with different enum values. This existing enum is already used in a number of places in DXIL and the runtime interface, and it was originally the intention to use the same enum for matrix component types, otherwise we will have a higher likelihood of bugs and confusion. The existing type to numeric mappings already shipped in prior versions of DXIL cannot be changed without breaking DXIL.

We should not introduce another almost-identical enum with conflicting values just for this feature.

See in DXC:
https://github.com/microsoft/DirectXShaderCompiler/blob/201a5b598caed7158c0ea2aadf1a6e1590afa218/include/dxc/DXIL/DxilConstants.h#L164-L193

enum class ComponentType : uint32_t {
  ...

See in llvm-project:
https://github.com/llvm/llvm-project/blob/66da12ae69757690dff48e4c43816c753797babd/llvm/include/llvm/Support/DXILABI.h#L59-L80

See llvm/llvm-project#167784 for tangent on the ElementType name used here.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions