Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renderer: Document more modules. #30246

Merged
merged 5 commits into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/nodes/core/NodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,15 @@ class NodeBuilder {

}

/**
* Returns the output struct name which is required by
* {@link module:OutputStructNode}.
*
* @abstract
* @return {String} The name of the output struct.
*/
getOutputStructName() {}

/**
* Returns a bind group for the given group name and binding.
*
Expand Down Expand Up @@ -1034,10 +1043,11 @@ class NodeBuilder {
* @param {Texture} texture - The texture.
* @param {String} textureProperty - The texture property name.
* @param {String} uvSnippet - Snippet defining the texture coordinates.
* @param {String?} depthSnippet - Snippet defining the 0-based texture array index to sample.
* @param {String} levelSnippet - Snippet defining the mip level.
* @return {String} The generated shader string.
*/
generateTextureLod( /* texture, textureProperty, uvSnippet, levelSnippet */ ) {
generateTextureLod( /* texture, textureProperty, uvSnippet, depthSnippet, levelSnippet */ ) {

console.warn( 'Abstract function.' );

Expand Down Expand Up @@ -1211,11 +1221,11 @@ class NodeBuilder {
}

/**
* Whether the given texture needs a conversion to working color space.
* Checks if the given texture requires a manual conversion to the working color space.
*
* @abstract
* @param {Texture} texture - The texture to check.
* @return {Boolean} Whether a color space conversion is required or not.
* @return {Boolean} Whether the given texture requires a conversion to working color space or not.
*/
needsToWorkingColorSpace( /*texture*/ ) {

Expand Down
5 changes: 3 additions & 2 deletions src/renderers/common/Backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,16 @@ class Backend {
* Returns texture data as a typed array.
*
* @abstract
* @async
* @param {Texture} texture - The texture to copy.
* @param {Number} x - The x coordinate of the copy origin.
* @param {Number} y - The y coordinate of the copy origin.
* @param {Number} width - The width of the copy.
* @param {Number} height - The height of the copy.
* @param {Number} faceIndex - The face index.
* @return {TypedArray} The texture data as a typed array.
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
*/
copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}
async copyTextureToBuffer( /*texture, x, y, width, height, faceIndex*/ ) {}

/**
* Copies data of the given source texture to the given destination texture.
Expand Down
5 changes: 3 additions & 2 deletions src/renderers/webgl-fallback/WebGLBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1161,15 +1161,16 @@ class WebGLBackend extends Backend {
/**
* Returns texture data as a typed array.
*
* @async
* @param {Texture} texture - The texture to copy.
* @param {Number} x - The x coordinate of the copy origin.
* @param {Number} y - The y coordinate of the copy origin.
* @param {Number} width - The width of the copy.
* @param {Number} height - The height of the copy.
* @param {Number} faceIndex - The face index.
* @return {TypedArray} The texture data as a typed array.
* @return {Promise<TypedArray>} A Promise that resolves with a typed array when the copy operation has finished.
*/
copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {
async copyTextureToBuffer( texture, x, y, width, height, faceIndex ) {

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

Expand Down
Loading
Loading