Skip to content

Pull upstream #9

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

Merged
merged 93 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
b93f6a4
Moved HANDLE management to Test Class Constructor and Destructor (#7357)
alecardoso-tech Apr 18, 2025
b4a3076
Revert ADO pipelines to Ubuntu 22.04 temporarily (#7365)
llvm-beanz Apr 21, 2025
8988e47
[SER] Diagnose payload in HitObject::TraceRay|Invoke (#7356)
simoll Apr 22, 2025
f19b5da
[SER] TraceRay|Invoke HLSL -> DXIL lowering (#7355)
simoll Apr 22, 2025
ea95489
[SPIRV] Update submodules (#7369)
s-perron Apr 23, 2025
06381f2
[SPIRV] Update submodules (#7373)
s-perron Apr 23, 2025
bddee27
[SER] HitObject accessors HLSL -> DXIL lowering (#7360)
simoll Apr 23, 2025
847d5ad
[SER] HitObject::GetAttributes HLSL -> DXIL lowering and attributes s…
simoll Apr 23, 2025
624665f
[SER] HitObject::FromRayQuery HLSL -> DXIL lowering (#7370)
simoll Apr 24, 2025
0f7af1b
[SER] Validate HitObject accessors (#7371)
simoll Apr 25, 2025
b4d773f
[SER] Validate MakeMiss (#7372)
simoll Apr 25, 2025
8209d53
Fix static member call instantiation (#7377)
simoll Apr 25, 2025
34b6d0f
Implementation of the CoopVec Inference and Training builtin intrinis…
tex3d Apr 28, 2025
e866b4b
[SPIRV] Refactor OpExecutionModeId (#7378)
s-perron Apr 29, 2025
7522097
[CoopVec] Add Linear Algebra common header with tests (#7350) (#7388)
bob80905 Apr 29, 2025
3bf6305
[SER] Validate %dx.types.HitObject as legal type same as handle (#7390)
simoll Apr 29, 2025
0fd79eb
Change default validation behavior (#7392)
bob80905 Apr 29, 2025
4d7c704
Update version to 1.8.2505 (#7398)
bob80905 Apr 30, 2025
b98c00f
Add upcoming release (#7399)
bob80905 Apr 30, 2025
6d67e4a
Move spirv file to appropriate dir with lit config settings (#7406)
bob80905 Apr 30, 2025
1a75a30
Don't pass through to DXIL.dll in DxcCreateInstance for CLSID_DxcVali…
tex3d May 1, 2025
11e2895
Add DXIL REQUIRES to certain tests that require a minimum validation …
bob80905 May 1, 2025
a4f8cf9
[SER] Validate HitObject_FromRayQuery[WithAttrs] (#7402)
simoll May 2, 2025
9536291
[SER] Validate HitObject::TraceRay|Invoke (#7384)
simoll May 2, 2025
1198c30
[SPIRV] Fix constant value in function (#7415)
GinShio May 3, 2025
6f17379
[SER] REORDER_SCOPE check-fail validation tests (#7428)
simoll May 6, 2025
556fc5b
[Internal] Remove dead fallthrough statement (#7433)
bob80905 May 7, 2025
8df7449
Pull format checking tools from `main` (#7403)
llvm-beanz May 7, 2025
231d648
[SM6.9] Disable native vec deriv ops and expand testing (#7432)
May 7, 2025
422604b
[HLSL Options] Remove select-validator option (#7423)
bob80905 May 8, 2025
474f9d2
[SER] Validate 'reordercoherent' resource property (#7429)
simoll May 9, 2025
377c4ca
Fix the return types of `dot4add_i8packed` and `dot4add_u8packed`. (#…
jimblandy May 12, 2025
fb4d7d1
[0029] [Main] For OuterProductAccumulate, matrix layout must be outer…
anupamachandra May 13, 2025
f5214f1
Support SV_DispatchGrid semantic in a nested record (#6931)
tcorringham May 14, 2025
8b406b5
Fix detection of builtin UDT DXR struct types (#7452)
tex3d May 15, 2025
9b04d69
[SPIRV] Cast derivative opts to 32-bits. (#7445)
s-perron May 15, 2025
14e1f83
[SPIRV] Allow decoration attributes on fields. (#7453)
s-perron May 15, 2025
2a6bacd
[SPIRV] Treat vk::Spirv*Type as opaque when reconstructing (#7454)
s-perron May 15, 2025
2421964
[SPIRV] Add warning for initialized globals (#7448)
s-perron May 15, 2025
7054e52
[SEMA] Don't emit an error for sizeof an enum. (#7449)
s-perron May 16, 2025
fef2f94
Fix -fvk-invert-y (#7447)
Nielsbishere May 16, 2025
053e7ac
Refactor udt intrinsic arg copy to before SROA, flatten RayDesc (#7440)
tex3d May 16, 2025
f9c2d5d
[SER] Diagnose HitObject in unsupported declaration contexts (#7376)
simoll May 16, 2025
adffd31
Implement HLSL Diagnostics for LinAlg operations (#7430)
anupamachandra May 16, 2025
d72e2b1
Removes improper modification copyright notice. (#7477)
danbrown-amd May 22, 2025
d14d174
Update Release notes for 1.8.2505 (#7481) (#7483)
tex3d May 27, 2025
66287b2
Update submodules (#7492)
s-perron May 28, 2025
dc59ed0
[SPIR-V] Fix r-value being used in mul intrinsic (#7489)
Keenuts May 30, 2025
d8ef89c
[SPIR-V] Add payload to OpEmitMeshTasksEXT (#7485)
Keenuts May 30, 2025
194b57a
Fix markdown in SPIR-V.rst (#7112)
Vovan675 May 30, 2025
20f291e
Add LoongArch 64 bit (#7020)
wszqkzqk May 30, 2025
0855509
[SPIR-V] Fix bool cast on buffers with swizzle (#7497)
Keenuts Jun 2, 2025
72149fa
Eliminates layout mismatch when vk::BufferPointer::Get() result retur…
danbrown-amd Jun 2, 2025
48d6e3c
[SPIRV] Get alignemnt from pointee type for vk::BufferPoitner store (…
s-perron Jun 2, 2025
8a8b29f
[spirv] AMD work graphs extension (#7353)
danbrown-amd Jun 3, 2025
296d4ae
NFC: Add LSAN leak suppression to ASAN pipeline (#7503)
tex3d Jun 4, 2025
77dcbb6
Require complete types in some missing places (#7511)
llvm-beanz Jun 5, 2025
77b2ff6
NFC: remove dead external validation code paths from dxcompiler (#7451)
bob80905 Jun 5, 2025
50f53c6
NFC: Update indentation in latest-release.json for clang-format (#7515)
tex3d Jun 5, 2025
2084643
[spirv] Corrects output node index parameter. (#7517)
danbrown-amd Jun 6, 2025
9b5f5c9
[SPIRV] Use OpCopyLogical to reconstruct values (#7530)
s-perron Jun 12, 2025
57177f7
[SPIRV] Use unknown image format in vk1.3 and later (#7528)
s-perron Jun 13, 2025
f94396d
Long Vector Execution tests preliminary work to merge a minor refacto…
alsepkow Jun 16, 2025
8a77b0c
PIX shader debugger: Support dynamic indices for local arrays (#7536)
jeffnn Jun 18, 2025
978a6d3
[SPIRV] Emit DebugScope in wrapper (#7341) (#7529)
SteveUrquhart Jun 18, 2025
d43d909
Bump requests from 2.32.0 to 2.32.4 in /utils/git (#7524)
dependabot[bot] Jun 18, 2025
5aec1ec
[NFC] Address compiler warnings: C4146 - Cases where we can swap to u…
alsepkow Jun 19, 2025
b78ac50
Add missing diagnostic argument (#7426)
tcorringham Jun 20, 2025
b4baabb
[NFC] Address compiler warnings: Fix C4146 compiler warnings in APInt…
alsepkow Jun 20, 2025
d1d0a31
[NFC] Address compiler warnings: C4146 - Trivial std::numeric_limits<…
alsepkow Jun 21, 2025
dd725c2
Revert "[SPIRV] Use unknown image format in vk1.3 and later" (#7572)
s-perron Jun 24, 2025
8f55958
[SPIR-V] Prepase SDK v2025.3 release (#7579)
Keenuts Jun 24, 2025
3e01e8b
[NFC] Address compiler warnings: C4146 - Another round of use two's c…
alsepkow Jun 25, 2025
23118b9
[NFC] Address compiler warnings: C4146 - A 'grab bag' of remaining in…
alsepkow Jun 25, 2025
b390fb1
[NFC] Address compiler warnings: C4146 - Use two's complement instead…
alsepkow Jun 25, 2025
e07be1c
Fix errors in retrieving and assigning load status parameter (#7513)
Jun 25, 2025
93c7c2c
Update Release Notes (#7563)
V-FEXrt Jun 26, 2025
8a9f882
Bump urllib3 from 2.2.2 to 2.5.0 in /utils/git (#7554)
dependabot[bot] Jun 26, 2025
94abfe9
Address compiler warnings: Enable warning C4146 as a break. (#7587)
alsepkow Jun 26, 2025
a9d33d3
[NFC] Clear C33010 Warning (#7603)
V-FEXrt Jul 1, 2025
7e0d771
PIX: Report correct bitfield values in PIX shader debugger (#7557)
jeffnn Jul 1, 2025
2da0a54
Long Vector Execution Tests: Merge unary and binary op tests to main …
alsepkow Jul 2, 2025
b331216
[SPIR-V] Explicitly state which layout rules require scalar block lay…
shawnhatori Jul 3, 2025
4fcf67f
[spirv] Fixes #7535 (vk::BufferPointer alignment issue). (#7571)
danbrown-amd Jul 3, 2025
d751c82
[SPIRV] Allow spirv type as template parameter (#7626)
GinShio Jul 7, 2025
a11702e
[SPIRV] Add the derivative group execution mode only on shader types …
s-perron Jul 8, 2025
4efa3dc
Merge HLSLHalf_t and HLSLBool_t (#7630)
alsepkow Jul 10, 2025
68dedee
[SPIRV] Add option to use the Unknown image format (#7632)
s-perron Jul 11, 2025
162bf4e
Fix intrinsic lookup with namespaces (#7599)
llvm-beanz Jul 17, 2025
020fbdf
[SPIR-V] Fixed a crash if encounter constant buffer fields with overl…
iOrange Jul 21, 2025
5ceaf84
[ExecutionTests] Fix shader source to prevent OOB access for Executio…
alsepkow Jul 22, 2025
c78ed99
[SER] GetAttributes(out udt) instead of templated return (#7606)
simoll Jul 22, 2025
d64d34c
Merge Long Vector Trigonometric Op Exec Tests (#7665)
alsepkow Jul 24, 2025
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
Prev Previous commit
Next Next commit
Fix detection of builtin UDT DXR struct types (microsoft#7452)
Built-in DXR struct types RayDesc and
BuiltInTriangleIntersectionAttributes were not treated identically to
other UDT types.

This caused differences in intrinsic codegen when one of these types is
returned.

This change corrects this difference so these builtin structs are
handled in the same way as other UDTs.

Fixes microsoft#7450.
  • Loading branch information
tex3d authored May 15, 2025
commit 8b406b5717ca17874bd6b2ce832a8802c6fb3979
1 change: 0 additions & 1 deletion tools/clang/include/clang/AST/HlslTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ DXIL::NodeIOKind GetNodeIOType(clang::QualType type);

bool IsHLSLStructuredBufferType(clang::QualType type);
bool IsHLSLNumericOrAggregateOfNumericType(clang::QualType type);
bool IsHLSLNumericUserDefinedType(clang::QualType type);
bool IsHLSLCopyableAnnotatableRecord(clang::QualType QT);
bool IsHLSLBuiltinRayAttributeStruct(clang::QualType QT);
bool IsHLSLAggregateType(clang::QualType type);
Expand Down
28 changes: 12 additions & 16 deletions tools/clang/lib/AST/HlslTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,31 +103,26 @@ bool IsHLSLNumericOrAggregateOfNumericType(clang::QualType type) {
BuiltinTy->getKind() != BuiltinType::Kind::Char_S;
}

bool IsHLSLNumericUserDefinedType(clang::QualType type) {
const clang::Type *Ty = type.getCanonicalType().getTypePtr();
// In some cases we need record types that are annotatable and trivially
// copyable from outside the shader. This excludes resource types which may be
// trivially copyable inside the shader, and builtin matrix and vector types
// which can't be annotated. But includes UDTs of trivially copyable data and
// the builtin trivially copyable raytracing structs.
bool IsHLSLCopyableAnnotatableRecord(clang::QualType QT) {
const clang::Type *Ty = QT.getCanonicalType().getTypePtr();
if (const RecordType *RT = dyn_cast<RecordType>(Ty)) {
const RecordDecl *RD = RT->getDecl();
if (!IsUserDefinedRecordType(type))
if (!IsUserDefinedRecordType(QT))
return false;
for (auto member : RD->fields()) {
if (!IsHLSLNumericOrAggregateOfNumericType(member->getType()))
for (auto Member : RD->fields()) {
if (!IsHLSLNumericOrAggregateOfNumericType(Member->getType()))
return false;
}
return true;
}
return false;
}

// In some cases we need record types that are annotatable and trivially
// copyable from outside the shader. This excludes resource types which may be
// trivially copyable inside the shader, and builtin matrix and vector types
// which can't be annotated. But includes UDTs of trivially copyable data and
// the builtin trivially copyable raytracing structs.
bool IsHLSLCopyableAnnotatableRecord(clang::QualType QT) {
return IsHLSLNumericUserDefinedType(QT) ||
IsHLSLBuiltinRayAttributeStruct(QT);
}

bool IsHLSLBuiltinRayAttributeStruct(clang::QualType QT) {
QT = QT.getCanonicalType();
const clang::Type *Ty = QT.getTypePtr();
Expand Down Expand Up @@ -609,7 +604,8 @@ bool IsUserDefinedRecordType(clang::QualType QT) {
const clang::Type *Ty = QT.getCanonicalType().getTypePtr();
if (const RecordType *RT = dyn_cast<RecordType>(Ty)) {
const RecordDecl *RD = RT->getDecl();
if (RD->isImplicit())
// Built-in ray tracing struct types are considered user defined types.
if (RD->isImplicit() && !IsHLSLBuiltinRayAttributeStruct(QT))
return false;
if (auto TD = dyn_cast<ClassTemplateSpecializationDecl>(RD))
if (TD->getSpecializedTemplate()->isImplicit())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// RUN: %dxc /Tlib_6_9 %s | FileCheck %s
// RUN: %dxc /Tlib_6_9 -fcgl %s | FileCheck %s -check-prefix=FCGL

// Make sure that we can use the BuiltInTriangleIntersectionAttributes struct
// as a template argument to GetAttributes.

// For -fcgl, just check the form of the HL call.
// FCGL: %{{[^ ]+}} = call %struct.BuiltInTriangleIntersectionAttributes* @"dx.hl.op..%struct.BuiltInTriangleIntersectionAttributes* (i32, %dx.types.HitObject*)"(i32 364, %dx.types.HitObject* %{{[^ ]+}})

// CHECK: %[[ATTR:[^ ]+]] = alloca %struct.BuiltInTriangleIntersectionAttributes
// CHECK: call void @dx.op.hitObject_Attributes.struct.BuiltInTriangleIntersectionAttributes(i32 289, %dx.types.HitObject %{{[^ ]+}}, %struct.BuiltInTriangleIntersectionAttributes* nonnull %[[ATTR]])

RaytracingAccelerationStructure Scene : register(t0, space0);
RWTexture2D<float4> RenderTarget : register(u0);

struct [raypayload] RayPayload
{
float4 color : write(caller, closesthit, miss) : read(caller);
};

typedef BuiltInTriangleIntersectionAttributes MyAttribs;

[shader("raygeneration")]
void MyRaygenShader()
{
RayDesc ray;
ray.Origin = float3(0,0,0);
ray.Direction = float3(0, 0, 1);
ray.TMin = 0.001;
ray.TMax = 10000.0;

RayPayload payload = { float4(0, 0, 0, 0) };
float4 color = float4(1,1,1,1);

dx::HitObject hit = dx::HitObject::TraceRay(Scene, RAY_FLAG_NONE, ~0, 0, 1, 0, ray, payload);

MyAttribs attr = hit.GetAttributes<MyAttribs>();
payload.color += float4(attr,0,1);

// Write the raytraced color to the output texture.
RenderTarget[DispatchRaysIndex().xy] = payload.color;
}