33#define COMP_SCRATCH_NUM_IMAGES (4)
114 const VkFormat format);
161 return cssi->
images[index].image;
172static inline VkImageView
177 VkImageView view = rsci->srgb_view;
178 if (view != VK_NULL_HANDLE) {
183 return rsci->unorm_view;
194static inline VkImageView
200 return rsci->unorm_view;
#define COMP_SCRATCH_NUM_IMAGES
The number of images for each view, works like a swapchain.
Definition: comp_scratch.h:33
void comp_scratch_single_images_init(struct comp_scratch_single_images *cssi)
Init the struct, this function must be called before calling any other function on this struct,...
Definition: comp_scratch.c:319
static VkImageView comp_scratch_single_images_get_sample_view(struct comp_scratch_single_images *cssi, uint32_t index)
Get the image view for sampling, it will apply any automatic linearization, aka sRGB gamma curve corr...
Definition: comp_scratch.h:173
void comp_scratch_single_images_clear_debug(struct comp_scratch_single_images *cssi)
Clears the debug output, this causes nothing to be shown in the debug UI.
Definition: comp_scratch.c:416
void comp_scratch_single_images_destroy(struct comp_scratch_single_images *cssi)
Destroys scratch image struct, if any images has been allocated must call free before as this functio...
Definition: comp_scratch.c:422
void comp_scratch_single_images_done(struct comp_scratch_single_images *cssi)
After calling get and rendering to the image you call this function to signal that you are done with ...
Definition: comp_scratch.c:390
void comp_scratch_single_images_get(struct comp_scratch_single_images *cssi, uint32_t *out_index)
Get the next free image, after this function has been called you must call either done or discard bef...
Definition: comp_scratch.c:384
static VkImageView comp_scratch_single_images_get_storage_view(struct comp_scratch_single_images *cssi, uint32_t index)
Get the image view for storage or direct value, no linearization will be done.
Definition: comp_scratch.h:195
void comp_scratch_single_images_free(struct comp_scratch_single_images *cssi, struct vk_bundle *vk)
Free all images allocated, init must be called before calling this function, is safe to call without ...
Definition: comp_scratch.c:359
bool comp_scratch_single_images_ensure(struct comp_scratch_single_images *cssi, struct vk_bundle *vk, VkExtent2D extent, const VkFormat format)
Ensure that the scratch images are allocated and match extent size, and format.
Definition: comp_scratch.c:335
bool comp_scratch_single_images_ensure_mutable(struct comp_scratch_single_images *cssi, struct vk_bundle *vk, VkExtent2D extent)
Ensure that the scratch images are allocated and match extent size, and srgb_format unorm_format form...
Definition: comp_scratch.c:351
static VkImage comp_scratch_single_images_get_image(struct comp_scratch_single_images *cssi, uint32_t index)
Get the image for the given index.
Definition: comp_scratch.h:159
void comp_scratch_single_images_discard(struct comp_scratch_single_images *cssi)
Discard a get call, this clears the image debug part causing no image to be shown in the debug UI.
Definition: comp_scratch.c:408
The NEW compositor rendering code header.
Small helper struct to deal with indices.
Definition: comp_scratch.h:48
Holds scratch images for a single view, designed to work with render code.
Definition: comp_scratch.h:69
struct xrt_image_native native_images[(4)]
Exposed via unid.
Definition: comp_scratch.h:80
struct comp_scratch_indices indices
Keeping track of indices.
Definition: comp_scratch.h:83
struct xrt_swapchain_create_info info
Exposed via unid.
Definition: comp_scratch.h:77
xrt_limited_unique_id_t limited_unique_id
Process unique id, used for caching.
Definition: comp_scratch.h:86
struct u_native_images_debug unid
To connect to the debug UI.
Definition: comp_scratch.h:74
struct render_scratch_color_image images[(4)]
Images used when rendering.
Definition: comp_scratch.h:71
Holds scartch images for a stereo views, designed to work with render code.
Definition: comp_scratch.h:263
struct u_native_images_debug unid
Debug output for each view.
Definition: comp_scratch.h:274
struct xrt_image_native native_images[(4)]
Count always equals to the number of rsis.
Definition: comp_scratch.h:277
xrt_limited_unique_id_t limited_unique_id
Process unique id, used for caching.
Definition: comp_scratch.h:281
struct comp_scratch_indices indices
Keeping track of indices.
Definition: comp_scratch.h:269
Small helper struct to hold a scratch image, intended to be used with the compute pipeline where both...
Definition: render_interface.h:643
Helper struct to hold scratch images.
Definition: render_interface.h:654
A struct for debugging one or more native images.
Definition: u_native_images_debug.h:27
A bundle of Vulkan functions and objects, used by both Compositor and Compositor client code.
Definition: vk_helpers.h:51
A single image of a swapchain based on native buffer handles.
Definition: xrt_compositor.h:2158
A limited unique id, it is only unique for the process it is in, so must not be used or synchronized ...
Definition: xrt_defines.h:80
Swapchain creation info.
Definition: xrt_compositor.h:879
Special code for managing a variable tracked swapchain.
Common Vulkan code header.