From ecedbad5ba65e9a3cb2888ffad6afe4da9903e28 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 28 Oct 2024 16:33:57 -0700 Subject: [PATCH] allow bindDescriptorSet() to take a null handle --- filament/backend/src/opengl/OpenGLDriver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/filament/backend/src/opengl/OpenGLDriver.cpp b/filament/backend/src/opengl/OpenGLDriver.cpp index a606d090870..2154a26964d 100644 --- a/filament/backend/src/opengl/OpenGLDriver.cpp +++ b/filament/backend/src/opengl/OpenGLDriver.cpp @@ -3875,6 +3875,14 @@ void OpenGLDriver::bindDescriptorSet( backend::DescriptorSetHandle dsh, backend::descriptor_set_t set, backend::DescriptorSetOffsetArray&& offsets) { + + if (UTILS_UNLIKELY(!dsh)) { + mBoundDescriptorSets[set].dsh = dsh; + mInvalidDescriptorSetBindings.set(set, true); + mInvalidDescriptorSetBindingOffsets.set(set, true); + return; + } + // handle_cast<> here also serves to validate the handle (it actually cannot return nullptr) GLDescriptorSet const* const ds = handle_cast(dsh); if (ds) {