Skip to content

Commit

Permalink
UniformArrayNode: Fix getNodeType() (#30058)
Browse files Browse the repository at this point in the history
* fix getNodeType()

* Revert "WebGPURenderer: Shadow fixes (#29991)"

This reverts commit f91fbc3.

* Revert "WebGPURenderer: Add `SpotLight.map` support (#29989)"

This reverts commit e2e04d3.

* cleanup

* Reapply "WebGPURenderer: Add `SpotLight.map` support (#29989)"

This reverts commit 9a2e6c2.

* Reapply "WebGPURenderer: Shadow fixes (#29991)"

This reverts commit 50c6e14.
  • Loading branch information
sunag authored Dec 7, 2024
1 parent e4a48bd commit 1b6a704
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/nodes/accessors/UniformArrayNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,20 @@ class UniformArrayNode extends BufferNode {

this.array = value;
this.elementType = elementType === null ? getValueType( value[ 0 ] ) : elementType;
this.paddedType = this.getPaddedType();

this.updateType = NodeUpdateType.RENDER;

this.isArrayBufferNode = true;

}

getNodeType() {

return this.paddedType;

}

getElementType() {

return this.elementType;
Expand All @@ -61,7 +68,8 @@ class UniformArrayNode extends BufferNode {

getPaddedType() {

const elementType = this.getElementType();
const elementType = this.elementType;

let paddedType = 'vec4';

if ( elementType === 'mat2' ) {
Expand Down Expand Up @@ -90,7 +98,7 @@ class UniformArrayNode extends BufferNode {

const { array, value } = this;

const elementType = this.getElementType();
const elementType = this.elementType;

if ( elementType === 'float' || elementType === 'int' || elementType === 'uint' ) {

Expand Down Expand Up @@ -189,11 +197,11 @@ class UniformArrayNode extends BufferNode {
setup( builder ) {

const length = this.array.length;
const elementType = this.elementType;

const elementType = this.getElementType();
let arrayType = Float32Array;

const paddedType = this.getPaddedType();
const paddedType = this.paddedType;
const paddedElementLength = builder.getTypeLength( paddedType );

if ( elementType.charAt( 0 ) === 'i' ) arrayType = Int32Array;
Expand Down

0 comments on commit 1b6a704

Please sign in to comment.