Monado OpenXR Runtime
d3d_d3d11_bits.h
Go to the documentation of this file.
1// Copyright 2020-2022, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Usage bits for D3D11.
6 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
7 * @ingroup aux_d3d
8 */
9
10#pragma once
11
12#include "xrt/xrt_compositor.h"
13#include "xrt/xrt_windows.h"
14
15#include "d3d11.h"
16
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23static inline UINT
24d3d_convert_usage_bits_to_d3d11_bind_flags(enum xrt_swapchain_usage_bits xsub)
25{
26 int ret = 0;
27 if ((xsub & XRT_SWAPCHAIN_USAGE_COLOR) != 0) {
28 ret |= D3D11_BIND_RENDER_TARGET;
29 }
30 if ((xsub & XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL) != 0) {
31 ret |= D3D11_BIND_DEPTH_STENCIL;
32 }
33 if ((xsub & XRT_SWAPCHAIN_USAGE_UNORDERED_ACCESS) != 0) {
34 ret |= D3D11_BIND_UNORDERED_ACCESS;
35 }
36 if ((xsub & XRT_SWAPCHAIN_USAGE_SAMPLED) != 0) {
37 ret |= D3D11_BIND_SHADER_RESOURCE;
38 }
39 return ret;
40}
41
42#ifdef __cplusplus
43}
44#endif
xrt_swapchain_usage_bits
Usage of the swapchain images.
Definition: xrt_compositor.h:506
Header declaring XRT graphics interfaces.
A minimal way to include Windows.h.