Interface WgpuBindings
- All Known Implementing Classes:
TracingWgpuBindings
public interface WgpuBindings
Abstraction over WebGPU native bindings.
All WebGPU objects are represented as opaque long handles.
Implementations convert between these handles and their concrete wrapper
types (e.g. jWebGPU's WGPUDevice).
The interface mirrors the WebGPU API at a level of abstraction suitable for the engine's render device. Descriptor-heavy WebGPU calls are flattened into method parameters to avoid leaking provider-specific descriptor types.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordDescribes a bind group entry for buffer binding.static final recordDescribes a bind group layout entry.static enumTypes of bind group entry resources.static enumTypes of bind group layout entries.static final recordDescribes a color attachment for a render pass.static final recordDescribes a depth/stencil attachment for a render pass.static final recordDevice limits queried from the GPU.static final recordDescribes a render pass.static final recordDescribes a render pipeline.static final recordDescribes stencil face state.static final recordDescribes a vertex attribute.static final recordDescribes vertex buffer layout for pipeline creation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intPresent mode for surface configuration.static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionvoidadapterRelease(long adapter) Releases the adapter.longadapterRequestDevice(long instance, long adapter) Requests a device from the adapter (synchronous).voidbindGroupLayoutRelease(long bindGroupLayout) Releases a bind group layout.voidbindGroupRelease(long bindGroup) Releases a bind group.voidbufferGetConstMappedRange(long buffer, int offset, int size, ByteBuffer dest) Gets the mapped range of a buffer into the provided direct ByteBuffer.voidbufferMapReadSync(long instance, long buffer, int size, int maxPolls) Maps a buffer for reading (synchronous, polls instance events).voidbufferRelease(long buffer) Releases a buffer.voidbufferUnmap(long buffer) Unmaps a previously mapped buffer.voidcommandBufferRelease(long commandBuffer) Releases a command buffer.longcommandEncoderBeginRenderPass(long encoder, WgpuBindings.RenderPassDescriptor desc) Begins a render pass on the command encoder.voidcommandEncoderCopyBufferToBuffer(long encoder, long src, int srcOffset, long dst, int dstOffset, int size) Copies data between buffers.voidcommandEncoderCopyTextureToBuffer(long encoder, long texture, long buffer, int width, int height, int bytesPerRow, int rowsPerImage) Copies a texture to a buffer.longcommandEncoderFinish(long encoder) Finishes the command encoder, producing a command buffer.voidcommandEncoderRelease(long encoder) Releases a command encoder.default longconfigureSurface(long instance, long device, WindowHandle window) Configures a presentation surface for the given window.longCreates a WebGPU instance.longdeviceCreateBindGroup(long device, long layout, WgpuBindings.BindGroupEntry[] entries) Creates a bind group.longdeviceCreateBindGroupLayout(long device, WgpuBindings.BindGroupLayoutEntry[] entries) Creates a bind group layout with the given entries.longdeviceCreateBuffer(long device, long size, int usage) Creates a GPU buffer.longdeviceCreateCommandEncoder(long device) Creates a command encoder.longdeviceCreatePipelineLayout(long device, long[] bindGroupLayouts) Creates a pipeline layout from bind group layouts.longdeviceCreateRenderPipeline(long device, WgpuBindings.RenderPipelineDescriptor desc) Creates a render pipeline.longdeviceCreateSampler(long device, int addressU, int addressV, int addressW, int magFilter, int minFilter, int mipmapFilter, float lodMinClamp, float lodMaxClamp, int compare, float maxAnisotropy) Creates a sampler.longdeviceCreateShaderModule(long device, String wgsl) Creates a shader module from WGSL source.longdeviceCreateTexture(long device, int width, int height, int depthOrLayers, int format, int dimension, int usage) Creates a texture.default WgpuBindings.DeviceLimitsdeviceGetLimits(long device) Queries device limits.longdeviceGetQueue(long device) Gets the device's queue.voiddeviceRelease(long device) Releases the device.default longgetSurfaceTextureView(long surface) Gets the current surface texture view for rendering.default booleanReturns true if a presentation surface is available.booleanInitializes the WebGPU loader/library.voidinstanceProcessEvents(long instance) Processes pending events on the instance.voidinstanceRelease(long instance) Releases the instance.longinstanceRequestAdapter(long instance) Requests an adapter from the instance (synchronous).booleanReturns true if the native WebGPU library is available.voidpipelineLayoutRelease(long pipelineLayout) Releases a pipeline layout.voidqueueSubmit(long queue, long commandBuffer) Submits a command buffer to the queue.voidqueueWriteBuffer(long queue, long buffer, int offset, ByteBuffer data, int size) Writes data to a buffer via the queue.voidqueueWriteTexture(long queue, long texture, int width, int height, int depthOrLayers, int bytesPerRow, ByteBuffer data) Writes pixel data to a texture via the queue.default voidreleaseSurfaceTextureView(long textureView) Releases a surface texture view obtained from getSurfaceTextureView.voidrenderPassDraw(long renderPass, int vertexCount, int instanceCount, int firstVertex, int firstInstance) Draws primitives.voidrenderPassDrawIndexed(long renderPass, int indexCount, int instanceCount, int firstIndex, int baseVertex, int firstInstance) Draws indexed primitives.voidrenderPassEnd(long renderPass) Ends the render pass.voidrenderPassRelease(long renderPass) Releases the render pass encoder.voidrenderPassSetBindGroup(long renderPass, int groupIndex, long bindGroup) Sets the bind group on the render pass.voidrenderPassSetIndexBuffer(long renderPass, long buffer, int indexFormat, int offset, int size) Sets the index buffer on the render pass.voidrenderPassSetPipeline(long renderPass, long pipeline) Sets the pipeline on the render pass.voidrenderPassSetScissorRect(long renderPass, int x, int y, int width, int height) Sets the scissor rect on the render pass.voidrenderPassSetStencilReference(long renderPass, int ref) Sets the stencil reference on the render pass.voidrenderPassSetVertexBuffer(long renderPass, int slot, long buffer, int offset, int size) Sets a vertex buffer on the render pass.voidrenderPassSetViewport(long renderPass, float x, float y, float w, float h, float minDepth, float maxDepth) Sets the viewport on the render pass.voidrenderPipelineRelease(long renderPipeline) Releases a render pipeline.voidsamplerRelease(long sampler) Releases a sampler.default voidsetPresentMode(int mode) Sets the present mode for surface configuration.booleanshaderModuleIsValid(long shaderModule) Returns true if the shader module handle is valid.voidshaderModuleRelease(long shaderModule) Releases a shader module.default intReturns the texture format used by the presentation surface.default voidsurfacePresent(long surface) Presents the current surface texture to the screen.longtextureCreateView(long texture, int format, int viewDimension, int arrayLayerCount) Creates a texture view.voidtextureRelease(long texture) Releases a texture.voidtextureViewRelease(long textureView) Releases a texture view.
-
Field Details
-
PRESENT_MODE_FIFO
static final int PRESENT_MODE_FIFOPresent mode for surface configuration. 0 = FIFO (vsync), 1 = Immediate, 2 = Mailbox.- See Also:
-
PRESENT_MODE_IMMEDIATE
static final int PRESENT_MODE_IMMEDIATE- See Also:
-
PRESENT_MODE_MAILBOX
static final int PRESENT_MODE_MAILBOX- See Also:
-
BUFFER_USAGE_COPY_SRC
static final int BUFFER_USAGE_COPY_SRC- See Also:
-
BUFFER_USAGE_COPY_DST
static final int BUFFER_USAGE_COPY_DST- See Also:
-
BUFFER_USAGE_INDEX
static final int BUFFER_USAGE_INDEX- See Also:
-
BUFFER_USAGE_VERTEX
static final int BUFFER_USAGE_VERTEX- See Also:
-
BUFFER_USAGE_UNIFORM
static final int BUFFER_USAGE_UNIFORM- See Also:
-
BUFFER_USAGE_STORAGE
static final int BUFFER_USAGE_STORAGE- See Also:
-
BUFFER_USAGE_MAP_READ
static final int BUFFER_USAGE_MAP_READ- See Also:
-
TEXTURE_USAGE_COPY_SRC
static final int TEXTURE_USAGE_COPY_SRC- See Also:
-
TEXTURE_USAGE_COPY_DST
static final int TEXTURE_USAGE_COPY_DST- See Also:
-
TEXTURE_USAGE_TEXTURE_BINDING
static final int TEXTURE_USAGE_TEXTURE_BINDING- See Also:
-
TEXTURE_USAGE_RENDER_ATTACHMENT
static final int TEXTURE_USAGE_RENDER_ATTACHMENT- See Also:
-
INDEX_FORMAT_UINT32
static final int INDEX_FORMAT_UINT32- See Also:
-
SHADER_STAGE_VERTEX
static final int SHADER_STAGE_VERTEX- See Also:
-
SHADER_STAGE_FRAGMENT
static final int SHADER_STAGE_FRAGMENT- See Also:
-
PRIMITIVE_TOPOLOGY_TRIANGLE_LIST
static final int PRIMITIVE_TOPOLOGY_TRIANGLE_LIST- See Also:
-
FRONT_FACE_CCW
static final int FRONT_FACE_CCW- See Also:
-
FRONT_FACE_CW
static final int FRONT_FACE_CW- See Also:
-
CULL_MODE_NONE
static final int CULL_MODE_NONE- See Also:
-
CULL_MODE_FRONT
static final int CULL_MODE_FRONT- See Also:
-
CULL_MODE_BACK
static final int CULL_MODE_BACK- See Also:
-
COMPARE_NEVER
static final int COMPARE_NEVER- See Also:
-
COMPARE_LESS
static final int COMPARE_LESS- See Also:
-
COMPARE_EQUAL
static final int COMPARE_EQUAL- See Also:
-
COMPARE_LESS_EQUAL
static final int COMPARE_LESS_EQUAL- See Also:
-
COMPARE_GREATER
static final int COMPARE_GREATER- See Also:
-
COMPARE_NOT_EQUAL
static final int COMPARE_NOT_EQUAL- See Also:
-
COMPARE_GREATER_EQUAL
static final int COMPARE_GREATER_EQUAL- See Also:
-
COMPARE_ALWAYS
static final int COMPARE_ALWAYS- See Also:
-
STENCIL_OP_KEEP
static final int STENCIL_OP_KEEP- See Also:
-
STENCIL_OP_ZERO
static final int STENCIL_OP_ZERO- See Also:
-
STENCIL_OP_REPLACE
static final int STENCIL_OP_REPLACE- See Also:
-
STENCIL_OP_INVERT
static final int STENCIL_OP_INVERT- See Also:
-
STENCIL_OP_INCREMENT_CLAMP
static final int STENCIL_OP_INCREMENT_CLAMP- See Also:
-
STENCIL_OP_DECREMENT_CLAMP
static final int STENCIL_OP_DECREMENT_CLAMP- See Also:
-
STENCIL_OP_INCREMENT_WRAP
static final int STENCIL_OP_INCREMENT_WRAP- See Also:
-
STENCIL_OP_DECREMENT_WRAP
static final int STENCIL_OP_DECREMENT_WRAP- See Also:
-
OPTIONAL_BOOL_FALSE
static final int OPTIONAL_BOOL_FALSE- See Also:
-
OPTIONAL_BOOL_TRUE
static final int OPTIONAL_BOOL_TRUE- See Also:
-
BLEND_FACTOR_ZERO
static final int BLEND_FACTOR_ZERO- See Also:
-
BLEND_FACTOR_ONE
static final int BLEND_FACTOR_ONE- See Also:
-
BLEND_FACTOR_SRC
static final int BLEND_FACTOR_SRC- See Also:
-
BLEND_FACTOR_ONE_MINUS_SRC
static final int BLEND_FACTOR_ONE_MINUS_SRC- See Also:
-
BLEND_FACTOR_SRC_ALPHA
static final int BLEND_FACTOR_SRC_ALPHA- See Also:
-
BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
static final int BLEND_FACTOR_ONE_MINUS_SRC_ALPHA- See Also:
-
BLEND_FACTOR_DST
static final int BLEND_FACTOR_DST- See Also:
-
BLEND_FACTOR_ONE_MINUS_DST
static final int BLEND_FACTOR_ONE_MINUS_DST- See Also:
-
BLEND_FACTOR_DST_ALPHA
static final int BLEND_FACTOR_DST_ALPHA- See Also:
-
BLEND_FACTOR_ONE_MINUS_DST_ALPHA
static final int BLEND_FACTOR_ONE_MINUS_DST_ALPHA- See Also:
-
BLEND_OP_ADD
static final int BLEND_OP_ADD- See Also:
-
BLEND_OP_SUBTRACT
static final int BLEND_OP_SUBTRACT- See Also:
-
BLEND_OP_REVERSE_SUBTRACT
static final int BLEND_OP_REVERSE_SUBTRACT- See Also:
-
BLEND_OP_MIN
static final int BLEND_OP_MIN- See Also:
-
BLEND_OP_MAX
static final int BLEND_OP_MAX- See Also:
-
TEXTURE_FORMAT_R8_UNORM
static final int TEXTURE_FORMAT_R8_UNORM- See Also:
-
TEXTURE_FORMAT_RGBA8_UNORM
static final int TEXTURE_FORMAT_RGBA8_UNORM- See Also:
-
TEXTURE_FORMAT_BGRA8_UNORM
static final int TEXTURE_FORMAT_BGRA8_UNORM- See Also:
-
TEXTURE_FORMAT_R16_FLOAT
static final int TEXTURE_FORMAT_R16_FLOAT- See Also:
-
TEXTURE_FORMAT_RG16_FLOAT
static final int TEXTURE_FORMAT_RG16_FLOAT- See Also:
-
TEXTURE_FORMAT_RGBA16_FLOAT
static final int TEXTURE_FORMAT_RGBA16_FLOAT- See Also:
-
TEXTURE_FORMAT_R32_FLOAT
static final int TEXTURE_FORMAT_R32_FLOAT- See Also:
-
TEXTURE_FORMAT_RG32_FLOAT
static final int TEXTURE_FORMAT_RG32_FLOAT- See Also:
-
TEXTURE_FORMAT_RGBA32_FLOAT
static final int TEXTURE_FORMAT_RGBA32_FLOAT- See Also:
-
TEXTURE_FORMAT_R32_UINT
static final int TEXTURE_FORMAT_R32_UINT- See Also:
-
TEXTURE_FORMAT_R32_SINT
static final int TEXTURE_FORMAT_R32_SINT- See Also:
-
TEXTURE_FORMAT_DEPTH24_PLUS
static final int TEXTURE_FORMAT_DEPTH24_PLUS- See Also:
-
TEXTURE_FORMAT_DEPTH24_PLUS_STENCIL8
static final int TEXTURE_FORMAT_DEPTH24_PLUS_STENCIL8- See Also:
-
TEXTURE_FORMAT_DEPTH32_FLOAT
static final int TEXTURE_FORMAT_DEPTH32_FLOAT- See Also:
-
TEXTURE_DIMENSION_2D
static final int TEXTURE_DIMENSION_2D- See Also:
-
TEXTURE_DIMENSION_3D
static final int TEXTURE_DIMENSION_3D- See Also:
-
TEXTURE_VIEW_DIMENSION_2D
static final int TEXTURE_VIEW_DIMENSION_2D- See Also:
-
TEXTURE_VIEW_DIMENSION_2D_ARRAY
static final int TEXTURE_VIEW_DIMENSION_2D_ARRAY- See Also:
-
TEXTURE_VIEW_DIMENSION_CUBE
static final int TEXTURE_VIEW_DIMENSION_CUBE- See Also:
-
TEXTURE_VIEW_DIMENSION_3D
static final int TEXTURE_VIEW_DIMENSION_3D- See Also:
-
FILTER_MODE_NEAREST
static final int FILTER_MODE_NEAREST- See Also:
-
FILTER_MODE_LINEAR
static final int FILTER_MODE_LINEAR- See Also:
-
MIPMAP_FILTER_MODE_NEAREST
static final int MIPMAP_FILTER_MODE_NEAREST- See Also:
-
MIPMAP_FILTER_MODE_LINEAR
static final int MIPMAP_FILTER_MODE_LINEAR- See Also:
-
ADDRESS_MODE_CLAMP_TO_EDGE
static final int ADDRESS_MODE_CLAMP_TO_EDGE- See Also:
-
ADDRESS_MODE_REPEAT
static final int ADDRESS_MODE_REPEAT- See Also:
-
ADDRESS_MODE_MIRROR_REPEAT
static final int ADDRESS_MODE_MIRROR_REPEAT- See Also:
-
VERTEX_FORMAT_UNORM8X4
static final int VERTEX_FORMAT_UNORM8X4- See Also:
-
VERTEX_FORMAT_FLOAT32
static final int VERTEX_FORMAT_FLOAT32- See Also:
-
VERTEX_FORMAT_FLOAT32X2
static final int VERTEX_FORMAT_FLOAT32X2- See Also:
-
VERTEX_FORMAT_FLOAT32X3
static final int VERTEX_FORMAT_FLOAT32X3- See Also:
-
VERTEX_FORMAT_FLOAT32X4
static final int VERTEX_FORMAT_FLOAT32X4- See Also:
-
VERTEX_STEP_MODE_VERTEX
static final int VERTEX_STEP_MODE_VERTEX- See Also:
-
COLOR_WRITE_MASK_ALL
static final int COLOR_WRITE_MASK_ALL- See Also:
-
-
Method Details
-
initialize
boolean initialize()Initializes the WebGPU loader/library. Returns true if successful. -
isAvailable
boolean isAvailable()Returns true if the native WebGPU library is available. -
configureSurface
Configures a presentation surface for the given window. Desktop: creates a wgpu surface using WindowHandle.surfaceInfo(). Web: configures the canvas context. Returns a surface/context handle, or 0 if not supported (headless). -
getSurfaceTextureView
default long getSurfaceTextureView(long surface) Gets the current surface texture view for rendering. Returns 0 if no surface is configured (offscreen/headless). -
releaseSurfaceTextureView
default void releaseSurfaceTextureView(long textureView) Releases a surface texture view obtained from getSurfaceTextureView. -
surfacePresent
default void surfacePresent(long surface) Presents the current surface texture to the screen. Desktop: calls wgpuSurfacePresent. Web: no-op (browser presents after submit). -
surfaceFormat
default int surfaceFormat()Returns the texture format used by the presentation surface. Defaults to BGRA8 (desktop wgpu-native). Web browsers may use RGBA8. -
hasSurface
default boolean hasSurface()Returns true if a presentation surface is available. -
setPresentMode
default void setPresentMode(int mode) Sets the present mode for surface configuration. Must be called before configureSurface. -
createInstance
long createInstance()Creates a WebGPU instance. -
instanceProcessEvents
void instanceProcessEvents(long instance) Processes pending events on the instance. -
instanceRelease
void instanceRelease(long instance) Releases the instance. -
instanceRequestAdapter
long instanceRequestAdapter(long instance) Requests an adapter from the instance (synchronous). Returns the adapter handle, or 0 on failure. -
adapterRelease
void adapterRelease(long adapter) Releases the adapter. -
adapterRequestDevice
long adapterRequestDevice(long instance, long adapter) Requests a device from the adapter (synchronous). Requires the instance handle for event processing. Returns the device handle, or 0 on failure. -
deviceGetQueue
long deviceGetQueue(long device) Gets the device's queue. -
deviceRelease
void deviceRelease(long device) Releases the device. -
deviceGetLimits
Queries device limits. Returns null if not supported. -
deviceCreateBuffer
long deviceCreateBuffer(long device, long size, int usage) Creates a GPU buffer.- Parameters:
device- the device handlesize- buffer size in bytesusage- combined WebGPU buffer usage flags- Returns:
- buffer handle
-
bufferRelease
void bufferRelease(long buffer) Releases a buffer. -
queueWriteBuffer
Writes data to a buffer via the queue.- Parameters:
queue- the queue handlebuffer- the destination buffer handleoffset- byte offset into the bufferdata- direct ByteBuffer with data to writesize- number of bytes to write
-
bufferMapReadSync
void bufferMapReadSync(long instance, long buffer, int size, int maxPolls) Maps a buffer for reading (synchronous, polls instance events).- Parameters:
instance- the instance handle (for event polling)buffer- the buffer handlesize- number of bytes to mapmaxPolls- maximum number of event poll iterations
-
bufferGetConstMappedRange
Gets the mapped range of a buffer into the provided direct ByteBuffer. -
bufferUnmap
void bufferUnmap(long buffer) Unmaps a previously mapped buffer. -
deviceCreateTexture
long deviceCreateTexture(long device, int width, int height, int depthOrLayers, int format, int dimension, int usage) Creates a texture.- Parameters:
device- the device handlewidth- texture widthheight- texture heightdepthOrLayers- depth (for 3D) or array layersformat- WebGPU texture format ordinal (from)invalid reference
WgpuTextureFormatdimension- 0 = 2D, 1 = 3Dusage- combined WebGPU texture usage flags- Returns:
- texture handle
-
textureCreateView
long textureCreateView(long texture, int format, int viewDimension, int arrayLayerCount) Creates a texture view.- Parameters:
texture- the texture handleformat- WebGPU texture format ordinalviewDimension- view dimension ordinal (from)invalid reference
WgpuTextureViewDimensionarrayLayerCount- number of array layers- Returns:
- texture view handle
-
textureRelease
void textureRelease(long texture) Releases a texture. -
textureViewRelease
void textureViewRelease(long textureView) Releases a texture view. -
queueWriteTexture
void queueWriteTexture(long queue, long texture, int width, int height, int depthOrLayers, int bytesPerRow, ByteBuffer data) Writes pixel data to a texture via the queue.- Parameters:
queue- the queue handletexture- the destination texture handlewidth- write region widthheight- write region heightdepthOrLayers- write region depth/layersbytesPerRow- bytes per row in the source datadata- direct ByteBuffer with pixel data
-
deviceCreateSampler
long deviceCreateSampler(long device, int addressU, int addressV, int addressW, int magFilter, int minFilter, int mipmapFilter, float lodMinClamp, float lodMaxClamp, int compare, float maxAnisotropy) Creates a sampler.- Parameters:
device- the device handleaddressU- address mode U ordinal (from)invalid reference
WgpuAddressModeaddressV- address mode V ordinaladdressW- address mode W ordinalmagFilter- mag filter ordinal (from)invalid reference
WgpuFilterModeminFilter- min filter ordinalmipmapFilter- mipmap filter ordinal (from)invalid reference
WgpuMipmapFilterMode- Returns:
- sampler handle
-
samplerRelease
void samplerRelease(long sampler) Releases a sampler. -
deviceCreateShaderModule
Creates a shader module from WGSL source.- Parameters:
device- the device handlewgsl- WGSL shader source code- Returns:
- shader module handle, or 0 if creation failed
-
shaderModuleIsValid
boolean shaderModuleIsValid(long shaderModule) Returns true if the shader module handle is valid. -
shaderModuleRelease
void shaderModuleRelease(long shaderModule) Releases a shader module. -
deviceCreateBindGroupLayout
Creates a bind group layout with the given entries.- Parameters:
device- the device handleentries- array ofWgpuBindings.BindGroupLayoutEntrydescriptors- Returns:
- bind group layout handle
-
bindGroupLayoutRelease
void bindGroupLayoutRelease(long bindGroupLayout) Releases a bind group layout. -
deviceCreatePipelineLayout
long deviceCreatePipelineLayout(long device, long[] bindGroupLayouts) Creates a pipeline layout from bind group layouts.- Parameters:
device- the device handlebindGroupLayouts- array of bind group layout handles- Returns:
- pipeline layout handle
-
pipelineLayoutRelease
void pipelineLayoutRelease(long pipelineLayout) Releases a pipeline layout. -
deviceCreateRenderPipeline
Creates a render pipeline.- Parameters:
device- the device handledesc- the pipeline descriptor- Returns:
- render pipeline handle
-
renderPipelineRelease
void renderPipelineRelease(long renderPipeline) Releases a render pipeline. -
deviceCreateBindGroup
Creates a bind group.- Parameters:
device- the device handlelayout- the bind group layout handleentries- array of bind group entry descriptors- Returns:
- bind group handle
-
bindGroupRelease
void bindGroupRelease(long bindGroup) Releases a bind group. -
deviceCreateCommandEncoder
long deviceCreateCommandEncoder(long device) Creates a command encoder. -
commandEncoderBeginRenderPass
Begins a render pass on the command encoder.- Parameters:
encoder- the command encoder handledesc- the render pass descriptor- Returns:
- render pass encoder handle
-
commandEncoderCopyBufferToBuffer
void commandEncoderCopyBufferToBuffer(long encoder, long src, int srcOffset, long dst, int dstOffset, int size) Copies data between buffers. -
commandEncoderCopyTextureToBuffer
void commandEncoderCopyTextureToBuffer(long encoder, long texture, long buffer, int width, int height, int bytesPerRow, int rowsPerImage) Copies a texture to a buffer. -
commandEncoderFinish
long commandEncoderFinish(long encoder) Finishes the command encoder, producing a command buffer.- Parameters:
encoder- the command encoder handle- Returns:
- command buffer handle
-
commandEncoderRelease
void commandEncoderRelease(long encoder) Releases a command encoder. -
commandBufferRelease
void commandBufferRelease(long commandBuffer) Releases a command buffer. -
queueSubmit
void queueSubmit(long queue, long commandBuffer) Submits a command buffer to the queue. -
renderPassEnd
void renderPassEnd(long renderPass) Ends the render pass. -
renderPassRelease
void renderPassRelease(long renderPass) Releases the render pass encoder. -
renderPassSetPipeline
void renderPassSetPipeline(long renderPass, long pipeline) Sets the pipeline on the render pass. -
renderPassSetVertexBuffer
void renderPassSetVertexBuffer(long renderPass, int slot, long buffer, int offset, int size) Sets a vertex buffer on the render pass. -
renderPassSetIndexBuffer
void renderPassSetIndexBuffer(long renderPass, long buffer, int indexFormat, int offset, int size) Sets the index buffer on the render pass. -
renderPassSetBindGroup
void renderPassSetBindGroup(long renderPass, int groupIndex, long bindGroup) Sets the bind group on the render pass. -
renderPassSetViewport
void renderPassSetViewport(long renderPass, float x, float y, float w, float h, float minDepth, float maxDepth) Sets the viewport on the render pass. -
renderPassSetScissorRect
void renderPassSetScissorRect(long renderPass, int x, int y, int width, int height) Sets the scissor rect on the render pass. -
renderPassSetStencilReference
void renderPassSetStencilReference(long renderPass, int ref) Sets the stencil reference on the render pass. -
renderPassDraw
void renderPassDraw(long renderPass, int vertexCount, int instanceCount, int firstVertex, int firstInstance) Draws primitives. -
renderPassDrawIndexed
void renderPassDrawIndexed(long renderPass, int indexCount, int instanceCount, int firstIndex, int baseVertex, int firstInstance) Draws indexed primitives.
-