Class: Vulkan::QueueFamily

Inherits:
Hash
  • Object
show all
Includes:
Checks
Defined in:
lib/vulkan/queue_family.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Checks

#check_result

Constructor Details

#initialize(instance, physical_device, family_index) ⇒ QueueFamily

Returns a new instance of QueueFamily.



7
8
9
10
11
12
# File 'lib/vulkan/queue_family.rb', line 7

def initialize(instance, physical_device, family_index)
  super()
  @physical_device = physical_device
  @vk = Vulkan[instance, nil]
  @family_index = family_index
end

Instance Attribute Details

#physical_deviceObject (readonly)

Returns the value of attribute physical_device.



5
6
7
# File 'lib/vulkan/queue_family.rb', line 5

def physical_device
  @physical_device
end

Instance Method Details

#supports?(feature) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/vulkan/queue_family.rb', line 14

def supports?(feature)
  self[:supports].include?(feature)
end

#supports_presentation?(surface) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
# File 'lib/vulkan/queue_family.rb', line 18

def supports_presentation?(surface)
  supported_p = Vulkan.create_value('VkBool32', 0)
  check_result @vk.vkGetPhysicalDeviceSurfaceSupportKHR(@physical_device.to_ptr,
                                                               @family_index,
                                                               surface.to_ptr,
                                                               supported_p)
  return supported_p.value == VK_TRUE
end