wgpu_ffi
library
Functions
textureFormatFromFfi (int value )
→ GpuTextureFormat
wgpu_create_surface (int device_handle , int width , int height )
→ int
Create a render surface with platform texture sharing.
Returns surface handle, or 0 on failure (check wgpu_get_last_error).
wgpu_create_surface_from_window (int _device_handle , Pointer <Void > _window_ptr , int _width , int _height )
→ int
Stub for non-Android - use wgpu_create_surface instead
wgpu_create_swapchain_surface (int _device_handle , int _native_handle , int _width , int _height )
→ int
Stub for unsupported platforms.
wgpu_destroy_surface (int surface_id )
→ void
Destroy surface.
wgpu_get_last_error ()
→ Pointer <Char >
Get the last error message.
wgpu_get_pixel_buffer_ptr (int surface_id )
→ Pointer <Uint8 >
Get the pixel buffer pointer for a surface (Windows only).
wgpu_get_shared_handle (int surface_id )
→ int
Get the D3D11 shared handle for a surface (Windows only).
wgpu_get_surface_format (int surface_id )
→ int
Get the texture format of a surface (returns FFI texture format value).
wgpu_get_surface_handle (int surface_id )
→ int
Get the platform-specific texture handle for sharing.
wgpu_mark_frame_available (int _engine_handle , int _texture_id )
→ void
wgpu_resize_surface (int surface_id , int width , int height )
→ int
Resize surface. Returns 1 on success, 0 on failure.
wgpu_surface_copy_from_texture (int surface_id , int src_texture )
→ void
Copy from a GpuTexture to surface.
wgpu_surface_get_texture_view (int surface_id )
→ int
Get texture view for rendering to surface.
wgpu_surface_present (int surface_id )
→ void
Signal frame is ready for display.
wgpu_swapchain_clear (int surface_id , double r , double g , double b , double a )
→ void
Clear the swapchain to a solid color and present.
wgpu_swapchain_destroy (int surface_id )
→ void
Destroy a swapchain surface.
wgpu_swapchain_get_depth_view (int surface_id )
→ int
Get the depth texture view for a swapchain surface.
wgpu_swapchain_get_format (int surface_id )
→ int
Get the texture format of a swapchain surface.
Returns format enum value matching GpuTextureFormat index.
wgpu_swapchain_get_texture_view (int surface_id )
→ int
Acquire the next swapchain texture for rendering.
Returns texture view handle, or 0 if failed.
wgpu_swapchain_present (int surface_id )
→ void
Present the current swapchain frame.
wgpu_swapchain_resize (int surface_id , int width , int height )
→ int
Resize a swapchain surface.
Returns 1 on success, 0 on failure.
wgpuLastError ()
→ String ?
Get the last FFI error message, or null if no error.
wgpun_AdapterGetDownlevelFlags (int adapter )
→ int
Get adapter downlevel capability flags as a raw u64 bitmask.
wgpun_AdapterGetFeatures (int adapter )
→ int
Get adapter features as a bitmask.
Bit positions match GpuFeatureName enum order.
wgpun_AdapterGetInfo (int adapter )
→ WGPUAdapterInfo
Get adapter info.
wgpun_AdapterGetLimits (int adapter )
→ WGPUDeviceLimits
Get adapter limits.
wgpun_AdapterRelease (int adapter )
→ void
Release an adapter.
wgpun_AdapterRequestDevice (int adapter , Pointer <WGPUDeviceDescriptor > descriptor )
→ int
Request a device from an adapter.
Returns device handle, or 0 on failure.
wgpun_BindGroupLayoutRelease (int layout )
→ void
wgpun_BindGroupLayoutRelease_p (Pointer <Void > ptr )
→ void
wgpun_BindGroupRelease (int group )
→ void
wgpun_BindGroupRelease_p (Pointer <Void > ptr )
→ void
wgpun_BufferMapGetPointer (int handle )
→ Pointer <Uint8 >
wgpun_BufferMapGetPointerMut (int handle )
→ Pointer <Uint8 >
wgpun_BufferMapGetSize (int handle )
→ int
wgpun_BufferMappingRelease_p (Pointer <Void > ptr )
→ void
wgpun_BufferMapStart (int device , int buffer , int offset , int size , int mode )
→ int
wgpun_BufferMapStatus (int handle )
→ int
wgpun_BufferReadSync (int device , int buffer , int offset , int size , Pointer <Uint8 > output )
→ int
wgpun_BufferRelease (int buffer )
→ void
wgpun_BufferRelease_p (Pointer <Void > ptr )
→ void
wgpun_BufferUnmap (int handle , int _original_buffer_id )
→ void
wgpun_CommandEncoderBeginComputePass (int encoder , Pointer <WGPUComputePassDescriptor > descriptor )
→ int
wgpun_CommandEncoderBeginRenderPass (int encoder , Pointer <WGPURenderPassDescriptor > descriptor )
→ int
wgpun_CommandEncoderClearBuffer (int encoder , int buffer , int offset , int size )
→ int
wgpun_CommandEncoderCopyBufferToBuffer (int encoder , int source , int source_offset , int destination , int destination_offset , int size )
→ int
wgpun_CommandEncoderCopyBufferToTexture (int encoder , int buffer , int texture , int bytes_per_row , int rows_per_image , int width , int height , int depth , int mip_level , int origin_x , int origin_y , int origin_z )
→ int
wgpun_CommandEncoderCopyTextureToBuffer (int encoder , int texture , int buffer , int bytes_per_row , int rows_per_image , int width , int height , int depth , int mip_level , int origin_x , int origin_y , int origin_z )
→ int
wgpun_CommandEncoderCopyTextureToTexture (int encoder , int src_texture , int dst_texture , int width , int height , int depth , int src_mip_level , int src_origin_x , int src_origin_y , int src_origin_z , int dst_mip_level , int dst_origin_x , int dst_origin_y , int dst_origin_z )
→ int
wgpun_CommandEncoderFinish (int encoder )
→ int
wgpun_CommandEncoderInsertDebugMarker (int encoder , Pointer <Char > label )
→ void
wgpun_CommandEncoderPopDebugGroup (int encoder )
→ void
wgpun_CommandEncoderPushDebugGroup (int encoder , Pointer <Char > label )
→ void
wgpun_CommandEncoderResolveQuerySet (int encoder , int query_set , int first_query , int query_count , int destination , int destination_offset )
→ int
wgpun_CommandEncoderWriteTimestamp (int encoder , int query_set , int query_index )
→ int
wgpun_ComputePassEncoderDispatchWorkgroups (int compute_pass , int x , int y , int z )
→ void
wgpun_ComputePassEncoderDispatchWorkgroupsIndirect (int compute_pass , int indirect_buffer , int indirect_offset )
→ void
wgpun_ComputePassEncoderEnd (int compute_pass )
→ int
wgpun_ComputePassEncoderInsertDebugMarker (int compute_pass , Pointer <Char > label )
→ void
wgpun_ComputePassEncoderPopDebugGroup (int compute_pass )
→ void
wgpun_ComputePassEncoderPushDebugGroup (int compute_pass , Pointer <Char > label )
→ void
wgpun_ComputePassEncoderSetBindGroup (int compute_pass , int index , int bind_group , Pointer <Uint32 > dynamic_offsets , int dynamic_offset_count )
→ void
wgpun_ComputePassEncoderSetImmediates (int compute_pass , int offset , Pointer <Uint8 > data , int data_len )
→ void
wgpun_ComputePassEncoderSetPipeline (int compute_pass , int pipeline )
→ void
wgpun_ComputePipelineGetBindGroupLayout (int pipeline , int index )
→ int
wgpun_ComputePipelineRelease (int pipeline )
→ void
wgpun_ComputePipelineRelease_p (Pointer <Void > ptr )
→ void
wgpun_CreateInstance (Pointer <WGPUInstanceDescriptor > descriptor )
→ int
Create a wgpu instance.
Returns instance handle, or 0 on failure.
wgpun_DeviceCreateBindGroup (int device , Pointer <WGPUBindGroupDescriptor > desc )
→ int
wgpun_DeviceCreateBindGroupLayout (int device , Pointer <WGPUBindGroupLayoutDescriptor > desc )
→ int
wgpun_DeviceCreateBuffer (int device , Pointer <WGPUBufferDescriptor > descriptor )
→ int
wgpun_DeviceCreateCommandEncoder (int device , Pointer <Char > label )
→ int
wgpun_DeviceCreateComputePipeline (int device , Pointer <WGPUComputePipelineDescriptor > desc )
→ int
wgpun_DeviceCreatePipelineLayout (int device , Pointer <WGPUPipelineLayoutDescriptor > desc )
→ int
wgpun_DeviceCreateQuerySet (int device , int query_type , int count , Pointer <Char > label )
→ int
wgpun_DeviceCreateRenderBundleEncoder (int device , Pointer <WGPURenderBundleEncoderDescriptor > descriptor )
→ int
wgpun_DeviceCreateRenderPipeline (int device , Pointer <WGPURenderPipelineDescriptor > desc )
→ int
wgpun_DeviceCreateSampler (int device , Pointer <WGPUSamplerDescriptor > descriptor )
→ int
wgpun_DeviceCreateShaderModule (int device , Pointer <Uint8 > source , int source_len , Pointer <Char > label )
→ int
wgpun_DeviceCreateTexture (int device , Pointer <WGPUTextureDescriptor > descriptor )
→ int
wgpun_DeviceGetFeatures (int device )
→ int
Get device features as a bitmask.
Bit positions match GpuFeatureName enum order.
wgpun_DeviceGetLimits (int device )
→ WGPUDeviceLimits
Get device limits.
wgpun_DeviceGetQueue (int device )
→ int
Get the queue for a device.
Returns queue handle (a heap-allocated Arc
wgpun_DevicePoll (int device , int wait )
→ void
Poll a device for completed work.
wgpun_DevicePopError (int device )
→ Pointer <Char >
Pop one captured device error.
Returns null if the error queue is empty.
wgpun_DevicePopErrorScope (int device )
→ int
Pop the top error scope and return the error type + message.
Returns error type: 0 = no error, 1 = Validation, 2 = OutOfMemory, 3 = Internal.
If an error was captured, the message is available via wgpun_DevicePopScopeError.
wgpun_DevicePushErrorScope (int device , int filter )
→ void
Push an error scope onto the device's error scope stack.
filter: 1 = Validation, 2 = OutOfMemory, 3 = Internal
wgpun_DeviceRelease (int device )
→ void
Release a device.
wgpun_FenceRelease (int handle )
→ void
wgpun_FenceRelease_p (Pointer <Void > ptr )
→ void
wgpun_FenceStatus (int device , int handle )
→ int
wgpun_FenceWait (int device , int handle )
→ int
wgpun_InstanceGetWGSLLanguageFeatures (int instance )
→ int
Get WGSL language features supported by this instance.
Returns a bitmask matching GpuWgslLanguageFeatureName enum order.
wgpun_InstanceRelease (int instance )
→ void
Release an instance.
wgpun_InstanceRequestAdapter (int instance , Pointer <WGPURequestAdapterOptions > options )
→ int
Request an adapter from an instance.
Returns adapter handle, or 0 on failure.
wgpun_PipelineLayoutRelease (int layout )
→ void
wgpun_PipelineLayoutRelease_p (Pointer <Void > ptr )
→ void
wgpun_QuerySetRelease (int query_set )
→ void
wgpun_QuerySetRelease_p (Pointer <Void > ptr )
→ void
wgpun_QueueGetTimestampPeriod (int queue )
→ double
wgpun_QueueSubmit (int queue , Pointer <Uint64 > command_buffers , int count )
→ void
wgpun_QueueSubmitFenced (int queue , Pointer <Uint64 > command_buffers , int count )
→ int
wgpun_QueueWriteBuffer (int queue , int buffer , int offset , Pointer <Uint8 > data , int size )
→ void
wgpun_QueueWriteTexture (int queue , int texture , Pointer <Uint8 > data , int data_size , int bytes_per_row , int width , int height , int depth_or_array_layers , int mip_level , int origin_x , int origin_y , int origin_z , int aspect , int rows_per_image )
→ void
wgpun_RenderBundleEncoderDraw (int encoder , int vertex_count , int instance_count , int first_vertex , int first_instance )
→ void
wgpun_RenderBundleEncoderDrawIndexed (int encoder , int index_count , int instance_count , int first_index , int base_vertex , int first_instance )
→ void
wgpun_RenderBundleEncoderDrawIndexedIndirect (int encoder , int indirect_buffer , int indirect_offset )
→ void
wgpun_RenderBundleEncoderDrawIndirect (int encoder , int indirect_buffer , int indirect_offset )
→ void
wgpun_RenderBundleEncoderFinish (int encoder , Pointer <Char > label )
→ int
wgpun_RenderBundleEncoderSetBindGroup (int encoder , int index , int bind_group , Pointer <Uint32 > dynamic_offsets , int dynamic_offset_count )
→ void
wgpun_RenderBundleEncoderSetImmediates (int encoder , int offset , Pointer <Uint8 > data , int data_len )
→ void
wgpun_RenderBundleEncoderSetIndexBuffer (int encoder , int buffer , int format , int offset , int size )
→ void
wgpun_RenderBundleEncoderSetPipeline (int encoder , int pipeline )
→ void
wgpun_RenderBundleEncoderSetVertexBuffer (int encoder , int slot , int buffer , int offset , int size )
→ void
wgpun_RenderBundleRelease (int bundle )
→ void
wgpun_RenderBundleRelease_p (Pointer <Void > ptr )
→ void
wgpun_RenderPassEncoderBeginOcclusionQuery (int render_pass , int query_index )
→ void
wgpun_RenderPassEncoderDraw (int render_pass , int vertex_count , int instance_count , int first_vertex , int first_instance )
→ void
wgpun_RenderPassEncoderDrawIndexed (int render_pass , int index_count , int instance_count , int first_index , int base_vertex , int first_instance )
→ void
wgpun_RenderPassEncoderDrawIndexedIndirect (int render_pass , int indirect_buffer , int indirect_offset )
→ void
wgpun_RenderPassEncoderDrawIndirect (int render_pass , int indirect_buffer , int indirect_offset )
→ void
wgpun_RenderPassEncoderEnd (int render_pass )
→ int
wgpun_RenderPassEncoderEndOcclusionQuery (int render_pass )
→ void
wgpun_RenderPassEncoderInsertDebugMarker (int render_pass , Pointer <Char > label )
→ void
wgpun_RenderPassEncoderMultiDrawIndexedIndirect (int render_pass , int indirect_buffer , int indirect_offset , int count )
→ void
wgpun_RenderPassEncoderPopDebugGroup (int render_pass )
→ void
wgpun_RenderPassEncoderPushDebugGroup (int render_pass , Pointer <Char > label )
→ void
wgpun_RenderPassEncoderSetBindGroup (int render_pass , int index , int bind_group , Pointer <Uint32 > dynamic_offsets , int dynamic_offset_count )
→ void
wgpun_RenderPassEncoderSetBlendConstant (int render_pass , double r , double g , double b , double a )
→ void
wgpun_RenderPassEncoderSetImmediates (int render_pass , int offset , Pointer <Uint8 > data , int data_len )
→ void
wgpun_RenderPassEncoderSetIndexBuffer (int render_pass , int buffer , int format , int offset , int size )
→ void
wgpun_RenderPassEncoderSetPipeline (int render_pass , int pipeline )
→ void
wgpun_RenderPassEncoderSetScissorRect (int render_pass , int x , int y , int width , int height )
→ void
wgpun_RenderPassEncoderSetStencilReference (int render_pass , int reference )
→ void
wgpun_RenderPassEncoderSetVertexBuffer (int render_pass , int slot , int buffer , int offset , int size )
→ void
wgpun_RenderPassEncoderSetViewport (int render_pass , double x , double y , double width , double height , double min_depth , double max_depth )
→ void
wgpun_RenderPassExecuteBundles (int render_pass , Pointer <Uint64 > bundles , int count )
→ void
wgpun_RenderPipelineGetBindGroupLayout (int pipeline , int index )
→ int
wgpun_RenderPipelineRelease (int pipeline )
→ void
wgpun_RenderPipelineRelease_p (Pointer <Void > ptr )
→ void
wgpun_SamplerRelease (int sampler )
→ void
wgpun_SamplerRelease_p (Pointer <Void > ptr )
→ void
wgpun_ShaderModuleGetCompilationInfo (int module )
→ Pointer <Char >
wgpun_ShaderModuleRelease (int module )
→ void
wgpun_ShaderModuleRelease_p (Pointer <Void > ptr )
→ void
wgpun_TextureCreateView (int texture , Pointer <WGPUTextureViewDescriptor > descriptor )
→ int
wgpun_TextureRelease (int texture )
→ void
wgpun_TextureRelease_p (Pointer <Void > ptr )
→ void
wgpun_TextureViewRelease (int view )
→ void
wgpun_TextureViewRelease_p (Pointer <Void > ptr )
→ void