|
|
@@ -124,6 +124,26 @@ class WebGPUUtils {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Returns the GPU formats of all color attachments of the current render context.
|
|
|
+ *
|
|
|
+ * @param {RenderContext} renderContext - The render context.
|
|
|
+ * @return {Array<string>} The GPU texture formats of all color attachments.
|
|
|
+ */
|
|
|
+ getCurrentColorFormats( renderContext ) {
|
|
|
+
|
|
|
+ if ( renderContext.textures !== null ) {
|
|
|
+
|
|
|
+ return renderContext.textures.map( t => this.getTextureFormatGPU( t ) );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return [ this.getPreferredCanvasFormat() ]; // default context format
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Returns the output color space of the current render context.
|
|
|
*
|