tint/test-runner: Split expectations for FXC and DXC

Change tint's `--fxc` flag to take the path of the FXC compiler DLL.
Have tint attempt to validate with both FXC and DXC if `--validate` is
passed.

Fix the 'dirsWithNoPassExpectations' logic which looks like it got
broken with the tint -> dawn merge. It also incorrectly applied
filepath.FromSlash() on windows.

Change-Id: I0f46aa5c21bc48a2abc48402c41f846aff4a8633
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/96800
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@chromium.org>
This commit is contained in:
Ben Clayton
2022-07-22 17:43:27 +00:00
committed by Dawn LUCI CQ
parent 0778d9a48f
commit 7d34de88f1
5122 changed files with 73624 additions and 206 deletions

View File

@@ -95,13 +95,15 @@ Result HlslUsingDXC(const std::string& dxc_path,
}
#ifdef _WIN32
Result HlslUsingFXC(const std::string& source, const EntryPointList& entry_points) {
Result HlslUsingFXC(const std::string& fxc_path,
const std::string& source,
const EntryPointList& entry_points) {
Result result;
// This library leaks if an error happens in this function, but it is ok
// because it is loaded at most once, and the executables using HlslUsingFXC
// are short-lived.
HMODULE fxcLib = LoadLibraryA("d3dcompiler_47.dll");
HMODULE fxcLib = LoadLibraryA(fxc_path.c_str());
if (fxcLib == nullptr) {
result.output = "Couldn't load FXC";
result.failed = true;

View File

@@ -30,6 +30,9 @@ namespace tint::val {
using EntryPointList = std::vector<std::pair<std::string, ast::PipelineStage>>;
/// Name of the FXC compiler DLL
static constexpr const char kFxcDLLName[] = "d3dcompiler_47.dll";
/// The return structure of Validate()
struct Result {
/// True if validation passed
@@ -51,10 +54,13 @@ Result HlslUsingDXC(const std::string& dxc_path,
#ifdef _WIN32
/// Hlsl attempts to compile the shader with FXC, verifying that the shader
/// compiles successfully.
/// @param fxc_path path to the FXC DLL
/// @param source the generated HLSL source
/// @param entry_points the list of entry points to validate
/// @return the result of the compile
Result HlslUsingFXC(const std::string& source, const EntryPointList& entry_points);
Result HlslUsingFXC(const std::string& fxc_path,
const std::string& source,
const EntryPointList& entry_points);
#endif // _WIN32
/// Msl attempts to compile the shader with the Metal Shader Compiler,