D3D: remove error msgs from DXC/FXC compile failures' reports by default
But error codes should still be included.
We can add a new toggle to force including error msgs in a separate CL.
Bug: 405797531
Change-Id: I7992bb045b7b681bd99e3c7bce62ef141262ca42
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/232634
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/d3d/ShaderUtils.cpp b/src/dawn/native/d3d/ShaderUtils.cpp
index 6e3c645..902748c 100644
--- a/src/dawn/native/d3d/ShaderUtils.cpp
+++ b/src/dawn/native/d3d/ShaderUtils.cpp
@@ -168,16 +168,16 @@
DAWN_TRY(CheckHRESULT(result->GetStatus(&hr), "DXC get status"));
if (FAILED(hr)) {
+ const char* hrAsString = HRESULTAsString(hr);
ComPtr<IDxcBlobEncoding> errors;
DAWN_TRY(CheckHRESULT(result->GetErrorBuffer(&errors), "DXC get error buffer"));
if (dumpShaders) {
- return DAWN_VALIDATION_ERROR("DXC compile failed with: %s\n/* Generated HLSL: */\n%s\n",
- static_cast<char*>(errors->GetBufferPointer()),
- hlslSource.c_str());
+ return DAWN_VALIDATION_ERROR(
+ "DXC compile failed with error: %s msg: %s\n/* Generated HLSL: */\n%s\n",
+ hrAsString, static_cast<char*>(errors->GetBufferPointer()), hlslSource.c_str());
}
- return DAWN_VALIDATION_ERROR("DXC compile failed with: %s.",
- static_cast<char*>(errors->GetBufferPointer()));
+ return DAWN_VALIDATION_ERROR("DXC compile failed with error: %s.", hrAsString);
}
ComPtr<IDxcBlob> compiledShader;
@@ -198,15 +198,14 @@
if (FAILED(result)) {
const char* resultAsString = HRESULTAsString(result);
- std::string errorMsg = errors ? static_cast<char*>(errors->GetBufferPointer()) : "";
if (dumpShaders) {
+ std::string errorMsg = errors ? static_cast<char*>(errors->GetBufferPointer()) : "";
return DAWN_VALIDATION_ERROR(
"FXC compile failed with error: %s msg: %s\n/* Generated HLSL: */\n%s\n",
resultAsString, errorMsg, hlslSource.c_str());
}
- return DAWN_VALIDATION_ERROR("FXC compile failed with error: %s msg: %s.", resultAsString,
- errorMsg);
+ return DAWN_VALIDATION_ERROR("FXC compile failed with error: %s.", resultAsString);
}
return std::move(compiledShader);