Class: Vulkan::Buffer
Constant Summary
Constants included
from Conversions
Conversions::ACCESS_MASK_BITS, Conversions::BORDER_COLORS, Conversions::BUFFER_USAGE_BITS, Conversions::COMPARE_OPS, Conversions::DEPENDENCY_FLAG_BITS, Conversions::DESCRIPTOR_TYPES, Conversions::DYNAMIC_STATES, Conversions::FILTERS, Conversions::FORMAT_FEATURE_BITS, Conversions::IMAGE_ASPECT_BITS, Conversions::IMAGE_CREATE_BITS, Conversions::IMAGE_FORMATS, Conversions::IMAGE_TILING, Conversions::IMAGE_TYPES, Conversions::IMAGE_USAGE_BITS, Conversions::MEMORY_PROPERTIES, Conversions::PIPELINE_STAGE_BITS, Conversions::PRESENT_MODES, Conversions::SAMPLER_ADDRESS_MODES, Conversions::SAMPLER_MIPMAP_MODES, Conversions::SHADER_STAGE_BITS, Conversions::SHARING_MODES, Conversions::SURFACE_TRANSFORMS, Conversions::VERTEX_INPUT_RATES
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Finalizer
#finalize_with, #hexaddr, included, #to_ptr
#array_of_pointers, #array_of_structures, #array_of_uint32s, #bool_to_vk, #buffer_usage_flags_to_syms, #const_to_symbol, #cstr_to_rbstr, #flags_to_symbols, #flags_to_syms, #num_to_samples, #present_mode_to_sym, #queue_family_to_index, #struct_to_hash, #sym_to_blend_factor, #sym_to_blend_op, #sym_to_border_color, #sym_to_color_component_bit, #sym_to_command_buffer_level, #sym_to_command_buffer_usage, #sym_to_compare_op, #sym_to_cull_mode, #sym_to_descriptor_type, #sym_to_dynamic_state, #sym_to_filter, #sym_to_front_face, #sym_to_image_format, #sym_to_image_layout, #sym_to_image_tiling, #sym_to_image_type, #sym_to_index_type, #sym_to_load_op, #sym_to_pipeline_bind_point, #sym_to_polygon_mode, #sym_to_present_mode, #sym_to_sampler_address_mode, #sym_to_sampler_mipmap_mode, #sym_to_samples, #sym_to_sharing_mode, #sym_to_store_op, #sym_to_subpass_contents, #sym_to_topology, #sym_to_val, #sym_to_vertex_input_rate, #syms_to_access_mask, #syms_to_buffer_usage_flags, #syms_to_dependency_flags, #syms_to_descriptor_set_layout_type_flags, #syms_to_flags, #syms_to_format_feature_flags, #syms_to_image_aspect_flags, #syms_to_image_create_flags, #syms_to_image_usage_flags, #syms_to_memory_properties, #syms_to_pipeline_stage_flags, #syms_to_shader_stage_flags, #syms_to_surface_transforms, #vk_make_version, #vk_parse_version
Methods included from Checks
#check_result
Constructor Details
#initialize(vk, physical_device, size:, usage:, sharing_mode: VK_SHARING_MODE_EXCLUSIVE, flags: 0, **memory_args) ⇒ Buffer
Returns a new instance of Buffer.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/vulkan/buffer.rb', line 11
def initialize(vk, physical_device, size:,
usage:,
sharing_mode: VK_SHARING_MODE_EXCLUSIVE,
flags: 0,
**memory_args)
@vk = vk
@size = size
@mapped = Vulkan.create_value('void *', nil)
buffer_info = VkBufferCreateInfo.malloc
buffer_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
buffer_info.size = size
buffer_info.usage = syms_to_buffer_usage_flags(usage)
buffer_info.sharingMode = sharing_mode
buffer_info.flags = flags
handle_p = Vulkan.create_value('void *', nil)
check_result @vk.vkCreateBuffer(vk.device, buffer_info, nil, handle_p)
@handle = handle_p.value
@memory = Vulkan::BufferMemory.new(@vk, physical_device, owner: self,
**memory_args)
finalize_with @vk, :vkDestroyBuffer, vk.device, @handle, nil
end
|
Instance Attribute Details
#memory ⇒ Object
Returns the value of attribute memory.
7
8
9
|
# File 'lib/vulkan/buffer.rb', line 7
def memory
@memory
end
|
#size ⇒ Object
Returns the value of attribute size.
8
9
10
|
# File 'lib/vulkan/buffer.rb', line 8
def size
@size
end
|
#usage ⇒ Object
Returns the value of attribute usage.
9
10
11
|
# File 'lib/vulkan/buffer.rb', line 9
def usage
@usage
end
|
Instance Method Details
#create_barrier(**args) ⇒ Object
34
35
36
|
# File 'lib/vulkan/buffer.rb', line 34
def create_barrier(**args)
@memory.create_barrier(**args)
end
|
#data ⇒ Object
66
67
68
|
# File 'lib/vulkan/buffer.rb', line 66
def data
memory.data
end
|
#flush ⇒ Object
42
43
44
|
# File 'lib/vulkan/buffer.rb', line 42
def flush(...)
memory.flush(...)
end
|
#flush_all ⇒ Object
46
47
48
|
# File 'lib/vulkan/buffer.rb', line 46
def flush_all(...)
memory.flush_all(...)
end
|
#invalidate ⇒ Object
50
51
52
|
# File 'lib/vulkan/buffer.rb', line 50
def invalidate(...)
memory.invalidate(...)
end
|
#invalidate_all ⇒ Object
54
55
56
|
# File 'lib/vulkan/buffer.rb', line 54
def invalidate_all(...)
memory.invalidate_all(...)
end
|
#map(*args, &block) ⇒ Object
38
39
40
|
# File 'lib/vulkan/buffer.rb', line 38
def map(*args, &block)
memory.map(*args, &block)
end
|
#mapped? ⇒ Boolean
58
59
60
|
# File 'lib/vulkan/buffer.rb', line 58
def mapped?
memory.mapped?
end
|
#unmap ⇒ Object
62
63
64
|
# File 'lib/vulkan/buffer.rb', line 62
def unmap
memory.unmap
end
|