Fix Dxil validator compat and test issues (#3610)

This commit is contained in:
Tex Riddell 2021-03-21 15:00:53 -07:00 коммит произвёл GitHub
Родитель 86104f415f
Коммит 2039610190
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 41 добавлений и 30 удалений

Просмотреть файл

@ -373,6 +373,7 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
M->GetValidatorVersion(valMajor, valMinor);
bool hasMulticomponentUAVLoadsBackCompat = valMajor == 1 && valMinor == 0;
bool hasViewportOrRTArrayIndexBackCombat = valMajor == 1 && valMinor < 4;
bool hasBarycentricsBackCompat = valMajor == 1 && valMinor < 6;
Type *int16Ty = Type::getInt16Ty(F->getContext());
Type *int64Ty = Type::getInt64Ty(F->getContext());
@ -630,7 +631,7 @@ ShaderFlags ShaderFlags::CollectShaderFlags(const Function *F,
flag.SetViewID(hasViewID);
flag.SetViewportAndRTArrayIndex(hasViewportOrRTArrayIndex);
flag.SetShadingRate(hasShadingRate);
flag.SetBarycentrics(hasBarycentrics);
flag.SetBarycentrics(hasBarycentricsBackCompat ? false : hasBarycentrics);
flag.SetSamplerFeedback(hasSamplerFeedback);
flag.SetRaytracingTier1_1(hasRaytracingTier1_1);
flag.SetAtomicInt64OnTypedResource(hasAtomicInt64OnTypedResource);

Просмотреть файл

@ -32,7 +32,7 @@
// RUN: %dxc -E cs -T cs_6_0 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
// RUN: %dxc -E as -T as_6_5 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
// RUN: %dxc -E ms -T ms_6_5 -Od %s | FileCheck %s -check-prefixes=CHECKCONST
// RUN: %dxc -T lib_6_5 %s | FileCheck %s -check-prefixes=CHECKLIBGV
// RUN: %dxilver 1.6 | %dxc -T lib_6_5 %s | FileCheck %s -check-prefixes=CHECKLIBGV
// Exactly one call
@ -277,7 +277,7 @@ RWStructuredBuffer<float4> SB;
void cs(uint gidx : SV_GroupIndex)
{
float4 result = a + IsHelperLane();
SB[gidx] = QuadReadAcrossX(result);
SB[gidx] = result;
}
/// Amplification Shader

Просмотреть файл

@ -1,8 +1,9 @@
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 %s | FileCheck %s -check-prefixes=CHECK,CHK16
// CHECK: Note: shader requires additional functionality:
// CHECK-NEXT: Barycentrics
// CHK16: Note: shader requires additional functionality:
// CHK16-NEXT: Barycentrics
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 0, i32 0, i8 0, i8 0)
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 0, i32 0, i8 1, i8 0)

Просмотреть файл

@ -1,7 +1,8 @@
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s
// RUN: %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 -O0 %s | FileCheck %s -check-prefixes=CHECK,CHK16
// CHECK: Note: shader requires additional functionality:
// CHECK-NEXT: Barycentrics
// CHK16: Note: shader requires additional functionality:
// CHK16-NEXT: Barycentrics
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 1, i32 0, i8 0, i8 0)
// CHECK: call float @dx.op.attributeAtVertex.f32(i32 137, i32 1, i32 0, i8 1, i8 0)

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -T lib_6_3 -enable-lifetime-markers %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -T lib_6_3 -enable-lifetime-markers %s | FileCheck %s
// This file is identical to lifetimes.hlsl except that it tests for
// undef stores instead of lifetime intrinsics (fallback for earlier

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
// CHECK: error: CBuffer size is 65552 bytes, exceeding maximum of 65536 bytes.

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
// CHECK: error: CBuffer size is 65540 bytes, exceeding maximum of 65536 bytes.

Просмотреть файл

@ -1,7 +1,8 @@
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 %s | FileCheck %s -check-prefixes=CHECK,CHK16
// CHECK: Note: shader requires additional functionality:
// CHECK-NEXT: Barycentrics
// CHK16: Note: shader requires additional functionality:
// CHK16-NEXT: Barycentrics
// CHECK: !"SV_Barycentrics"
float4 main(float3 bary : SV_Barycentrics) : SV_Target

Просмотреть файл

@ -1,7 +1,8 @@
// RUN: %dxilver 1.1 | %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxc -E main -T ps_6_1 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_1 %s | FileCheck %s -check-prefixes=CHECK,CHK16
// CHECK: Note: shader requires additional functionality:
// CHECK-NEXT: Barycentrics
// CHK16: Note: shader requires additional functionality:
// CHK16-NEXT: Barycentrics
// CHECK: ; SV_Barycentrics
// CHECK: ; SV_Barycentrics

Просмотреть файл

@ -1,4 +1,4 @@
// RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E main -T ps_6_0 %s | FileCheck %s
// CHECK: @main

Просмотреть файл

@ -1,12 +1,12 @@
// RUN: %dxc -E PSMain -T ps_6_0 %s | FileCheck %s
// RUN: %dxc -E VSMain -T vs_6_0 %s | FileCheck %s
// RUN: %dxc -E GSMain -T gs_6_0 %s | FileCheck %s
// RUN: %dxc -E HSMain -T hs_6_0 %s | FileCheck %s
// RUN: %dxc -E DSMain -T ds_6_0 %s | FileCheck %s
// RUN: %dxc -E CSMain -T lib_6_5 %s | FileCheck %s -check-prefix=LIBCHK
// RUN: %dxc -E CSMain -T cs_6_0 %s | FileCheck %s -check-prefix=CSCHK
// RUN: %dxc -E MSMain -T ms_6_5 %s | FileCheck %s -check-prefix=CSCHK
// RUN: %dxc -E ASMain -T as_6_5 %s | FileCheck %s -check-prefix=CSCHK
// RUN: %dxilver 1.6 | %dxc -E PSMain -T ps_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E VSMain -T vs_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E GSMain -T gs_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E HSMain -T hs_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E DSMain -T ds_6_0 %s | FileCheck %s
// RUN: %dxilver 1.6 | %dxc -E CSMain -T lib_6_5 %s | FileCheck %s -check-prefix=LIBCHK
// RUN: %dxilver 1.6 | %dxc -E CSMain -T cs_6_0 %s | FileCheck %s -check-prefix=CSCHK
// RUN: %dxilver 1.6 | %dxc -E MSMain -T ms_6_5 %s | FileCheck %s -check-prefix=CSCHK
// RUN: %dxilver 1.6 | %dxc -E ASMain -T as_6_5 %s | FileCheck %s -check-prefix=CSCHK
// Test that the proper error for groupshared is produced when compiling in non-compute contexts
// and that everything is fine when we are

Просмотреть файл

@ -1419,6 +1419,7 @@ static void VerifyPdbUtil(dxc::DxcDllSupport &dllSupport,
#ifdef _WIN32
TEST_F(CompilerTest, CompileThenTestPdbUtilsStripped) {
if (m_ver.SkipDxilVersion(1, 5)) return;
CComPtr<TestIncludeHandler> pInclude;
CComPtr<IDxcCompiler> pCompiler;
CComPtr<IDxcBlobEncoding> pSource;
@ -1610,6 +1611,7 @@ void CompilerTest::TestPdbUtils(bool bSlim, bool bSourceInDebugModule, bool bStr
}
TEST_F(CompilerTest, CompileThenTestPdbUtils) {
if (m_ver.SkipDxilVersion(1, 5)) return;
TestPdbUtils(/*bSlim*/true, /*bSourceInDebugModule*/false, /*strip*/true); // Slim PDB, where source info is stored in its own part, and debug module is NOT present
TestPdbUtils(/*bSlim*/false, /*bSourceInDebugModule*/true, /*strip*/false); // Old PDB format, where source info is embedded in the module

Просмотреть файл

@ -47,6 +47,7 @@ public:
TEST_CLASS_SETUP(InitSupport);
dxc::DxcDllSupport m_dllSupport;
VersionSupportInfo m_ver;
// Basic loading tests.
TEST_METHOD(LoadDxilModule_1_0)
@ -81,6 +82,7 @@ public:
bool DxilModuleTest::InitSupport() {
if (!m_dllSupport.IsEnabled()) {
VERIFY_SUCCEEDED(m_dllSupport.Initialize());
m_ver.Initialize(m_dllSupport);
}
return true;
}
@ -582,6 +584,7 @@ TEST_F(DxilModuleTest, SetValidatorVersion) {
}
TEST_F(DxilModuleTest, PayloadQualifier) {
if (m_ver.SkipDxilVersion(1, 6)) return;
std::vector<LPCWSTR> arguments = { L"-enable-payload-qualifiers" };
Compiler c(m_dllSupport);

Просмотреть файл

@ -816,6 +816,7 @@ TEST_F(LinkerTest, RunLinkToLibWithGlobalCtor) {
}
TEST_F(LinkerTest, LinkSm63ToSm66) {
if (m_ver.SkipDxilVersion(1, 6)) return;
CComPtr<IDxcBlob> pLib0;
CompileLib(L"..\\CodeGenHLSL\\linker\\link_to_sm66.hlsl", &pLib0, {}, L"lib_6_3");