From e9585f554879effaff9c80dc55bdecfe14b033b9 Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Tue, 26 Jul 2022 14:19:54 +0000 Subject: [PATCH] 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 Reviewed-by: Antonio Maiorano Commit-Queue: Ben Clayton --- src/tint/utils/io/command_posix.cc | 2 +- src/tint/val/hlsl.cc | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tint/utils/io/command_posix.cc b/src/tint/utils/io/command_posix.cc index 23ee5115fd..ff0a138920 100644 --- a/src/tint/utils/io/command_posix.cc +++ b/src/tint/utils/io/command_posix.cc @@ -164,7 +164,7 @@ Command::Output Command::Exec(std::initializer_list arguments) cons // run the target command. // // 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(); if (child_id < 0) { diff --git a/src/tint/val/hlsl.cc b/src/tint/val/hlsl.cc index a2998d8948..f984b1a639 100644 --- a/src/tint/val/hlsl.cc +++ b/src/tint/val/hlsl.cc @@ -65,11 +65,11 @@ Result HlslUsingDXC(const std::string& dxc_path, // Match Dawn's compile flags // See dawn\src\dawn_native\d3d12\RenderPipelineD3D12.cpp // and dawn_native\d3d12\ShaderModuleD3D12.cpp (GetDXCArguments) - const char* compileFlags = - "/Zpr " // D3DCOMPILE_PACK_MATRIX_ROW_MAJOR - "/Gis"; // D3DCOMPILE_IEEE_STRICTNESS - - auto res = dxc(profile, "-E " + ep.first, compileFlags, file.Path()); + auto res = dxc(profile, + "-E " + ep.first, // Entry point + "/Zpr", // D3DCOMPILE_PACK_MATRIX_ROW_MAJOR + "/Gis", // D3DCOMPILE_IEEE_STRICTNESS + file.Path()); if (!res.out.empty()) { if (!result.output.empty()) { result.output += "\n";