Skip to content

Commit 75baf86

Browse files
DX12: limit shader version to 6.6 to avoid issues with byte code changes in newer untested versions of DXC
1 parent 04810cc commit 75baf86

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2024 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -91,9 +91,15 @@ static ShaderVersion GetD3D12ShaderModel(const ShaderCreateInfo& ShaderCI,
9191
VERIFY(ShaderCI.ByteCode != nullptr, "ByteCode must not be null when both Source and FilePath are null");
9292
}
9393

94-
return (HLSLVersion == ShaderVersion{0, 0}) ?
95-
MaxSupportedSM :
96-
ShaderVersion::Min(HLSLVersion, MaxSupportedSM);
94+
if (HLSLVersion == ShaderVersion{0, 0})
95+
{
96+
// Limit shader version to 6.6 to avoid issues with byte code changes in newer untested versions of DXC.
97+
return ShaderVersion::Min(MaxSupportedSM, ShaderVersion{6, 6});
98+
}
99+
else
100+
{
101+
return ShaderVersion::Min(HLSLVersion, MaxSupportedSM);
102+
}
97103
}
98104

99105
ShaderD3D12Impl::ShaderD3D12Impl(IReferenceCounters* pRefCounters,

0 commit comments

Comments
 (0)