2 * Copyright © 2020 Intel Corporation
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:
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
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
21 * DEALINGS IN THE SOFTWARE.
24 * Eleni Maria Stea <estea@igalia.com>
32 uint32_t num_samples
= 1;
33 uint32_t num_levels
= 1;
34 uint32_t num_layers
= 1;
35 VkFormat color_format
= VK_FORMAT_R32G32B32A32_SFLOAT
;
36 VkFormat depth_format
= VK_FORMAT_D32_SFLOAT
;
37 VkImageTiling color_tiling
= VK_IMAGE_TILING_OPTIMAL
;
38 VkImageTiling depth_tiling
= VK_IMAGE_TILING_OPTIMAL
;
39 VkImageLayout color_in_layout
= VK_IMAGE_LAYOUT_UNDEFINED
;
40 VkImageLayout color_end_layout
= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
;
41 VkImageLayout depth_in_layout
= VK_IMAGE_LAYOUT_UNDEFINED
;
42 VkImageLayout depth_end_layout
= VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
;
44 const struct format_mapping vk_gl_format
[] =
46 { "RGBA 4 UNORM linear", GL_RGBA4
, VK_FORMAT_R4G4B4A4_UNORM_PACK16
, FLOAT_FS
, 4, 4, 4, 4,
47 VK_IMAGE_TILING_LINEAR
},
48 { "RGBA 4 UNORM optimal", GL_RGBA4
, VK_FORMAT_R4G4B4A4_UNORM_PACK16
, FLOAT_FS
, 4, 4, 4, 4,
49 VK_IMAGE_TILING_OPTIMAL
},
51 { "RGB 5 A1 UNORM linear", GL_RGB5_A1
, VK_FORMAT_R5G5B5A1_UNORM_PACK16
, FLOAT_FS
, 5, 5, 5, 1,
52 VK_IMAGE_TILING_LINEAR
},
53 { "RGB 5 A1 UNORM optimal", GL_RGB5_A1
, VK_FORMAT_R5G5B5A1_UNORM_PACK16
, FLOAT_FS
, 5, 5, 5, 1,
54 VK_IMAGE_TILING_OPTIMAL
},
56 { "RGBA 8 UNORM linear", GL_RGBA8
, VK_FORMAT_R8G8B8A8_UNORM
, FLOAT_FS
, 8, 8, 8, 8,
57 VK_IMAGE_TILING_LINEAR
},
58 { "RGBA 8 UNORM optimal", GL_RGBA8
, VK_FORMAT_R8G8B8A8_UNORM
, FLOAT_FS
, 8, 8, 8, 8,
59 VK_IMAGE_TILING_OPTIMAL
},
61 { "RGBA 8 SNORM linear", GL_RGBA8_SNORM
, VK_FORMAT_R8G8B8A8_SNORM
, INT_FS
, 8, 8, 8, 8,
62 VK_IMAGE_TILING_LINEAR
},
63 { "RGBA 8 SNORM optimal", GL_RGBA8_SNORM
, VK_FORMAT_R8G8B8A8_SNORM
, INT_FS
, 8, 8, 8, 8,
64 VK_IMAGE_TILING_OPTIMAL
},
66 { "RGBA 8 SRGB linear", GL_SRGB8_ALPHA8
, VK_FORMAT_R8G8B8A8_SRGB
, FLOAT_FS
, 8, 8, 8, 8,
67 VK_IMAGE_TILING_LINEAR
},
68 { "RGBA 8 SRGB optimal", GL_SRGB8_ALPHA8
, VK_FORMAT_R8G8B8A8_SRGB
, FLOAT_FS
, 8, 8, 8, 8,
69 VK_IMAGE_TILING_OPTIMAL
},
71 { "RGBA 8 INT linear", GL_RGBA8I
, VK_FORMAT_R8G8B8A8_SINT
, INT_FS
, 8, 8, 8, 8,
72 VK_IMAGE_TILING_LINEAR
},
73 { "RGBA 8 INT optimal", GL_RGBA8I
, VK_FORMAT_R8G8B8A8_SINT
, INT_FS
, 8, 8, 8, 8,
74 VK_IMAGE_TILING_OPTIMAL
},
76 { "RGBA 8 UINT linear", GL_RGBA8UI
, VK_FORMAT_R8G8B8A8_UINT
, UINT_FS
, 8, 8, 8, 8,
77 VK_IMAGE_TILING_LINEAR
},
78 { "RGBA 8 UINT optimal", GL_RGBA8UI
, VK_FORMAT_R8G8B8A8_UINT
, UINT_FS
, 8, 8, 8, 8,
79 VK_IMAGE_TILING_OPTIMAL
},
81 { "RGB 10 A2 UNORM linear", GL_RGB10_A2
, VK_FORMAT_A2R10G10B10_UNORM_PACK32
, FLOAT_FS
, 10, 10, 10, 2,
82 VK_IMAGE_TILING_LINEAR
},
83 { "RGB 10 A2 UNORM optimal", GL_RGB10_A2
, VK_FORMAT_A2R10G10B10_UNORM_PACK32
, FLOAT_FS
, 10, 10, 10, 2,
84 VK_IMAGE_TILING_OPTIMAL
},
86 { "RGB 10 A2 UINT linear", GL_RGB10_A2UI
, VK_FORMAT_A2R10G10B10_UINT_PACK32
, UINT_FS
, 10, 10, 10, 2,
87 VK_IMAGE_TILING_LINEAR
},
88 { "RGB 10 A2 UINT optimal", GL_RGB10_A2UI
, VK_FORMAT_A2R10G10B10_UINT_PACK32
, UINT_FS
, 10, 10, 10, 2,
89 VK_IMAGE_TILING_OPTIMAL
},
91 { "RGBA 12 UNORM linear", GL_RGBA12
, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16
, FLOAT_FS
, 12, 12, 12, 12,
92 VK_IMAGE_TILING_LINEAR
},
93 { "RGBA 12 UNORM optimal", GL_RGBA12
, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16
, FLOAT_FS
, 12, 12, 12, 12,
94 VK_IMAGE_TILING_OPTIMAL
},
96 { "RGBA 16 UNORM linear", GL_RGBA16
, VK_FORMAT_R16G16B16A16_UNORM
, FLOAT_FS
, 16, 16, 16, 16,
97 VK_IMAGE_TILING_LINEAR
},
98 { "RGBA 16 UNORM optimal", GL_RGBA16
, VK_FORMAT_R16G16B16A16_UNORM
, FLOAT_FS
, 16, 16, 16, 16,
99 VK_IMAGE_TILING_OPTIMAL
},
101 { "RGBA 16 SNORM linear", GL_RGBA16_SNORM
, VK_FORMAT_R16G16B16A16_SNORM
, INT_FS
, 16, 16, 16, 16,
102 VK_IMAGE_TILING_LINEAR
},
103 { "RGBA 16 SNORM optimal", GL_RGBA16_SNORM
, VK_FORMAT_R16G16B16A16_SNORM
, INT_FS
, 16, 16, 16, 16,
104 VK_IMAGE_TILING_OPTIMAL
},
106 { "RGBA 16 SFLOAT linear", GL_RGBA16F
, VK_FORMAT_R16G16B16A16_SFLOAT
, FLOAT_FS
, 16, 16, 16, 16,
107 VK_IMAGE_TILING_LINEAR
},
108 { "RGBA 16 SFLOAT optimal", GL_RGBA16F
, VK_FORMAT_R16G16B16A16_SFLOAT
, FLOAT_FS
, 16, 16, 16, 16,
109 VK_IMAGE_TILING_OPTIMAL
},
111 { "RGBA 16 INT linear", GL_RGBA16I
, VK_FORMAT_R16G16B16A16_SINT
, INT_FS
, 16, 16, 16, 16,
112 VK_IMAGE_TILING_LINEAR
},
113 { "RGBA 16 INT optimal", GL_RGBA16I
, VK_FORMAT_R16G16B16A16_SINT
, INT_FS
, 16, 16, 16, 16,
114 VK_IMAGE_TILING_OPTIMAL
},
116 { "RGBA 16 UINT linear", GL_RGBA16UI
, VK_FORMAT_R16G16B16A16_UINT
, UINT_FS
, 16, 16, 16, 16,
117 VK_IMAGE_TILING_LINEAR
},
118 { "RGBA 16 UINT optimal", GL_RGBA16UI
, VK_FORMAT_R16G16B16A16_UINT
, UINT_FS
, 16, 16, 16, 16,
119 VK_IMAGE_TILING_OPTIMAL
},
121 { "RGBA 32 SFLOAT linear", GL_RGBA32F
, VK_FORMAT_R32G32B32A32_SFLOAT
, FLOAT_FS
, 32, 32, 32, 32,
122 VK_IMAGE_TILING_LINEAR
},
123 { "RGBA 32 SFLOAT optimal", GL_RGBA32F
, VK_FORMAT_R32G32B32A32_SFLOAT
, FLOAT_FS
, 32, 32, 32, 32,
124 VK_IMAGE_TILING_OPTIMAL
},
126 { "RGBA 32 INT linear", GL_RGBA32I
, VK_FORMAT_R32G32B32A32_SINT
, INT_FS
, 32, 32, 32, 32,
127 VK_IMAGE_TILING_LINEAR
},
128 { "RGBA 32 INT optimal", GL_RGBA32I
, VK_FORMAT_R32G32B32A32_SINT
, INT_FS
, 32, 32, 32, 32,
129 VK_IMAGE_TILING_OPTIMAL
},
131 { "RGBA 32 UINT linear", GL_RGBA32UI
, VK_FORMAT_R32G32B32A32_UINT
, FLOAT_FS
, 32, 32, 32, 32,
132 VK_IMAGE_TILING_LINEAR
},
133 { "RGBA 32 UINT optimal", GL_RGBA32UI
, VK_FORMAT_R32G32B32A32_UINT
, FLOAT_FS
, 32, 32, 32, 32,
134 VK_IMAGE_TILING_OPTIMAL
},
137 const struct ds_format depth_stencil_formats
[] = {
138 {"D16", GL_DEPTH_COMPONENT16
, VK_FORMAT_D16_UNORM
},
139 {"D32S8", GL_DEPTH32F_STENCIL8
, VK_FORMAT_D32_SFLOAT_S8_UINT
},
140 {"D24S8", GL_DEPTH24_STENCIL8
, VK_FORMAT_D24_UNORM_S8_UINT
},
143 #endif /* PARAMS_H */