[lit] Add dxil version to available_features for lit (#6310)
This will allow lit test check dxil version to avoid running on unsupported dxil.dll.
This commit is contained in:
Родитель
823125b32e
Коммит
4c4a5882e1
|
@ -1,8 +1,22 @@
|
|||
// RUN: %dxc -T lib_6_8 %s | FileCheck %s --check-prefixes=MD
|
||||
// RUN: %dxc -T lib_6_8 -Od %s | FileCheck %s --check-prefixes=MD
|
||||
// RUN: %dxc -T lib_6_8 -Zi %s | FileCheck %s --check-prefixes=MD
|
||||
// RUN: %if dxil-1-8 \
|
||||
// RUN: %{ \
|
||||
// RUN: %dxc -T lib_6_8 %s | FileCheck %s --check-prefixes=MD \
|
||||
// RUN: %}
|
||||
|
||||
// RUN: %dxc -T lib_6_8 -fcgl %s | FileCheck %s --check-prefix=FCGLMD
|
||||
// RUN: %if dxil-1-8 \
|
||||
// RUN: %{ \
|
||||
// RUN: %dxc -T lib_6_8 -Od %s | FileCheck %s --check-prefixes=MD \
|
||||
// RUN: %}
|
||||
|
||||
// RUN: %if dxil-1-8 \
|
||||
// RUN: %{ \
|
||||
// RUN: %dxc -T lib_6_8 -Zi %s | FileCheck %s --check-prefixes=MD \
|
||||
// RUN: %}
|
||||
|
||||
// RUN: %if dxil-1-8 \
|
||||
// RUN: %{ \
|
||||
// RUN: %dxc -T lib_6_8 -fcgl %s | FileCheck %s --check-prefix=FCGLMD \
|
||||
// RUN: %}
|
||||
|
||||
// Verify correct metadata annotations for different node shader input and outputs.
|
||||
|
||||
|
|
|
@ -503,6 +503,33 @@ if config.enable_backtrace == "1":
|
|||
if config.spirv:
|
||||
config.available_features.add("spirv")
|
||||
|
||||
# Check supported dxil version
|
||||
def get_dxil_version():
|
||||
result = subprocess.run([lit.util.which('dxc', llvm_tools_dir), "--version"], stdout=subprocess.PIPE)
|
||||
output = result.stdout.decode("utf-8")
|
||||
pat = re.compile(r"(dxcompiler.dll|libdxcompiler.so|libdxcompiler.dylib): (?P<dxcMajor>[0-9]+)\.(?P<dxcMinor>[0-9]+).*(; (dxil.dll|libdxil.so): (?P<dxilMajor>[0-9]+)\.(?P<dxilMinor>[0-9]+))?")
|
||||
m = pat.search(output)
|
||||
dxcMajor = int(m.group("dxcMajor"))
|
||||
dxcMinor = int(m.group("dxcMinor"))
|
||||
|
||||
if None == m.group("dxilMajor"):
|
||||
return dxcMajor, dxcMinor
|
||||
dxilMajor = int(m.group("dxilMajor"))
|
||||
dxilMinor = int(m.group("dxilMinor"))
|
||||
if dxcMajor < dxilMajor:
|
||||
return dxcMajor, dxcMinor
|
||||
if dxcMajor > dxilMajor:
|
||||
return dxilMajor, dxilMinor
|
||||
if dxcMinor < dxilMinor:
|
||||
return dxcMajor, dxcMinor
|
||||
return dxilMajor, dxilMinor
|
||||
|
||||
dxilMajor, dxilMinor = get_dxil_version()
|
||||
if dxilMajor == 1:
|
||||
for i in range(0, dxilMinor + 1):
|
||||
config.available_features.add(f"dxil-1-{i}")
|
||||
|
||||
|
||||
# Check if we should run long running tests.
|
||||
if lit_config.params.get("run_long_tests", None) == "true":
|
||||
config.available_features.add("long_tests")
|
||||
|
|
Загрузка…
Ссылка в новой задаче