tint/val: Fix HLSL validation with DXC

Unlike on Windows, where command line argument splitting is done by the
callee, on 'nix systems, the arguments need to be split by the caller.

Fixes issues where validation was different on windows to other
operating systems.

Change-Id: If55738c431586f706e3edf0ac683661f34b53391
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97144
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-07-26 14:19:54 +00:00 committed by Dawn LUCI CQ
parent 145cdafc5e
commit e9585f5548
2 changed files with 6 additions and 6 deletions

View File

@ -164,7 +164,7 @@ Command::Output Command::Exec(std::initializer_list<std::string> arguments) cons
// run the target command. // run the target command.
// //
// The parent process is responsible for feeding any input to the stdin_pipe // The parent process is responsible for feeding any input to the stdin_pipe
// and collectting output from the std[out,err]_pipes. // and collecting output from the std[out,err]_pipes.
int child_id = fork(); int child_id = fork();
if (child_id < 0) { if (child_id < 0) {

View File

@ -65,11 +65,11 @@ Result HlslUsingDXC(const std::string& dxc_path,
// Match Dawn's compile flags // Match Dawn's compile flags
// See dawn\src\dawn_native\d3d12\RenderPipelineD3D12.cpp // See dawn\src\dawn_native\d3d12\RenderPipelineD3D12.cpp
// and dawn_native\d3d12\ShaderModuleD3D12.cpp (GetDXCArguments) // and dawn_native\d3d12\ShaderModuleD3D12.cpp (GetDXCArguments)
const char* compileFlags = auto res = dxc(profile,
"/Zpr " // D3DCOMPILE_PACK_MATRIX_ROW_MAJOR "-E " + ep.first, // Entry point
"/Gis"; // D3DCOMPILE_IEEE_STRICTNESS "/Zpr", // D3DCOMPILE_PACK_MATRIX_ROW_MAJOR
"/Gis", // D3DCOMPILE_IEEE_STRICTNESS
auto res = dxc(profile, "-E " + ep.first, compileFlags, file.Path()); file.Path());
if (!res.out.empty()) { if (!res.out.empty()) {
if (!result.output.empty()) { if (!result.output.empty()) {
result.output += "\n"; result.output += "\n";