File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
src/renderers/webgpu/utils Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,27 @@ class WebGPUAttributeUtils {
69
69
let array = bufferAttribute . array ;
70
70
71
71
// patch for INT16 and UINT16
72
- if ( attribute . normalized === false && ( array . constructor === Int16Array || array . constructor === Uint16Array ) ) {
72
+ if ( attribute . normalized === false ) {
73
73
74
- const tempArray = new Uint32Array ( array . length ) ;
75
- for ( let i = 0 ; i < array . length ; i ++ ) {
74
+ if ( array . constructor === Int16Array ) {
76
75
77
- tempArray [ i ] = array [ i ] ;
76
+ array = new Int32Array ( array ) ;
78
77
79
- }
78
+ } else if ( array . constructor === Uint16Array ) {
79
+
80
+ array = new Uint32Array ( array ) ;
81
+
82
+ if ( usage & GPUBufferUsage . INDEX ) {
83
+
84
+ for ( let i = 0 ; i < array . length ; i ++ ) {
80
85
81
- array = tempArray ;
86
+ if ( array [ i ] === 0xffff ) array [ i ] = 0xffffffff ; // use correct primitive restart index
87
+
88
+ }
89
+
90
+ }
91
+
92
+ }
82
93
83
94
}
84
95
You can’t perform that action at this time.
0 commit comments