瀏覽代碼

WebGPUAttributes: Support interleaved data. (#22421)

Michael Herzog 3 年之前
父節點
當前提交
ca444fdd25
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      examples/jsm/renderers/webgpu/WebGPUAttributes.js

+ 6 - 0
examples/jsm/renderers/webgpu/WebGPUAttributes.js

@@ -9,12 +9,16 @@ class WebGPUAttributes {
 
 	get( attribute ) {
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		return this.buffers.get( attribute );
 
 	}
 
 	remove( attribute ) {
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		const data = this.buffers.get( attribute );
 
 		if ( data ) {
@@ -29,6 +33,8 @@ class WebGPUAttributes {
 
 	update( attribute, isIndex = false, usage = null ) {
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		let data = this.buffers.get( attribute );
 
 		if ( data === undefined ) {