Class: Vulkan::ShaderStage
- Inherits:
-
Object
- Object
- Vulkan::ShaderStage
- Includes:
- Checks, Conversions, Finalizer
- Defined in:
- lib/vulkan/shader_stage.rb
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
-
#entry_point ⇒ Object
readonly
Returns the value of attribute entry_point.
-
#module_handle ⇒ Object
readonly
Returns the value of attribute module_handle.
-
#stage ⇒ Object
readonly
Returns the value of attribute stage.
Instance Method Summary collapse
-
#initialize(vk, code: nil, file_path: nil, entry_point: 'main', stage:) ⇒ ShaderStage
constructor
A new instance of ShaderStage.
Methods included from Finalizer
#finalize_with, #hexaddr, included, #to_ptr
Methods included from Conversions
#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
Constructor Details
#initialize(vk, code: nil, file_path: nil, entry_point: 'main', stage:) ⇒ ShaderStage
Returns a new instance of ShaderStage.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vulkan/shader_stage.rb', line 9 def initialize(vk, code: nil, file_path: nil, entry_point: 'main', stage:) code ||= File.open(file_path, 'rb') { |file| file.read } @vk = vk @entry_point = entry_point @stage = stage code_p = Fiddle::Pointer.malloc(code.size + 1) code_p[0, code.size] = code create_info = VkShaderModuleCreateInfo.malloc create_info.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO create_info.codeSize = code.size create_info.pCode = code_p module_handle_p = Vulkan.create_value('void *', nil) check_result @vk.vkCreateShaderModule(vk.device, create_info, nil, module_handle_p) @module_handle = module_handle_p.value finalize_with vk, :vkDestroyShaderModule, vk.device, @module_handle, nil @handle = @module_handle end |
Instance Attribute Details
#entry_point ⇒ Object (readonly)
Returns the value of attribute entry_point.
7 8 9 |
# File 'lib/vulkan/shader_stage.rb', line 7 def entry_point @entry_point end |
#module_handle ⇒ Object (readonly)
Returns the value of attribute module_handle.
7 8 9 |
# File 'lib/vulkan/shader_stage.rb', line 7 def module_handle @module_handle end |
#stage ⇒ Object (readonly)
Returns the value of attribute stage.
7 8 9 |
# File 'lib/vulkan/shader_stage.rb', line 7 def stage @stage end |