Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ line upon naming the release. Refer to previous for appropriate section names.
- SPIR-V: Fixed an invalid `OpSelect` being generated when optimizing for
SPIR-V 1.3 and earlier
[#8603](https://github.com/microsoft/DirectXShaderCompiler/issues/8603).
- SPIR-V: Fixed user-defined types whose names match built-in resource types
being incorrectly lowered as resources.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a note stating that 16-bit sampled types on vk::SampledTexture* are now rejected, as VUID-StandaloneSpirv-OpTypeImage-04656 requires?


#### HLSL Language

Expand Down
8 changes: 8 additions & 0 deletions tools/clang/include/clang/AST/HlslTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ bool IsHLSLRayQueryType(clang::QualType type);
bool GetHLSLNodeIORecordType(const clang::ParmVarDecl *parmDecl,
NodeFlags &nodeKind);

/// Returns the DXIL ResourceKind for this type, or ResourceKind::Invalid if
/// not an HLSL resource type.
DXIL::ResourceKind GetHLSLResourceKind(clang::QualType type);

/// Returns the DXIL ResourceClass for this type, or ResourceClass::Invalid if
/// not an HLSL resource type.
DXIL::ResourceClass GetHLSLResourceClass(clang::QualType type);

bool IsArrayConstantStringType(const clang::QualType type);
bool IsPointerStringType(const clang::QualType type);
bool IsStringType(const clang::QualType type);
Expand Down
10 changes: 10 additions & 0 deletions tools/clang/include/clang/Basic/Attr.td
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,16 @@ def HLSLHitObject : InheritableAttr {
let Documentation = [Undocumented];
}

// Vulkan SubpassInput / SubpassInputMS Attribute
// Marks the built-in SubpassInput<T> and SubpassInputMS<T,S> record types as
// distinct from any user-defined type with the same unqualified name.
def HLSLVkSubpassInput : InheritableAttr {
let Spellings = []; // No spellings!
let Args = [BoolArgument<"IsMultiSampled">];
let Subjects = SubjectList<[CXXRecord]>;
let Documentation = [Undocumented];
}

// HLSL Dynamic Resource Attribute
// Marks the builtin `.Resource` / `.Sampler` placeholder record types used
// for descriptor heap indexing (ResourceDescriptorHeap[i] /
Expand Down
12 changes: 12 additions & 0 deletions tools/clang/lib/AST/HlslTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,18 @@ bool IsHLSLStructuredBufferType(clang::QualType type) {
return false;
}

DXIL::ResourceKind GetHLSLResourceKind(clang::QualType type) {
if (const HLSLResourceAttr *Attr = getAttr<HLSLResourceAttr>(type))
return Attr->getResKind();
return DXIL::ResourceKind::Invalid;
Comment on lines +618 to +621
}

DXIL::ResourceClass GetHLSLResourceClass(clang::QualType type) {
if (const HLSLResourceAttr *Attr = getAttr<HLSLResourceAttr>(type))
return Attr->getResClass();
return DXIL::ResourceClass::Invalid;
}

bool IsHLSLSubobjectType(clang::QualType type) {
DXIL::SubobjectKind kind;
DXIL::HitGroupType hgType;
Expand Down
Loading
Loading