Skip to content

Commit

Permalink
allow bindDescriptorSet() to take a null handle
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelflinger committed Oct 29, 2024
1 parent d1998c1 commit ecedbad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions filament/backend/src/opengl/OpenGLDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<GLDescriptorSet*>(dsh);
if (ds) {
Expand Down

0 comments on commit ecedbad

Please sign in to comment.