vulkan-ruby 1.3.207.2 → 1.3.207.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/vulkan/buffer.rb +4 -0
- data/lib/vulkan/buffer_memory.rb +9 -0
- data/lib/vulkan/buffer_memory_barrier.rb +43 -0
- data/lib/vulkan/image_memory.rb +5 -0
- data/lib/vulkan/logical_device.rb +13 -0
- data/lib/vulkan/memory.rb +4 -5
- data/lib/vulkan/memory_barrier.rb +23 -0
- data/lib/vulkan/pipeline.rb +4 -4
- data/lib/vulkan/version.rb +1 -1
- data/lib/vulkan.rb +2 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb8eb88ebc788ecea9584d4489e9cfb1c87ccdf296ddda38f9c236ab3c4cc90a
|
4
|
+
data.tar.gz: ac4fc032baac3a114f56b57f8302a06de8ee8ec4d3f5c2d7eee6a78e2cb32ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2852867b97c52d2a675a9ac11c1fef456f64d2537efe1c89fd6a73590cd8bf9119670d6c909a58c1079fc6a1b6568ee45d56711a6e8ac5e1b09f6f15531a856
|
7
|
+
data.tar.gz: 1875b8237d80efe003e24c0cdda90d8c20a16fd0c8f50d30fc484f6592d1cad674b12f3e6599b08c750d1d3ee9ae0c0da3a56c851625b1fdb83c39bd362f03f5
|
data/Gemfile.lock
CHANGED
data/lib/vulkan/buffer.rb
CHANGED
data/lib/vulkan/buffer_memory.rb
CHANGED
@@ -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
|
+
|
data/lib/vulkan/image_memory.rb
CHANGED
@@ -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
|
-
|
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
|
+
|
data/lib/vulkan/pipeline.rb
CHANGED
@@ -38,8 +38,8 @@ module Vulkan
|
|
38
38
|
@scissor = {
|
39
39
|
left: 0,
|
40
40
|
top: 0,
|
41
|
-
width:
|
42
|
-
height:
|
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
|
data/lib/vulkan/version.rb
CHANGED
data/lib/vulkan.rb
CHANGED
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.
|
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:
|
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.
|
301
|
+
rubygems_version: 3.5.0.dev
|
300
302
|
signing_key:
|
301
303
|
specification_version: 4
|
302
304
|
summary: Vulkan bindings for Ruby
|