|
@@ -14,10 +14,13 @@ class StorageBufferNode extends BufferNode {
|
|
|
this.isStorageBufferNode = true;
|
|
|
|
|
|
this.bufferObject = false;
|
|
|
+ this.bufferCount = bufferCount;
|
|
|
|
|
|
this._attribute = null;
|
|
|
this._varying = null;
|
|
|
|
|
|
+ this.global = true;
|
|
|
+
|
|
|
if ( value.isStorageBufferAttribute !== true && value.isStorageInstancedBufferAttribute !== true ) {
|
|
|
|
|
|
// TOOD: Improve it, possibly adding a new property to the BufferAttribute to identify it as a storage buffer read-only attribute in Renderer
|
|
@@ -29,6 +32,30 @@ class StorageBufferNode extends BufferNode {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ getHash( builder ) {
|
|
|
+
|
|
|
+ if ( this.bufferCount === 0 ) {
|
|
|
+
|
|
|
+ let bufferData = builder.globalCache.getData( this.value );
|
|
|
+
|
|
|
+ if ( bufferData === undefined ) {
|
|
|
+
|
|
|
+ bufferData = {
|
|
|
+ node: this
|
|
|
+ };
|
|
|
+
|
|
|
+ builder.globalCache.setData( this.value, bufferData );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return bufferData.node.uuid;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return this.uuid;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
getInputType( /*builder*/ ) {
|
|
|
|
|
|
return 'storageBuffer';
|