diff --git a/spec/index.bs b/spec/index.bs index fe0a3a94b0..7f7993cc2d 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -3372,12 +3372,49 @@ dictionary GPUExternalTextureDescriptor : GPUObjectDescriptorBase {
- Creating an external texture from a video element: + Rendering using an video element external texture at the page animation frame rate: +
-        const videoElement = document.querySelector('video');
-        const externalTexture = gpuDevice.importExternalTexture({
-            source: videoElement
-        });
+        const videoElement = document.createElement('video');
+        // ... set up videoElement, wait for it to be ready...
+
+        let externalTexture;
+
+        function frame() {
+            requestAnimationFrame(frame);
+
+            // Re-import only if necessary
+            if (!externalTexture || externalTexture.expired) {
+                externalTexture = gpuDevice.importExternalTexture({
+                    source: videoElement
+                });
+            }
+
+            // ... render using externalTexture...
+        }
+        requestAnimationFrame(frame);
+    
+
+ +
+ Rendering using an video element external texture at the video's frame rate, if + `requestVideoFrameCallback` is available: + +
+        const videoElement = document.createElement('video');
+        // ... set up videoElement...
+
+        function frame() {
+            videoElement.requestVideoFrameCallback(frame);
+
+            // Always re-import, because we know the video frame has advanced
+            const externalTexture = gpuDevice.importExternalTexture({
+                source: videoElement
+            });
+
+            // ... render using externalTexture...
+        }
+        videoElement.requestVideoFrameCallback(frame);