• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright © Microsoft Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21  * IN THE SOFTWARE.
22  */
23 
24 #ifndef D3D12_FORMATS_H
25 #define D3D12_FORMATS_H
26 
27 #include <directx/dxgiformat.h>
28 
29 #include "pipe/p_format.h"
30 #include "pipe/p_defines.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 DXGI_FORMAT
37 d3d12_get_format(enum pipe_format format);
38 
39 DXGI_FORMAT
40 d3d12_get_resource_srv_format(enum pipe_format f, enum pipe_texture_target target);
41 
42 DXGI_FORMAT
43 d3d12_get_resource_rt_format(enum pipe_format f);
44 
45 unsigned
46 d3d12_non_opaque_plane_count(DXGI_FORMAT f);
47 
48 struct d3d12_format_info {
49    const enum pipe_swizzle *swizzle;
50    int plane_slice;
51 };
52 
53 struct d3d12_format_info
54 d3d12_get_format_info(enum pipe_format format, enum pipe_texture_target);
55 
56 enum pipe_format
57 d3d12_emulated_vtx_format(enum pipe_format fmt);
58 
59 unsigned
60 d3d12_get_format_start_plane(enum pipe_format fmt);
61 
62 unsigned
63 d3d12_get_format_num_planes(enum pipe_format fmt);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif
70