Explorar o código

WebGPUAttributes: Support interleaved data. (#22421)

Michael Herzog %!s(int64=3) %!d(string=hai) anos
pai
achega
ca444fdd25
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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 ) {
 	get( attribute ) {
 
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		return this.buffers.get( attribute );
 		return this.buffers.get( attribute );
 
 
 	}
 	}
 
 
 	remove( attribute ) {
 	remove( attribute ) {
 
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		const data = this.buffers.get( attribute );
 		const data = this.buffers.get( attribute );
 
 
 		if ( data ) {
 		if ( data ) {
@@ -29,6 +33,8 @@ class WebGPUAttributes {
 
 
 	update( attribute, isIndex = false, usage = null ) {
 	update( attribute, isIndex = false, usage = null ) {
 
 
+		if ( attribute.isInterleavedBufferAttribute ) attribute = attribute.data;
+
 		let data = this.buffers.get( attribute );
 		let data = this.buffers.get( attribute );
 
 
 		if ( data === undefined ) {
 		if ( data === undefined ) {