Răsfoiți Sursa

Backend: Document missing interface method. (#30250)

Michael Herzog 1 an în urmă
părinte
comite
12095d21b3

+ 10 - 0
src/renderers/common/Backend.js

@@ -453,6 +453,16 @@ class Backend {
 	 */
 	async waitForGPU() {}
 
+	/**
+	 * This method performs a readback operation by moving buffer data from
+	 * a storage buffer attribute from the GPU to the CPU.
+	 *
+	 * @async
+	 * @param {StorageBufferAttribute} attribute - The storage buffer attribute.
+	 * @return {Promise<ArrayBuffer>} A promise that resolves with the buffer data when the data are ready.
+	 */
+	async getArrayBufferAsync( /* attribute */ ) {}
+
 	/**
 	 * Checks if the given feature is supported by the backend.
 	 *

+ 2 - 2
src/renderers/webgl-fallback/WebGLBackend.js

@@ -258,8 +258,8 @@ class WebGLBackend extends Backend {
 	}
 
 	/**
-	 * Transfers buffer data from a storage buffer attribute
-	 * from the GPU to the CPU in context of compute shaders.
+	 * This method performs a readback operation by moving buffer data from
+	 * a storage buffer attribute from the GPU to the CPU.
 	 *
 	 * @async
 	 * @param {StorageBufferAttribute} attribute - The storage buffer attribute.

+ 2 - 2
src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js

@@ -249,8 +249,8 @@ class WebGLAttributeUtils {
 	}
 
 	/**
-	 * Transfers buffer data from a storage buffer attribute
-	 * from the GPU to the CPU in context of compute shaders.
+	 * This method performs a readback operation by moving buffer data from
+	 * a storage buffer attribute from the GPU to the CPU.
 	 *
 	 * @async
 	 * @param {StorageBufferAttribute} attribute - The storage buffer attribute.

+ 2 - 2
src/renderers/webgpu/WebGPUBackend.js

@@ -253,8 +253,8 @@ class WebGPUBackend extends Backend {
 	}
 
 	/**
-	 * Transfers buffer data from a storage buffer attribute
-	 * from the GPU to the CPU in context of compute shaders.
+	 * This method performs a readback operation by moving buffer data from
+	 * a storage buffer attribute from the GPU to the CPU.
 	 *
 	 * @async
 	 * @param {StorageBufferAttribute} attribute - The storage buffer attribute.

+ 2 - 2
src/renderers/webgpu/utils/WebGPUAttributeUtils.js

@@ -260,8 +260,8 @@ class WebGPUAttributeUtils {
 	}
 
 	/**
-	 * Transfers buffer data from a storage buffer attribute
-	 * from the GPU to the CPU in context of compute shaders.
+	 * This method performs a readback operation by moving buffer data from
+	 * a storage buffer attribute from the GPU to the CPU.
 	 *
 	 * @async
 	 * @param {StorageBufferAttribute} attribute - The storage buffer attribute.

粤ICP备19079148号