Class: WGPU::RenderBundle

Inherits:
Object
  • Object
show all
Includes:
NativeResource
Defined in:
lib/wgpu/commands/render_bundle.rb,
sig/wgpu.rbs

Constant Summary

Constants included from NativeResource

NativeResource::GUARDED_METHOD_EXEMPTIONS

Instance Attribute Summary collapse

Attributes included from NativeResource

#label

Instance Method Summary collapse

Methods included from NativeResource

included, #inspect, #released?, #use

Constructor Details

#initialize(handle, device: nil) ⇒ RenderBundle

Wraps a reusable native render bundle.

Parameters:

  • handle (FFI::Pointer)

    native render bundle handle

  • device (Device, nil) (defaults to: nil)

    device whose callbacks the render bundle may use



10
11
12
13
# File 'lib/wgpu/commands/render_bundle.rb', line 10

def initialize(handle, device: nil)
  @handle = handle
  @device = device
end

Instance Attribute Details

#handleObject (readonly)

Returns the value of attribute handle.

Returns:

  • (Object)


5
6
7
# File 'lib/wgpu/commands/render_bundle.rb', line 5

def handle
  @handle
end

Instance Method Details

#releasevoid

This method returns an undefined value.

Releases the native render bundle handle.

Calling this method more than once has no effect.



19
20
21
22
23
24
# File 'lib/wgpu/commands/render_bundle.rb', line 19

def release
  return if @handle.null?

  Native.wgpuRenderBundleRelease(@handle)
  @handle = FFI::Pointer::NULL
end