lib/vulkan/memory.rb
# Maps this memory range. If a block is provided, a pointer to the start
# of the mapped memory range is yielded to the block and the memory is
# automatically unmapped after the block finishes and `nil` is returned
# to prevent writing to a no-longer-mapped address.
#
# If no block is provided, the memory remains mapped and the pointer is
# returned.
#
# If `invalidate` is true, the range to be mapped will be invalidated
# automatically before mapping to ensure that the memory will be up to
# date with any changes from the device. If false, the memory may be out
# of date when you map it.
#
# If `flush` is true, and a block is given, then the memory will be
# flushed to ensure that it is updated on the device after your block
# completes. If no block is given, this option has no effect.
Maps this memory range. If a block is provided, a pointer to the start
of the mapped memory range is yielded to the block and the memory is
automatically unmapped after the block finishes and `nil` is returned
to prevent writing to a no-longer-mapped address.

If no block is provided, the memory remains mapped and the pointer is
returned.

If `invalidate` is true, the range to be mapped will be invalidated
automatically before mapping to ensure that the memory will be up to
date with any changes from the device. If false, the memory may be out
of date when you map it.

If `flush` is true, and a block is given, then the memory will be
flushed to ensure that it is updated on the device after your block
completes. If no block is given, this option has no effect.
Maps this memory range . If a block is provided a pointer to the start of the mapped memory range is yielded to the block and the memory is automatically unmapped after the block finishes and ` nil ` is returned to prevent writing to a no - longer - mapped address . If no block is provided the memory remains mapped and the pointer is returned . If ` invalidate ` is true the range to be mapped will be invalidated automatically before mapping to ensure that the memory will be up to date with any changes from the device . If false the memory may be out of date when you map it . If ` flush ` is true and a block is given then the memory will be flushed to ensure that it is updated on the device after your block completes . If no block is given this option has no effect .
def map(offset: 0, size: offset > 0 ? self.size - offset : VK_WHOLE_SIZE,
            invalidate: true, flush: true, &block)
      raise 'buffer is already mapped' if mapped?
      self.invalidate offset: offset, size: size if invalidate
      @vk.vkMapMemory(@vk.device, @handle, offset, size, 0, @mapped)
      size = self.size if size == VK_WHOLE_SIZE
      if block_given?
        begin
          yield Fiddle::Pointer.new(@mapped.value.to_i, size)
        ensure
          self.flush offset: offset, size: size if flush
          unmap
        end
        return nil
      else
        return Fiddle::Pointer.new(@mapped.value.to_i, size)
      end
    end
def map ( offset : 0 , size : offset > 0 ? self . size - offset : VK_WHOLE_SIZE , invalidate : true , flush : true , & block ) raise 'buffer is already mapped' if mapped? self . invalidate offset : offset , size : size if invalidate @vk . vkMapMemory ( @vk . device , @handle , offset , size , 0 , @mapped ) size = self . size if size == VK_WHOLE_SIZE if block_given? begin yield Fiddle :: Pointer . new ( @mapped . value . to_i , size ) ensure self . flush offset : offset , size : size if flush unmap end return nil else return Fiddle :: Pointer . new ( @mapped . value . to_i , size ) end end
Maps this memory range.
Maps this memory range .
offset
<not_specific>
size
<not_specific>
invalidate
<not_specific>
flush
<not_specific>
block
<not_specific>