Skip to content

Commit

Permalink
WebGPUBindings: Don't miss texture and sampler updates in update().
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 committed Sep 6, 2020
1 parent 5c302a5 commit b166f40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/jsm/renderers/webgpu/WebGPUBindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ class WebGPUBindings {
const material = object.material;
const texture = material[ binding.name ];

this.textures.updateSampler( texture );
const forceUpdate = this.textures.updateSampler( texture );
const samplerGPU = this.textures.getSampler( texture );

if ( binding.samplerGPU !== samplerGPU ) {
if ( binding.samplerGPU !== samplerGPU || forceUpdate ) {

binding.samplerGPU = samplerGPU;
needsBindGroupRefresh = true;
Expand All @@ -130,10 +130,10 @@ class WebGPUBindings {
const material = object.material;
const texture = material[ binding.name ];

this.textures.updateTexture( texture );
const forceUpdate = this.textures.updateTexture( texture );
const textureGPU = this.textures.getTextureGPU( texture );

if ( binding.textureGPU !== textureGPU ) {
if ( binding.textureGPU !== textureGPU || forceUpdate ) {

binding.textureGPU = textureGPU;
needsBindGroupRefresh = true;
Expand Down

0 comments on commit b166f40

Please sign in to comment.