Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/renderers/common/UniformsGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ class UniformsGroup extends UniformBuffer {
addUniformUpdateRange( uniform ) {

const index = uniform.index;
let range = this._updateRangeCache.get( index );

if ( this._updateRangeCache.has( index ) !== true ) {
if ( range === undefined ) {

const updateRanges = this.updateRanges;

const start = uniform.offset;
const count = uniform.itemSize;
range = { start: uniform.offset, count: uniform.itemSize, added: false };
Comment thread
Mugen87 marked this conversation as resolved.
Outdated
this._updateRangeCache.set( index, range );

const range = { start, count };
}

updateRanges.push( range );
if ( range.added === false ) {

this._updateRangeCache.set( index, range );
range.added = true;
this.updateRanges.push( range );

}

Expand All @@ -88,7 +88,11 @@ class UniformsGroup extends UniformBuffer {
*/
clearUpdateRanges() {

this._updateRangeCache.clear();
for ( const range of this._updateRangeCache.values() ) {

range.added = false;

}

super.clearUpdateRanges();

Expand Down
Loading