vulkan-ruby 1.3.207.2 → 1.3.207.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca158d2d571e7cedf3302a903e0d33930c1d7d969850b2980efa4cbf60280d62
4
- data.tar.gz: d92aa219b4179f4735cafa4c7fce97d48ee9357181afcf7904c9cccd21f7c834
3
+ metadata.gz: cb8eb88ebc788ecea9584d4489e9cfb1c87ccdf296ddda38f9c236ab3c4cc90a
4
+ data.tar.gz: ac4fc032baac3a114f56b57f8302a06de8ee8ec4d3f5c2d7eee6a78e2cb32ab1
5
5
  SHA512:
6
- metadata.gz: 3cfaec7a58bfb3255512396c9bcdb1f0f139b56ee77fa05b749daa78ef2d8b644830fd55052b6c38e7342968f1c747ef4e35b8740254a42d7db2a94f22a18e7b
7
- data.tar.gz: 66d02962cdeabb37b407d5d8358cab6b8726d1ba08eab40b43b093412ab6b95790d7ce36654fd0d462c51ca3de0d51358663a1f987f86d6b4ce4b01d6f7b420c
6
+ metadata.gz: d2852867b97c52d2a675a9ac11c1fef456f64d2537efe1c89fd6a73590cd8bf9119670d6c909a58c1079fc6a1b6568ee45d56711a6e8ac5e1b09f6f15531a856
7
+ data.tar.gz: 1875b8237d80efe003e24c0cdda90d8c20a16fd0c8f50d30fc484f6592d1cad674b12f3e6599b08c750d1d3ee9ae0c0da3a56c851625b1fdb83c39bd362f03f5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vulkan-ruby (1.3.207.2)
4
+ vulkan-ruby (1.3.207.5)
5
5
  sorted_set
6
6
 
7
7
  GEM
@@ -50,4 +50,4 @@ DEPENDENCIES
50
50
  vulkan-ruby!
51
51
 
52
52
  BUNDLED WITH
53
- 2.2.0.rc.1
53
+ 2.5.17
data/lib/vulkan/buffer.rb CHANGED
@@ -31,6 +31,10 @@ module Vulkan
31
31
  finalize_with @vk, :vkDestroyBuffer, vk.device, @handle, nil
32
32
  end
33
33
 
34
+ def create_barrier(**args)
35
+ @memory.create_barrier(**args)
36
+ end
37
+
34
38
  def map(*args, &block)
35
39
  memory.map(*args, &block)
36
40
  end
@@ -1,5 +1,10 @@
1
1
  module Vulkan
2
2
  class BufferMemory < Memory
3
+ def initialize(vk, physical_device, owner:, **options)
4
+ @owner = owner
5
+ super(vk, physical_device, **options)
6
+ end
7
+
3
8
  def query_memory_requirements
4
9
  VkMemoryRequirements.malloc.tap do |req|
5
10
  @vk.vkGetBufferMemoryRequirements(@vk.device, @owner.to_ptr, req)
@@ -9,5 +14,9 @@ module Vulkan
9
14
  def bind
10
15
  @vk.vkBindBufferMemory(@vk.device, @owner.to_ptr, to_ptr, 0);
11
16
  end
17
+
18
+ def create_barrier(**args)
19
+ Vulkan::BufferMemoryBarrier.new(buffer: @owner, **args)
20
+ end
12
21
  end
13
22
  end
@@ -0,0 +1,43 @@
1
+ module Vulkan
2
+ class BufferMemoryBarrier
3
+ include Vulkan::Conversions
4
+
5
+ def initialize(src_access:,
6
+ dst_access:,
7
+ src_queue_family_index: VK_QUEUE_FAMILY_IGNORED,
8
+ dst_queue_family_index: VK_QUEUE_FAMILY_IGNORED,
9
+ buffer:,
10
+ offset: 0,
11
+ size: VK_WHOLE_SIZE)
12
+ @struct = VkBufferMemoryBarrier.malloc
13
+ @struct.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
14
+ self.src_access = src_access
15
+ self.dst_access = dst_access
16
+ self.src_queue_family_index = src_queue_family_index
17
+ self.dst_queue_family_index = dst_queue_family_index
18
+ self.buffer = buffer
19
+ self.offset = offset
20
+ self.size = size
21
+ end
22
+
23
+ def src_access; @src_access; end
24
+ def src_access=(s); @src_access = s; @struct.srcAccessMask = syms_to_access_mask(s); end
25
+ def dst_access; @dst_access; end
26
+ def dst_access=(s); @dst_access = s; @struct.dstAccessMask = syms_to_access_mask(s); end
27
+ def src_queue_family_index; @struct.srcQueueFamilyIndex; end
28
+ def src_queue_family_index=(s); @struct.srcQueueFamilyIndex = s; end
29
+ def dst_queue_family_index; @struct.dstQueueFamilyIndex; end
30
+ def dst_queue_family_index=(s); @struct.dstQueueFamilyIndex = s; end
31
+ def buffer; @buffer; end
32
+ def buffer=(b); @buffer = b; @struct.buffer = b.to_ptr; end
33
+ def offset; @struct.offset; end
34
+ def offset=(o); @struct.offset = o; end
35
+ def size; @struct.size; end
36
+ def size=(s); @struct.size = s; end
37
+
38
+ def to_ptr
39
+ @struct.to_ptr
40
+ end
41
+ end
42
+ end
43
+
@@ -1,5 +1,10 @@
1
1
  module Vulkan
2
2
  class ImageMemory < Memory
3
+ def initialize(vk, physical_device, owner:, **options)
4
+ @owner = owner
5
+ super(vk, physical_device, **options)
6
+ end
7
+
3
8
  def query_memory_requirements
4
9
  VkMemoryRequirements.malloc.tap do |req|
5
10
  @vk.vkGetImageMemoryRequirements(@vk.device, @owner.to_ptr, req)
@@ -15,6 +15,7 @@ module Vulkan
15
15
  @physical_device = physical_device
16
16
 
17
17
  extensions.concat ENV['DEVICE_EXTENSIONS'].split(/\:\s/) if ENV['DEVICE_EXTENSIONS']
18
+ extensions << 'VK_KHR_portability_subset' if physical_device.extension_names.include?('VK_KHR_portability_subset')
18
19
 
19
20
  if queues.size == 0
20
21
  # take the first available queue, to satisfy the spec (must request a queue)
@@ -154,6 +155,18 @@ module Vulkan
154
155
  Vulkan::Framebuffer.new(@vk, **args)
155
156
  end
156
157
 
158
+ def create_buffer_memory_barrier(**args)
159
+ Vulkan::BufferMemoryBarrier.new(**args)
160
+ end
161
+
162
+ def create_memory(**args)
163
+ Vulkan::Memory.new(@vk, physical_device, **args)
164
+ end
165
+
166
+ def create_memory_barrier(**args)
167
+ Vulkan::MemoryBarrier.new(**args)
168
+ end
169
+
157
170
  def hexaddr
158
171
  to_ptr.to_i.to_s(16)
159
172
  end
data/lib/vulkan/memory.rb CHANGED
@@ -7,14 +7,11 @@ module Vulkan
7
7
  attr_reader :requirements
8
8
  attr_reader :physical_device
9
9
 
10
- def initialize(vk, physical_device,
11
- owner:,
12
- properties: [:host_visible])
10
+ def initialize(vk, physical_device, properties: [:host_visible])
13
11
  @range_array = nil
14
12
  @vk = vk
15
13
  @physical_device = physical_device
16
14
  @properties = syms_to_memory_properties(properties)
17
- @owner = owner
18
15
  @mapped = Vulkan.create_value('void *', nil)
19
16
 
20
17
  @requirements = query_memory_requirements
@@ -110,7 +107,9 @@ module Vulkan
110
107
  #
111
108
  # See https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkInvalidateMappedMemoryRanges.html
112
109
  def invalidate_all(ranges)
113
- @vk.vkInvalidateMappedMemoryRanges(@vk.device, ranges.size, memory_ranges(ranges))
110
+ if mapped?
111
+ @vk.vkInvalidateMappedMemoryRanges(@vk.device, ranges.size, memory_ranges(ranges))
112
+ end
114
113
  end
115
114
 
116
115
  # Provides a pointer to an array of memory ranges for e.g. flushing memory
@@ -0,0 +1,23 @@
1
+ module Vulkan
2
+ class MemoryBarrier
3
+ include Vulkan::Conversions
4
+
5
+ def initialize(src_access:,
6
+ dst_access:)
7
+ @struct = VkMemoryBarrier.malloc
8
+ @struct.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER
9
+ self.src_access = src_access
10
+ self.dst_access = dst_access
11
+ end
12
+
13
+ def src_access; @src_access; end
14
+ def src_access=(s); @src_access = s; @struct.srcAccessMask = syms_to_access_mask(s); end
15
+ def dst_access; @dst_access; end
16
+ def dst_access=(s); @dst_access = s; @struct.dstAccessMask = syms_to_access_mask(s); end
17
+
18
+ def to_ptr
19
+ @struct.to_ptr
20
+ end
21
+ end
22
+ end
23
+
@@ -38,8 +38,8 @@ module Vulkan
38
38
  @scissor = {
39
39
  left: 0,
40
40
  top: 0,
41
- width: 0xffffffff,
42
- height: 0xffffffff
41
+ width: 0x7fffffff,
42
+ height: 0x7fffffff
43
43
  }.merge(scissor)
44
44
  @rasterizer = {
45
45
  depth_clamp: false,
@@ -189,8 +189,8 @@ module Vulkan
189
189
  scissor = VkRect2D.malloc
190
190
  scissor.offset.x = @scissor[:left]
191
191
  scissor.offset.y = @scissor[:top]
192
- scissor.extent.width = @scissor[:width]
193
- scissor.extent.height = @scissor[:height]
192
+ scissor.extent.width = @scissor[:width] == 0x7fffffff ? 0x7fffffff - @scissor[:left] : @scissor[:width]
193
+ scissor.extent.height = @scissor[:height] == 0x7fffffff ? 0x7fffffff - @scissor[:top] : @scissor[:height]
194
194
 
195
195
  viewport_state = VkPipelineViewportStateCreateInfo.malloc
196
196
  viewport_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
@@ -1,7 +1,7 @@
1
1
  require 'vulkan/generated/version'
2
2
 
3
3
  module Vulkan
4
- VULKAN_RUBY_VERSION = [ 2 ]
4
+ VULKAN_RUBY_VERSION = [ 5 ]
5
5
 
6
6
  VERSION = [ VK_API_VERSION_MAJOR,
7
7
  VK_API_VERSION_MINOR,
data/lib/vulkan.rb CHANGED
@@ -89,3 +89,5 @@ require 'vulkan/memory'
89
89
  require 'vulkan/buffer_memory'
90
90
  require 'vulkan/image_memory'
91
91
  require 'vulkan/sampler'
92
+ require 'vulkan/memory_barrier'
93
+ require 'vulkan/buffer_memory_barrier'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vulkan-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.207.2
4
+ version: 1.3.207.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin MacKenzie IV
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-19 00:00:00.000000000 Z
11
+ date: 2024-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -220,6 +220,7 @@ files:
220
220
  - lib/vulkan.rb
221
221
  - lib/vulkan/buffer.rb
222
222
  - lib/vulkan/buffer_memory.rb
223
+ - lib/vulkan/buffer_memory_barrier.rb
223
224
  - lib/vulkan/checks.rb
224
225
  - lib/vulkan/command_buffer.rb
225
226
  - lib/vulkan/command_pool.rb
@@ -246,6 +247,7 @@ files:
246
247
  - lib/vulkan/logical_device.rb
247
248
  - lib/vulkan/manual_types.rb
248
249
  - lib/vulkan/memory.rb
250
+ - lib/vulkan/memory_barrier.rb
249
251
  - lib/vulkan/mock.rb
250
252
  - lib/vulkan/mock/swapchain_surface_info.rb
251
253
  - lib/vulkan/physical_device.rb
@@ -296,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
298
  - !ruby/object:Gem::Version
297
299
  version: '0'
298
300
  requirements: []
299
- rubygems_version: 3.3.7
301
+ rubygems_version: 3.5.0.dev
300
302
  signing_key:
301
303
  specification_version: 4
302
304
  summary: Vulkan bindings for Ruby