Browse Source

Fix wrong value of updateFlag in the valueCache map

Popov72 4 years ago
parent
commit
33f87caae5
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/Materials/uniformBuffer.ts

+ 5 - 3
src/Materials/uniformBuffer.ts

@@ -764,9 +764,11 @@ export class UniformBuffer {
             return false;
         }
 
-        this._valueCache[name] = flag;
-        if (ThinEngine.Features.trackUbosInFrame) {
-            this._updateList[this._updateList.length] = [-1, flag, name];
+        if (!this._createBufferOnWrite) {
+            this._valueCache[name] = flag;
+            if (ThinEngine.Features.trackUbosInFrame) {
+                this._updateList[this._updateList.length] = [-1, flag, name];
+            }
         }
 
         return true;