The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/util: Export the gfx layer squasher.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2380>

+34
+1
doc/changes/compositor/mr.2380.md
··· 1 + Add: Expose a `comp_render_gfx_layers` (formerly called `do_layers`) to match the `comp_render_cs_layers` function, which squashes layers.
+33
src/xrt/compositor/util/comp_render.h
··· 317 317 } 318 318 319 319 /*! 320 + * Dispatch the (graphics pipeline) layer squasher, on any number of views. 321 + * 322 + * All source layer images needs to be in the correct image layout, no barrier 323 + * is inserted for them. The target images are barriered from undefined to general 324 + * so they can be written to, then to the layout defined by @p transition_to. 325 + * 326 + * Expected layouts: 327 + * 328 + * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL` 329 + * - Target images: Any 330 + * 331 + * After call layouts: 332 + * 333 + * - Layer images: `VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL` 334 + * - Target images: @p transition_to 335 + * 336 + * @note Swapchains in the @p layers must implement @ref comp_swapchain in 337 + * addition to just @ref xrt_swapchain, as this function downcasts to @ref comp_swapchain ! 338 + * 339 + * @param render Graphics renderer object 340 + * @param[in] layers Layers to render, see note. 341 + * @param[in] layer_count Number of elements in @p layers array. 342 + * @param[in] d Common render dispatch data 343 + * @param[in] transition_to Desired image layout for target images 344 + */ 345 + void 346 + comp_render_gfx_layers(struct render_gfx *render, 347 + const struct comp_layer *layers, 348 + uint32_t layer_count, 349 + const struct comp_render_dispatch_data *d, 350 + VkImageLayout transition_to); 351 + 352 + /*! 320 353 * Writes the needed commands to the @ref render_gfx to do a full composition with distortion. 321 354 * 322 355 * Takes a set of layers, new device poses, scratch