MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
mln_vulkan_borrowed_texture_descriptor Struct Reference

#include <texture.h>

Data Fields

mln_logical_extent extent
uint32_t physical_width
uint32_t physical_height
mln_vulkan_context_descriptor context
const mln_vulkan_borrowed_texture * textures
size_t texture_count
uint32_t format
uint32_t initial_layout
uint32_t final_layout

Detailed Description

Vulkan attachment options for a borrowed texture target.

Field Documentation

◆ context

mln_vulkan_context_descriptor mln_vulkan_borrowed_texture_descriptor::context

Borrowed Vulkan context. All handles are required.

◆ extent

mln_logical_extent mln_vulkan_borrowed_texture_descriptor::extent

Logical texture extent; physical_width and physical_height give the texture's size. A scale_factor that differs from the map's is accepted and logged as a warning.

◆ final_layout

uint32_t mln_vulkan_borrowed_texture_descriptor::final_layout

Backend-native VkImageLayout value left after rendering succeeds. Defaults to 5, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL.

◆ format

uint32_t mln_vulkan_borrowed_texture_descriptor::format

Backend-native VkFormat value of every image. VK_FORMAT_UNDEFINED is invalid.

◆ initial_layout

uint32_t mln_vulkan_borrowed_texture_descriptor::initial_layout

Backend-native VkImageLayout value expected at render-pass begin.

The session expects an image in this layout each time it renders into it: the first time, and again after the host releases a frame of its slot. A frame's image is in final_layout when the host acquires it, so the host returns it to this layout before it releases the frame. VK_IMAGE_LAYOUT_UNDEFINED accepts an image in any layout and discards its previous contents. Setting it equal to final_layout, or to VK_IMAGE_LAYOUT_UNDEFINED, lets the host release a frame without a layout transition.

◆ physical_height

uint32_t mln_vulkan_borrowed_texture_descriptor::physical_height

Physical image height in device pixels. Must be positive. Defaults to 256.

◆ physical_width

uint32_t mln_vulkan_borrowed_texture_descriptor::physical_width

Physical image width in device pixels. Must be positive. Defaults to 256.

◆ texture_count

size_t mln_vulkan_borrowed_texture_descriptor::texture_count

Number of images, which is the ring depth, from one to MLN_TEXTURE_RING_MAX_DEPTH. A replacement keeps the count the session attached with.

◆ textures

const mln_vulkan_borrowed_texture* mln_vulkan_borrowed_texture_descriptor::textures

The ring's images, one per slot, in slot order. Required.

The call copies the array before it returns. Only the images it names must stay valid: until set_target replaces them, until detach completes, or until abandon returns. The images are distinct, and each image must be usable on context.graphics_queue's family without an ownership transfer (VK_SHARING_MODE_EXCLUSIVE on that family, or CONCURRENT).

The caller must guarantee that each image's dimensions equal physical_width and physical_height. The session does not validate those dimensions.


The documentation for this struct was generated from the following file: