Mesa (main): d3d12: fix return-code without dxcompiler.dll
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Apr 6 15:12:37 UTC 2022
Module: Mesa
Branch: main
Commit: 837f781c9a4f909ac1ee0b3b8331af87301b5fc3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=837f781c9a4f909ac1ee0b3b8331af87301b5fc3
Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date: Tue Apr 5 08:40:42 2022 +0200
d3d12: fix return-code without dxcompiler.dll
When we don't have a good dxcompiler.dll that we can load IDxcLibrary
from to help with diagnostics, we currently return true for validation
even if the validation actually failed.
Let's fix that, and also add a debug-message explaining what went wrong
for those who are debugging and wondering what's up.
Fixes: 2ea15cd661c ("d3d12: introduce d3d12 gallium driver")
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15744>
---
src/gallium/drivers/d3d12/d3d12_compiler.cpp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/d3d12/d3d12_compiler.cpp b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
index f52ce424c86..da42eb14954 100644
--- a/src/gallium/drivers/d3d12/d3d12_compiler.cpp
+++ b/src/gallium/drivers/d3d12/d3d12_compiler.cpp
@@ -1590,7 +1590,13 @@ bool d3d12_validation_tools::validate_and_sign(struct blob *dxil)
validator->Validate(&source, DxcValidatorFlags_InPlaceEdit, &result);
HRESULT validationStatus;
result->GetStatus(&validationStatus);
- if (FAILED(validationStatus) && library) {
+ if (FAILED(validationStatus)) {
+ if (!library) {
+ debug_printf("D3D12: validation failed, but lacking "
+ "IDxcLibrary for proper diagnostics.\n");
+ return false;
+ }
+
ComPtr<IDxcBlobEncoding> printBlob, printBlobUtf8;
result->GetErrorBuffer(&printBlob);
library->GetBlobAsUtf8(printBlob.Get(), printBlobUtf8.GetAddressOf());
More information about the mesa-commit
mailing list