diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-01 15:16:24 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-03 14:18:30 +0200 |
commit | f6802a5aac49f6161d60e9b3e761093e292f2fc4 (patch) | |
tree | 4a0730b081c4206fbb088cd1bfc483a7e6d8ad1a /src/gui/rhi/qrhigles2.cpp | |
parent | 95daeb24076c01e8f91dd590d89f063ca68b3427 (diff) |
rhi: Sanity check the srb in debug builds
Instead of cryptic assertions and crashes depending on the backend,
show some useful warnings (in debug builds only) when one tries to
create an srb with a list where there are duplicated bindings. (a
mistake that happens relatively often during the development of
frameworks, such as Quick 3D, on top)
Change-Id: If1b50a2e8165b001878ad566e048f146e636514f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhigles2.cpp')
-rw-r--r-- | src/gui/rhi/qrhigles2.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp index f8a63d482f..380baf91b1 100644 --- a/src/gui/rhi/qrhigles2.cpp +++ b/src/gui/rhi/qrhigles2.cpp @@ -4192,6 +4192,10 @@ void QGles2ShaderResourceBindings::destroy() bool QGles2ShaderResourceBindings::create() { + QRHI_RES_RHI(QRhiGles2); + if (!rhiD->sanityCheckShaderResourceBindings(this)) + return false; + generation += 1; return true; } |