Class: WGPU::CommandBuffer
- Inherits:
-
Object
- Object
- WGPU::CommandBuffer
- Includes:
- NativeResource
- Defined in:
- lib/wgpu/commands/command_buffer.rb,
sig/wgpu.rbs
Constant Summary
Constants included from NativeResource
NativeResource::GUARDED_METHOD_EXEMPTIONS
Instance Attribute Summary collapse
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
Attributes included from NativeResource
Instance Method Summary collapse
-
#initialize(handle, device: nil) ⇒ CommandBuffer
constructor
Wraps an encoded native command buffer.
-
#mark_submitted! ⇒ void
Marks this command buffer as submitted.
-
#release ⇒ void
Releases the native command buffer handle.
-
#submitted? ⇒ Boolean
Reports whether this command buffer has been submitted.
Methods included from NativeResource
included, #inspect, #released?, #use
Constructor Details
#initialize(handle, device: nil) ⇒ CommandBuffer
Wraps an encoded native command buffer.
10 11 12 13 14 |
# File 'lib/wgpu/commands/command_buffer.rb', line 10 def initialize(handle, device: nil) @handle = handle @device = device @submitted = false end |
Instance Attribute Details
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
5 6 7 |
# File 'lib/wgpu/commands/command_buffer.rb', line 5 def handle @handle end |
Instance Method Details
#mark_submitted! ⇒ void
This method returns an undefined value.
Marks this command buffer as submitted.
25 26 27 28 29 |
# File 'lib/wgpu/commands/command_buffer.rb', line 25 def mark_submitted! raise CommandError, "Command buffer has already been submitted" if @submitted @submitted = true end |
#release ⇒ void
This method returns an undefined value.
Releases the native command buffer handle.
Calling this method more than once has no effect.
35 36 37 38 39 |
# File 'lib/wgpu/commands/command_buffer.rb', line 35 def release return if @handle.null? Native.wgpuCommandBufferRelease(@handle) @handle = FFI::Pointer::NULL end |
#submitted? ⇒ Boolean
Reports whether this command buffer has been submitted.
18 19 20 |
# File 'lib/wgpu/commands/command_buffer.rb', line 18 def submitted? @submitted end |