|
@@ -42,6 +42,7 @@ class WebGPUTextureUtils {
|
|
|
|
|
|
this.defaultTexture = {};
|
|
|
this.defaultCubeTexture = {};
|
|
|
+ this.defaultVideoFrame = null;
|
|
|
|
|
|
this.colorBuffer = null;
|
|
|
|
|
@@ -87,6 +88,10 @@ class WebGPUTextureUtils {
|
|
|
|
|
|
textureGPU = this._getDefaultCubeTextureGPU( format );
|
|
|
|
|
|
+ } else if ( texture.isVideoTexture ) {
|
|
|
+
|
|
|
+ this.backend.get( texture ).externalTexture = this._getDefaultVideoFrame();
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
textureGPU = this._getDefaultTextureGPU( format );
|
|
@@ -455,6 +460,27 @@ class WebGPUTextureUtils {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ _getDefaultVideoFrame() {
|
|
|
+
|
|
|
+ let defaultVideoFrame = this.defaultVideoFrame;
|
|
|
+
|
|
|
+ if ( defaultVideoFrame === null ) {
|
|
|
+
|
|
|
+ const init = {
|
|
|
+ timestamp: 0,
|
|
|
+ codedWidth: 1,
|
|
|
+ codedHeight: 1,
|
|
|
+ format: 'RGBA',
|
|
|
+ };
|
|
|
+
|
|
|
+ this.defaultVideoFrame = defaultVideoFrame = new VideoFrame( new Uint8Array( [ 0, 0, 0, 0xff ] ), init );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return defaultVideoFrame;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
_copyCubeMapToTexture( images, textureGPU, textureDescriptorGPU, flipY ) {
|
|
|
|
|
|
for ( let i = 0; i < 6; i ++ ) {
|