Skip to content

Commit 4c1941f

Browse files
authored
Renderer: Document more modules. (#30246)
* Renderer: Document more modules. * Renderer: Document more modules. * Renderer: Document more modules. * Renderer: Document more modules. * Fix typo.
1 parent 9a0137a commit 4c1941f

File tree

13 files changed

+1356
-33
lines changed

13 files changed

+1356
-33
lines changed

src/nodes/core/NodeBuilder.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,15 @@ class NodeBuilder {
497497

498498
}
499499

500+
/**
501+
* Returns the output struct name which is required by
502+
* {@link module:OutputStructNode}.
503+
*
504+
* @abstract
505+
* @return {String} The name of the output struct.
506+
*/
507+
getOutputStructName() {}
508+
500509
/**
501510
* Returns a bind group for the given group name and binding.
502511
*
@@ -1034,10 +1043,11 @@ class NodeBuilder {
10341043
* @param {Texture} texture - The texture.
10351044
* @param {String} textureProperty - The texture property name.
10361045
* @param {String} uvSnippet - Snippet defining the texture coordinates.
1046+
* @param {String?} depthSnippet - Snippet defining the 0-based texture array index to sample.
10371047
* @param {String} levelSnippet - Snippet defining the mip level.
10381048
* @return {String} The generated shader string.
10391049
*/
1040-
generateTextureLod( /* texture, textureProperty, uvSnippet, levelSnippet */ ) {
1050+
generateTextureLod( /* texture, textureProperty, uvSnippet, depthSnippet, levelSnippet */ ) {
10411051

10421052
console.warn( 'Abstract function.' );
10431053

@@ -1211,11 +1221,11 @@ class NodeBuilder {
12111221
}
12121222

12131223
/**
1214-
* Whether the given texture needs a conversion to working color space.
1224+
* Checks if the given texture requires a manual conversion to the working color space.
12151225
*
12161226
* @abstract
12171227
* @param {Texture} texture - The texture to check.
1218-
* @return {Boolean} Whether a color space conversion is required or not.
1228+
* @return {Boolean} Whether the given texture requires a conversion to working color space or not.
12191229
*/
12201230
needsToWorkingColorSpace( /*texture*/ ) {
12211231

src/renderers/common/Backend.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,15 +317,16 @@ class Backend {
317317
* Returns texture data as a typed array.
318318
*
319319
* @abstract
320+
* @async
320321
* @param {Texture} texture - The texture to copy.
321322
* @param {Number} x - The x coordinate of the copy origin.
322323
* @param {Number} y - The y coordinate of the copy origin.
323324
* @param {Number} width - The width of the copy.
324325
* @param {Number} height - The height of the copy.
325326
* @param {Number} faceIndex - The face index.
326-
* @return {TypedArray} The texture data as a typed array.
327+
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
327328
*/
328-
copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}
329+
async copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}
329330

330331
/**
331332
* Copies data of the given source texture to the given destination texture.

src/renderers/webgl-fallback/WebGLBackend.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,15 +1161,16 @@ class WebGLBackend extends Backend {
11611161
/**
11621162
* Returns texture data as a typed array.
11631163
*
1164+
* @async
11641165
* @param {Texture} texture - The texture to copy.
11651166
* @param {Number} x - The x coordinate of the copy origin.
11661167
* @param {Number} y - The y coordinate of the copy origin.
11671168
* @param {Number} width - The width of the copy.
11681169
* @param {Number} height - The height of the copy.
11691170
* @param {Number} faceIndex - The face index.
1170-
* @return {TypedArray} The texture data as a typed array.
1171+
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
11711172
*/
1172-
copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {
1173+
async copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {
11731174

11741175
return this.textureUtils.copyTextureToBuffer( texture, x, y, width, height, faceIndex );
11751176

0 commit comments

Comments
 (0)