Skip to main content
Version: Next

Interface: CameraShaderBindings

Defined in: react-native/webgpu/cameraShaderBindings.ts:93

Everything a fragment shader needs to sample the live camera. Build once at setup with createCameraShaderBindings; the fields are safe to capture into the frame worklet.

Properties​

bindGroupIndex​

readonly bindGroupIndex: number

Defined in: react-native/webgpu/cameraShaderBindings.ts:111

The group index the bindings are declared at.


bindGroupLayout​

readonly bindGroupLayout: GPUBindGroupLayout

Defined in: react-native/webgpu/cameraShaderBindings.ts:107

Layout of the camera bind group; place it at bindGroupIndex in your pipeline layout.


bindingDeclarations​

readonly bindingDeclarations: string

Defined in: react-native/webgpu/cameraShaderBindings.ts:105

WGSL declaring the camera texture_external and sampler at bindGroupIndex. TypeGPU cannot emit an external-texture binding, so prepend this to the WGSL your shader resolves to.


cameraPixelLayout​

readonly cameraPixelLayout: CameraPixelLayout

Defined in: react-native/webgpu/cameraShaderBindings.ts:100

The pixel layout the sampler decodes.


sampleCamera​

readonly sampleCamera: SampleCameraFn

Defined in: react-native/webgpu/cameraShaderBindings.ts:98

The camera sampler as a TypeGPU function — call sampleCamera(uv) from your TGSL fragment shader. Same value as sampleCameraForPixelLayout for cameraPixelLayout.


sampler​

readonly sampler: GPUSampler

Defined in: react-native/webgpu/cameraShaderBindings.ts:109

The linear-filtering sampler bound at binding 1.