Skip to content

Commit 4a65fa7

Browse files
pixelflingerz3moon
authored andcommitted
Fix descriptor set update bug
the buffer offset in descriptors wasn't updated if it was the only value to change when setting the descriptor. FIXES=[443991507]
1 parent 5d8e366 commit 4a65fa7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

filament/src/ds/DescriptorSet.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ void DescriptorSet::setBuffer(DescriptorSetLayout const& layout,
153153
FILAMENT_CHECK_PRECONDITION(DSLB::isBuffer(layout.getDescriptorType(binding)))
154154
<< "descriptor " << +binding << "is not a buffer";
155155

156-
if (mDescriptors[binding].buffer.boh != boh || mDescriptors[binding].buffer.size != size) {
157-
// we don't set the dirty bit if only offset changes
156+
auto& buffer = mDescriptors[binding].buffer;
157+
if (buffer.boh != boh ||
158+
buffer.offset != offset ||
159+
buffer.size != size) {
158160
mDirty.set(binding);
159161
}
160-
mDescriptors[binding].buffer = { boh, offset, size };
162+
buffer = { boh, offset, size };
161163
mValid.set(binding, bool(boh));
162164
}
163165

0 commit comments

Comments
 (0)