From 5d45d9f28906b4c100a719090022fa420ff6551c Mon Sep 17 00:00:00 2001 From: William Candillon Date: Fri, 25 Oct 2024 15:28:08 +0200 Subject: [PATCH] :wrench: --- packages/webgpu/src/Canvas.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/webgpu/src/Canvas.tsx b/packages/webgpu/src/Canvas.tsx index 861fbd74..dfaf1a0f 100644 --- a/packages/webgpu/src/Canvas.tsx +++ b/packages/webgpu/src/Canvas.tsx @@ -49,6 +49,7 @@ export type RNCanvasContext = GPUCanvasContext & { }; export interface CanvasRef { + getContextId: () => number; getContext(contextName: "webgpu"): RNCanvasContext | null; getNativeSurface: () => NativeCanvas; whenReady: (callback: () => void) => void; @@ -105,6 +106,7 @@ export const Canvas = forwardRef< } }, [size]); useImperativeHandle(ref, () => ({ + getContextId: () => contextId, getNativeSurface: () => { if (size === null) { throw new Error("[WebGPU] Canvas size is not available yet");