From aad24f603387859531f1b61f94962c862397aba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Fri, 24 Sep 2021 13:55:50 +0200 Subject: Rhi: Document expectation for setGraphicsPipeline's pipeline argument The backed expect the pipeline to be valid, so document it and assert if the set pipeline is a null pointer. Pick-to: 6.2 Change-Id: I72b3d0d11b8dc98240d17e13adf2b6ccbd71891d Reviewed-by: Laszlo Agocs --- src/gui/rhi/qrhi.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index e3bb8f288e..82a304865e 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -5650,9 +5650,12 @@ void QRhiCommandBuffer::endPass(QRhiResourceUpdateBatch *resourceUpdates) \note This function can only be called inside a render pass, meaning between a beginPass() and endPass() call. + + \note The new graphics pipeline \a ps must be a valid pointer. */ void QRhiCommandBuffer::setGraphicsPipeline(QRhiGraphicsPipeline *ps) { + Q_ASSERT(ps != nullptr); m_rhi->setGraphicsPipeline(this, ps); } -- cgit v1.2.3