40 } views[XRT_MAX_VIEWS];
86 const VkFormat format);
104 return comp_scratch_single_images_get_image(&scratch->views[view_index].
cssi, image_index);
112static inline VkImageView
115 return comp_scratch_single_images_get_sample_view(&scratch->views[view_index].
cssi, image_index);
123static inline VkImageView
126 return comp_scratch_single_images_get_storage_view(&scratch->views[view_index].
cssi, image_index);
171 for (uint32_t i = 0; i < scratch->
view_count; i++) {
172 comp_scratch_single_images_get(&scratch->views[i].
cssi, &scratch_state->views[i].index);
186 for (uint32_t i = 0; i < scratch->
view_count; i++) {
187 if (scratch_state->views[i].used) {
188 comp_scratch_single_images_done(&scratch->views[i].
cssi);
190 comp_scratch_single_images_discard(&scratch->views[i].
cssi);
Helper implementation for native compositors.
#define COMP_SCRATCH_NUM_IMAGES
The number of images for each view, works like a swapchain.
Definition comp_scratch.h:33
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition u_misc.h:68
The NEW compositor rendering code header.
Per view frame state tracking which index was gotten and if it was used.
Definition comp_high_level_scratch.h:142
Used to track the index of images gotten for the images, and if it has been used.
Definition comp_high_level_scratch.h:155
static void chl_scratch_state_init_and_get(struct chl_scratch_state *scratch_state, struct chl_scratch *scratch)
Zeros out the struct and calls get on all the images, setting the index field on the state for each v...
Definition comp_high_level_scratch.h:166
static void chl_scratch_state_discard_or_done(struct chl_scratch_state *scratch_state, struct chl_scratch *scratch)
Calls discard or done on all the scratch images, it calls done if the used field is set to true.
Definition comp_high_level_scratch.h:183
Scratch images that can be used for staging buffers.
Definition comp_high_level_scratch.h:29
VkFormat format
Format requested.
Definition comp_high_level_scratch.h:52
struct render_gfx_render_pass render_pass
Shared render passed for the views.
Definition comp_high_level_scratch.h:31
struct render_gfx_target_resources targets[(4)]
Targets for rendering to the scratch buffer.
Definition comp_high_level_scratch.h:39
static VkImage chl_scratch_get_image(struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
Get the image, see comp_scratch_single_images_get_image.
Definition comp_high_level_scratch.h:102
static VkImageView chl_scratch_get_storage_view(struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
Get the storage view, see comp_scratch_single_images_get_storage_view.
Definition comp_high_level_scratch.h:124
uint32_t view_count
Number of views that has been ensured and have Vulkan resources, all comp_scratch_single_images are a...
Definition comp_high_level_scratch.h:46
struct comp_scratch_single_images cssi
Per-view scratch images.
Definition comp_high_level_scratch.h:36
bool render_pass_initialized
Has the render pass been initialized.
Definition comp_high_level_scratch.h:55
static VkImageView chl_scratch_get_sample_view(struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
Get the sample view, see comp_scratch_single_images_get_sample_view.
Definition comp_high_level_scratch.h:113
VkExtent2D extent
The extent used to create the images.
Definition comp_high_level_scratch.h:49
Holds scratch images for a single view, designed to work with render code.
Definition comp_scratch.h:69
A render pass, while not depending on a VkFramebuffer, does depend on the format of the target image(...
Definition render_interface.h:691
Each rendering (render_gfx) render to one or more targets (render_gfx_target_resources),...
Definition render_interface.h:770
Holds all pools and static resources for rendering.
Definition render_interface.h:337