Skip to content

Commit b55cee6

Browse files
NodeUniformBuffer: Fix byteLength to follow overridden buffer getter (#33469)
1 parent 42aa39a commit b55cee6

4 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/extras/PMREMGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class PMREMGenerator {
159159
/**
160160
* Generates a PMREM from an cubemap texture, which can be either LDR
161161
* or HDR. The ideal input cube size is 256 x 256, as this matches best
162-
* with the 256 x 256 cubemap output. The minimum supported input cube
162+
* with the 256 x 256 cubemap output. The minimum supported input cube
163163
* size is 16 x 16 per face.
164164
*
165165
* @param {Texture} cubemap - The cubemap texture to be converted.

src/renderers/common/extras/PMREMGenerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class PMREMGenerator {
267267
/**
268268
* Generates a PMREM from an cubemap texture, which can be either LDR
269269
* or HDR. The ideal input cube size is 256 x 256, as this matches best
270-
* with the 256 x 256 cubemap output. The minimum supported input cube
270+
* with the 256 x 256 cubemap output. The minimum supported input cube
271271
* size is 16 x 16 per face.
272272
*
273273
* @param {Texture} cubemap - The cubemap texture to be converted.

src/renderers/common/nodes/NodeUniformBuffer.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import UniformBuffer from '../UniformBuffer.js';
2+
import { getFloatLength } from '../BufferUtils.js';
23

34
let _id = 0;
45

@@ -89,6 +90,18 @@ class NodeUniformBuffer extends UniformBuffer {
8990

9091
}
9192

93+
/**
94+
* The buffer's byte length.
95+
*
96+
* @type {number}
97+
* @readonly
98+
*/
99+
get byteLength() {
100+
101+
return getFloatLength( this.buffer.byteLength );
102+
103+
}
104+
92105
/**
93106
* The uniform buffer.
94107
*

src/renderers/webgpu/utils/WebGPUBindingUtils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,6 @@ class WebGPUBindingUtils {
190190
const array = binding.buffer; // cpu
191191
const buffer = backend.get( binding ).buffer; // gpu
192192

193-
if ( buffer === undefined ) return; // see #33461
194-
195193
const updateRanges = binding.updateRanges;
196194

197195
if ( updateRanges.length === 0 ) {

0 commit comments

Comments
 (0)