-
Notifications
You must be signed in to change notification settings - Fork 796
Add back compat lit test suite, and download older dxil.dll's #7705
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
base: main
Are you sure you want to change the base?
Changes from 4 commits
4903b74
de8f1a0
29a74c8
eec2b6d
0b4c877
7ad9415
2fe0580
ad89e72
a468bda
0f7d9ec
6c05d9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# REQUIRES: dxc_dxil_dll_path | ||
# RUN: python -c "import os; print(os.environ['DXC_DXIL_DLL_PATH'])" | FileCheck %s | ||
# CHECK: dxil.dll |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,9 @@ import lit.util | |
# name: The name of this test suite. | ||
config.name = 'Clang' | ||
|
||
print("PARAMS seen in top level config:", lit_config.params) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this left-over debugging code, or do you think this should be here long term? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Left-over. |
||
# Tweak PATH for Win32 | ||
if platform.system() == 'Windows': | ||
# Seek sane tools in directories and set to $PATH. | ||
|
@@ -94,6 +97,12 @@ for name in possibly_dangerous_env_vars: | |
if name in config.environment: | ||
del config.environment[name] | ||
|
||
dxc_dll_path = lit_config.params.get('DXC_DXIL_DLL_PATH', None) | ||
if dxc_dll_path and os.path.exists(dxc_dll_path): | ||
lit_config.note("Setting DXC_DXIL_DLL_PATH environment variable") | ||
config.environment.update({'DXC_DXIL_DLL_PATH' : dxc_dll_path}) | ||
config.available_features.add("dxc_dxil_dll_path") | ||
|
||
# Tweak the PATH to include the tools dir and the scripts dir. | ||
if clang_obj_root is not None: | ||
clang_tools_dir = getattr(config, 'clang_tools_dir', None) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,6 @@ | |
#include "dxc/Support/Global.h" | ||
|
||
#include "dxc/DXIL/DxilShaderModel.h" | ||
#include "dxc/Support/dxcapi.extval.h" | ||
#include "dxc/Test/DxcTestUtils.h" | ||
#include "dxc/Test/HlslTestUtils.h" | ||
|
||
|
@@ -327,11 +326,12 @@ class ValidationTest : public ::testing::Test { | |
TEST_METHOD(PSVContentValidationMS) | ||
TEST_METHOD(PSVContentValidationAS) | ||
TEST_METHOD(UnitTestExtValidationSupport) | ||
TEST_METHOD(UnitTestValidationBackCompatibility) | ||
TEST_METHOD(WrongPSVSize) | ||
TEST_METHOD(WrongPSVSizeOnZeros) | ||
TEST_METHOD(WrongPSVVersion) | ||
|
||
dxc::DxCompilerDllLoader m_dllSupport; | ||
dxc::DxcDllExtValidationLoader m_dllSupport; | ||
VersionSupportInfo m_ver; | ||
|
||
void TestCheck(LPCWSTR name) { | ||
|
@@ -4302,6 +4302,17 @@ TEST_F(ValidationTest, UnitTestExtValidationSupport) { | |
} | ||
#endif | ||
|
||
// Building on the above test, this test uses the DxcDllExtValidationLoader | ||
// class to instantiate loader objects using previously released | ||
// dxcompiler.dll's. The environment will also be set up so that the previous | ||
// dxil.dll's will also be loaded (to be used for external validation). | ||
TEST_F(ValidationTest, UnitTestValidationBackCompatibility) { | ||
dxc::DxcDllExtValidationLoader ExtSupport; | ||
ExtSupport.Initialize(); | ||
std::string dllPath = ExtSupport.GetDxilDllPath(); | ||
VERIFY_IS_TRUE(dllPath.empty()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does it mean that dllPath is empty? I'm trying to understand what this test is testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test is going to be out of scope for now. I'm going to focus on getting check-clang to work with older external validators. |
||
} | ||
|
||
TEST_F(ValidationTest, ValidatePreviewBypassHash) { | ||
if (m_ver.SkipDxilVersion(1, ShaderModel::kHighestMinor)) | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,20 @@ std::string DisassembleProgram(dxc::DxCompilerDllLoader &dllSupport, | |
return BlobToUtf8(pDisassembly); | ||
} | ||
|
||
std::string DisassembleProgram(dxc::DxcDllExtValidationLoader &dllSupport, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm having trouble connecting the dots here as to why the changes involving DisassembleProgram are related to the rest of these changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this was when I had thought I could do taef tests and modify the loaders all in one PR, I do think this will be needed, but later :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we keep this in this change or should it be pulled out to the later one? |
||
IDxcBlob *pProgram) { | ||
CComPtr<IDxcCompiler> pCompiler; | ||
CComPtr<IDxcBlobEncoding> pDisassembly; | ||
|
||
if (!dllSupport.IsEnabled()) { | ||
VERIFY_SUCCEEDED(dllSupport.Initialize()); | ||
} | ||
|
||
VERIFY_SUCCEEDED(dllSupport.CreateInstance(CLSID_DxcCompiler, &pCompiler)); | ||
VERIFY_SUCCEEDED(pCompiler->Disassemble(pProgram, &pDisassembly)); | ||
return BlobToUtf8(pDisassembly); | ||
} | ||
|
||
void AssembleToContainer(dxc::DllLoader &dllSupport, IDxcBlob *pModule, | ||
IDxcBlob **pContainer) { | ||
CComPtr<IDxcAssembler> pAssembler; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does ARM fit into this?