Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/wgpu.cr
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ module WGPU
alias RenderPassDescriptor = LibWGPU::RenderPassDescriptor
alias TextureDataLayout = LibWGPU::TextureDataLayout
alias TextureDescriptor = LibWGPU::TextureDescriptor
alias VertexAttribute = LibWGPU::VertexAttribute

def set_log_level(level : LogLevel)
LibWGPU.set_log_level LibWGPU::LogLevel.new(level.value)
Expand Down Expand Up @@ -432,10 +433,14 @@ module WGPU
class Buffer < WgpuId
@@callback_boxes : Array(Pointer(Void)?) = [] of Pointer(Void)?

getter usage : BufferUsageFlags
getter size : UInt64
getter status : BufferMapAsyncStatus
getter read_only : Bool

def initialize(device : Device, descriptor : LibWGPU::BufferDescriptor)
@usage = descriptor.usage
@size = descriptor.size
@status = BufferMapAsyncStatus::Unknown
@read_only = true
@id = LibWGPU.device_create_buffer(device, pointerof(descriptor))
Expand Down