Skip to content

Commit 695cc75

Browse files
committed
Fix Dxil validator compat and test issues (#3610)
(cherry picked from commit 2039610)
1 parent 1a92a22 commit 695cc75

16 files changed

Lines changed: 41 additions & 30 deletions

File tree

lib/DXIL/DxilShaderFlags.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
373373
M->GetValidatorVersion(valMajor, valMinor);
374374
bool hasMulticomponentUAVLoadsBackCompat = valMajor == 1 && valMinor == 0;
375375
bool hasViewportOrRTArrayIndexBackCombat = valMajor == 1 && valMinor < 4;
376+
bool hasBarycentricsBackCompat = valMajor == 1 && valMinor < 6;
376377

377378
Type *int16Ty = Type::getInt16Ty(F->getContext());
378379
Type *int64Ty = Type::getInt64Ty(F->getContext());
@@ -630,7 +631,7 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
630631
flag.SetViewID(hasViewID);
631632
flag.SetViewportAndRTArrayIndex(hasViewportOrRTArrayIndex);
632633
flag.SetShadingRate(hasShadingRate);
633-
flag.SetBarycentrics(hasBarycentrics);
634+
flag.SetBarycentrics(hasBarycentricsBackCompat ? false : hasBarycentrics);
634635
flag.SetSamplerFeedback(hasSamplerFeedback);
635636
flag.SetRaytracingTier1_1(hasRaytracingTier1_1);
636637
flag.SetAtomicInt64OnTypedResource(hasAtomicInt64OnTypedResource);

tools/clang/test/HLSLFileCheck/hlsl/intrinsics/helper/IsHelperLane.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
// RUN: %dxc -E cs -T cs_6_0 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
3333
// RUN: %dxc -E as -T as_6_5 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
3434
// RUN: %dxc -E ms -T ms_6_5 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
35-
// RUN: %dxc -T lib_6_5 %s | FileCheck %s -check-prefixes=CHECKLIBGV
35+
// RUN: %dxilver 1.6 | %dxc -T lib_6_5 %s | FileCheck %s -check-prefixes=CHECKLIBGV
3636

3737

3838
// Exactly one call
@@ -277,7 +277,7 @@ RWStructuredBuffer<float4> SB;
277277
void cs(uint gidx : SV_GroupIndex)
278278
{
279279
float4 result = a + IsHelperLane();
280-
SB[gidx] = QuadReadAcrossX(result);
280+
SB[gidx] = result;
281281
}
282282

283283
/// Amplification Shader

tools/clang/test/HLSLFileCheck/hlsl/intrinsics/pixel/attr/attributeAtVertex.hlsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 %s | FileCheck %s
1+
// RUN: %dxc -E main -T ps_6_1 %s | FileCheck %s
2+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 %s | FileCheck %s -check-prefixes=CHECK,CHK16
23

34

4-
// CHECK: Note: shader requires additional functionality:
5-
// CHECK-NEXT: Barycentrics
5+
// CHK16: Note: shader requires additional functionality:
6+
// CHK16-NEXT: Barycentrics
67

78
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 0, i32 0, i8 0, i8 0)
89
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 0, i32 0, i8 1, i8 0)

tools/clang/test/HLSLFileCheck/hlsl/intrinsics/pixel/attr/attributeAtVertexNoOpt.hlsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s
1+
// RUN: %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s
2+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s -check-prefixes=CHECK,CHK16
23

3-
// CHECK: Note: shader requires additional functionality:
4-
// CHECK-NEXT: Barycentrics
4+
// CHK16: Note: shader requires additional functionality:
5+
// CHK16-NEXT: Barycentrics
56

67
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 1, i32 0, i8 0, i8 0)
78
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 1, i32 0, i8 1, i8 0)

tools/clang/test/HLSLFileCheck/hlsl/lifetimes/lifetimes_lib_6_3.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -T lib_6_3 -enable-lifetime-markers %s | FileCheck %s
1+
// RUN: %dxilver 1.6 | %dxc -T lib_6_3 -enable-lifetime-markers %s | FileCheck %s
22

33
// This file is identical to lifetimes.hlsl except that it tests for
44
// undef stores instead of lifetime intrinsics (fallback for earlier

tools/clang/test/HLSLFileCheck/hlsl/objects/CbufferLegacy/cbufferSize1.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
1+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
22

33
// CHECK: error: CBuffer size is 65552 bytes, exceeding maximum of 65536 bytes.
44

tools/clang/test/HLSLFileCheck/hlsl/objects/CbufferLegacy/cbufferSize3.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
1+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
22

33
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.
44

tools/clang/test/HLSLFileCheck/hlsl/objects/CbufferLegacy/cbufferSize5.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
1+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
22

33
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.
44

tools/clang/test/HLSLFileCheck/hlsl/objects/CbufferLegacy/cbufferSize6.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
1+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
22

33
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.
44

tools/clang/test/HLSLFileCheck/hlsl/semantics/sv_barycentrics/barycentrics.hlsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 %s | FileCheck %s
1+
// RUN: %dxc -E main -T ps_6_1 %s | FileCheck %s
2+
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 %s | FileCheck %s -check-prefixes=CHECK,CHK16
23

3-
// CHECK: Note: shader requires additional functionality:
4-
// CHECK-NEXT: Barycentrics
4+
// CHK16: Note: shader requires additional functionality:
5+
// CHK16-NEXT: Barycentrics
56
// CHECK: !"SV_Barycentrics"
67

78
float4 main(float3 bary : SV_Barycentrics) : SV_Target

0 commit comments

Comments
 (0)