Class WGPUBuffer
Represents a WebGPU buffer object.
Inherited Members
Namespace: Evergine.WebGPU
Assembly: Evergine.WebGPU.dll
Syntax
public class WGPUBuffer : Buffer
Constructors
WGPUBuffer(WGPUGraphicsContext, ref BufferDescription, nint)
Initializes a new instance of the WGPUBuffer class.
Declaration
public WGPUBuffer(WGPUGraphicsContext context, ref BufferDescription description, nint data = 0)
Parameters
Type | Name | Description |
---|---|---|
WGPUGraphicsContext | context | The graphics context. |
BufferDescription | description | A buffer description. |
nint | data | The data pointer. |
Properties
Name
Gets or sets a string identifying this instance. It can be used in graphics debugging tools.
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
NativePointer
Gets the native pointer.
Declaration
public override nint NativePointer { get; }
Property Value
Type | Description |
---|---|
nint |
Overrides
Methods
CopyTo(WGPUCommandEncoder, Buffer, uint, uint, uint)
Copy this buffer in the destination buffer.
Declaration
public void CopyTo(WGPUCommandEncoder commandEncoder, Buffer destination, uint sizeInBytes, uint sourceOffset = 0, uint destinationOffset = 0)
Parameters
Type | Name | Description |
---|---|---|
WGPUCommandEncoder | commandEncoder | The command encoder. |
Buffer | destination | The destination buffer. |
uint | sizeInBytes | The data size in bytes to copy. |
uint | sourceOffset | The source buffer offset in bytes. |
uint | destinationOffset | The destination buffer offset in bytes. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
Overrides
SetData(nint, ulong, uint)
Fill the buffer from a pointer.
Declaration
public void SetData(nint source, ulong sourceSizeInBytes, uint destinationOffsetInBytes = 0)
Parameters
Type | Name | Description |
---|---|---|
nint | source | The data pointer. |
ulong | sourceSizeInBytes | The size in bytes. |
uint | destinationOffsetInBytes | The offset to start writing in the buffer, in bytes. |