summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhimetal.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/rhi/qrhimetal.mm')
-rw-r--r--src/gui/rhi/qrhimetal.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm
index 555ed5e79f..3aa68db585 100644
--- a/src/gui/rhi/qrhimetal.mm
+++ b/src/gui/rhi/qrhimetal.mm
@@ -3215,7 +3215,10 @@ id<MTLLibrary> QRhiMetalData::createMetalLib(const QShader &shader, QShader::Var
[opts release];
// src is autoreleased
- if (err) {
+ // if lib is null and err is non-null, we had errors (fail)
+ // if lib is non-null and err is non-null, we had warnings (success)
+ // if lib is non-null and err is null, there were no errors or warnings (success)
+ if (!lib) {
const QString msg = QString::fromNSString(err.localizedDescription);
*error = msg;
return nil;