Monado OpenXR Runtime
Loading...
Searching...
No Matches
render_shader_specialization_helpers.h
Go to the documentation of this file.
1// Copyright 2026, NVIDIA CORPORATION.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Build render shader specialization keys from render configuration.
6 * @ingroup aux_render
7 */
8
9#pragma once
10
12
13#include <stdint.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19static inline struct render_distortion_spec
20render_make_distortion_spec(uint32_t distortion_texel_count, VkBool32 do_timewarp, uint32_t view_count)
21{
22 struct render_distortion_spec spec = {
23 .distortion_texel_count = (int32_t)distortion_texel_count,
24 .do_timewarp = do_timewarp,
25 .view_count = (int32_t)view_count,
26 };
27
28 return spec;
29}
30
31static inline struct render_layer_spec
32render_make_layer_spec(VkBool32 do_timewarp,
33 VkBool32 do_color_correction,
34 uint32_t sampler_array_size,
35 float inset_blend_edge)
36{
37 struct render_layer_spec spec = {
38 .do_timewarp = do_timewarp,
39 .do_color_correction = do_color_correction,
40 .sampler_array_size = (int32_t)sampler_array_size,
41 .inset_blend_edge = inset_blend_edge,
42 };
43
44 return spec;
45}
46
47static inline struct render_blit_spec
48render_make_blit_spec(uint32_t color_transform_mode)
49{
50 struct render_blit_spec spec = {
51 .color_transform_mode = (int32_t)color_transform_mode,
52 };
53
54 return spec;
55}
56
57static inline struct render_blit_ms_spec
58render_make_blit_ms_spec(uint32_t color_transform_mode)
59{
60 struct render_blit_ms_spec spec = {
61 .color_transform_mode = (int32_t)color_transform_mode,
62 };
63
64 return spec;
65}
66
67#ifdef __cplusplus
68}
69#endif
Shader specialization structs for render compute shaders.