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>
35 uint32_t num_samples
= 1;
36 uint32_t num_levels
= 1;
37 uint32_t num_layers
= 1;
38 VkFormat color_format
= VK_FORMAT_R32G32B32A32_SFLOAT
;
39 VkFormat depth_format
= VK_FORMAT_D32_SFLOAT
;
40 VkImageTiling color_tiling
= VK_IMAGE_TILING_OPTIMAL
;
41 VkImageTiling depth_tiling
= VK_IMAGE_TILING_OPTIMAL
;
42 VkImageLayout color_in_layout
= VK_IMAGE_LAYOUT_UNDEFINED
;
43 VkImageLayout color_end_layout
= VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
;
44 VkImageLayout depth_in_layout
= VK_IMAGE_LAYOUT_UNDEFINED
;
45 VkImageLayout depth_end_layout
= VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
;
47 const struct format_mapping vk_gl_format
[] =
49 { "RGBA 4 UNORM linear", GL_RGBA4
, VK_FORMAT_R4G4B4A4_UNORM_PACK16
, FLOAT_FS
, 4, 4, 4, 4,
50 VK_IMAGE_TILING_LINEAR
},
51 { "RGBA 4 UNORM optimal", GL_RGBA4
, VK_FORMAT_R4G4B4A4_UNORM_PACK16
, FLOAT_FS
, 4, 4, 4, 4,
52 VK_IMAGE_TILING_OPTIMAL
},
54 { "RGB 5 A1 UNORM linear", GL_RGB5_A1
, VK_FORMAT_R5G5B5A1_UNORM_PACK16
, FLOAT_FS
, 5, 5, 5, 1,
55 VK_IMAGE_TILING_LINEAR
},
56 { "RGB 5 A1 UNORM optimal", GL_RGB5_A1
, VK_FORMAT_R5G5B5A1_UNORM_PACK16
, FLOAT_FS
, 5, 5, 5, 1,
57 VK_IMAGE_TILING_OPTIMAL
},
59 { "RGBA 8 UNORM linear", GL_RGBA8
, VK_FORMAT_R8G8B8A8_UNORM
, FLOAT_FS
, 8, 8, 8, 8,
60 VK_IMAGE_TILING_LINEAR
},
61 { "RGBA 8 UNORM optimal", GL_RGBA8
, VK_FORMAT_R8G8B8A8_UNORM
, FLOAT_FS
, 8, 8, 8, 8,
62 VK_IMAGE_TILING_OPTIMAL
},
64 { "RGBA 8 SNORM linear", GL_RGBA8_SNORM
, VK_FORMAT_R8G8B8A8_SNORM
, INT_FS
, 8, 8, 8, 8,
65 VK_IMAGE_TILING_LINEAR
},
66 { "RGBA 8 SNORM optimal", GL_RGBA8_SNORM
, VK_FORMAT_R8G8B8A8_SNORM
, INT_FS
, 8, 8, 8, 8,
67 VK_IMAGE_TILING_OPTIMAL
},
69 { "RGBA 8 SRGB linear", GL_SRGB8_ALPHA8
, VK_FORMAT_R8G8B8A8_SRGB
, FLOAT_FS
, 8, 8, 8, 8,
70 VK_IMAGE_TILING_LINEAR
},
71 { "RGBA 8 SRGB optimal", GL_SRGB8_ALPHA8
, VK_FORMAT_R8G8B8A8_SRGB
, FLOAT_FS
, 8, 8, 8, 8,
72 VK_IMAGE_TILING_OPTIMAL
},
74 { "RGBA 8 INT linear", GL_RGBA8I
, VK_FORMAT_R8G8B8A8_SINT
, INT_FS
, 8, 8, 8, 8,
75 VK_IMAGE_TILING_LINEAR
},
76 { "RGBA 8 INT optimal", GL_RGBA8I
, VK_FORMAT_R8G8B8A8_SINT
, INT_FS
, 8, 8, 8, 8,
77 VK_IMAGE_TILING_OPTIMAL
},
79 { "RGBA 8 UINT linear", GL_RGBA8UI
, VK_FORMAT_R8G8B8A8_UINT
, UINT_FS
, 8, 8, 8, 8,
80 VK_IMAGE_TILING_LINEAR
},
81 { "RGBA 8 UINT optimal", GL_RGBA8UI
, VK_FORMAT_R8G8B8A8_UINT
, UINT_FS
, 8, 8, 8, 8,
82 VK_IMAGE_TILING_OPTIMAL
},
84 { "RGB 10 A2 UNORM linear", GL_RGB10_A2
, VK_FORMAT_A2R10G10B10_UNORM_PACK32
, FLOAT_FS
, 10, 10, 10, 2,
85 VK_IMAGE_TILING_LINEAR
},
86 { "RGB 10 A2 UNORM optimal", GL_RGB10_A2
, VK_FORMAT_A2R10G10B10_UNORM_PACK32
, FLOAT_FS
, 10, 10, 10, 2,
87 VK_IMAGE_TILING_OPTIMAL
},
89 { "RGB 10 A2 UINT linear", GL_RGB10_A2UI
, VK_FORMAT_A2R10G10B10_UINT_PACK32
, UINT_FS
, 10, 10, 10, 2,
90 VK_IMAGE_TILING_LINEAR
},
91 { "RGB 10 A2 UINT optimal", GL_RGB10_A2UI
, VK_FORMAT_A2R10G10B10_UINT_PACK32
, UINT_FS
, 10, 10, 10, 2,
92 VK_IMAGE_TILING_OPTIMAL
},
94 { "RGBA 12 UNORM linear", GL_RGBA12
, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16
, FLOAT_FS
, 12, 12, 12, 12,
95 VK_IMAGE_TILING_LINEAR
},
96 { "RGBA 12 UNORM optimal", GL_RGBA12
, VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16
, FLOAT_FS
, 12, 12, 12, 12,
97 VK_IMAGE_TILING_OPTIMAL
},
99 { "RGBA 16 UNORM linear", GL_RGBA16
, VK_FORMAT_R16G16B16A16_UNORM
, FLOAT_FS
, 16, 16, 16, 16,
100 VK_IMAGE_TILING_LINEAR
},
101 { "RGBA 16 UNORM optimal", GL_RGBA16
, VK_FORMAT_R16G16B16A16_UNORM
, FLOAT_FS
, 16, 16, 16, 16,
102 VK_IMAGE_TILING_OPTIMAL
},
104 { "RGBA 16 SNORM linear", GL_RGBA16_SNORM
, VK_FORMAT_R16G16B16A16_SNORM
, INT_FS
, 16, 16, 16, 16,
105 VK_IMAGE_TILING_LINEAR
},
106 { "RGBA 16 SNORM optimal", GL_RGBA16_SNORM
, VK_FORMAT_R16G16B16A16_SNORM
, INT_FS
, 16, 16, 16, 16,
107 VK_IMAGE_TILING_OPTIMAL
},
109 { "RGBA 16 SFLOAT linear", GL_RGBA16F
, VK_FORMAT_R16G16B16A16_SFLOAT
, FLOAT_FS
, 16, 16, 16, 16,
110 VK_IMAGE_TILING_LINEAR
},
111 { "RGBA 16 SFLOAT optimal", GL_RGBA16F
, VK_FORMAT_R16G16B16A16_SFLOAT
, FLOAT_FS
, 16, 16, 16, 16,
112 VK_IMAGE_TILING_OPTIMAL
},
114 { "RGBA 16 INT linear", GL_RGBA16I
, VK_FORMAT_R16G16B16A16_SINT
, INT_FS
, 16, 16, 16, 16,
115 VK_IMAGE_TILING_LINEAR
},
116 { "RGBA 16 INT optimal", GL_RGBA16I
, VK_FORMAT_R16G16B16A16_SINT
, INT_FS
, 16, 16, 16, 16,
117 VK_IMAGE_TILING_OPTIMAL
},
119 { "RGBA 16 UINT linear", GL_RGBA16UI
, VK_FORMAT_R16G16B16A16_UINT
, UINT_FS
, 16, 16, 16, 16,
120 VK_IMAGE_TILING_LINEAR
},
121 { "RGBA 16 UINT optimal", GL_RGBA16UI
, VK_FORMAT_R16G16B16A16_UINT
, UINT_FS
, 16, 16, 16, 16,
122 VK_IMAGE_TILING_OPTIMAL
},
124 { "RGBA 32 SFLOAT linear", GL_RGBA32F
, VK_FORMAT_R32G32B32A32_SFLOAT
, FLOAT_FS
, 32, 32, 32, 32,
125 VK_IMAGE_TILING_LINEAR
},
126 { "RGBA 32 SFLOAT optimal", GL_RGBA32F
, VK_FORMAT_R32G32B32A32_SFLOAT
, FLOAT_FS
, 32, 32, 32, 32,
127 VK_IMAGE_TILING_OPTIMAL
},
129 { "RGBA 32 INT linear", GL_RGBA32I
, VK_FORMAT_R32G32B32A32_SINT
, INT_FS
, 32, 32, 32, 32,
130 VK_IMAGE_TILING_LINEAR
},
131 { "RGBA 32 INT optimal", GL_RGBA32I
, VK_FORMAT_R32G32B32A32_SINT
, INT_FS
, 32, 32, 32, 32,
132 VK_IMAGE_TILING_OPTIMAL
},
134 { "RGBA 32 UINT linear", GL_RGBA32UI
, VK_FORMAT_R32G32B32A32_UINT
, FLOAT_FS
, 32, 32, 32, 32,
135 VK_IMAGE_TILING_LINEAR
},
136 { "RGBA 32 UINT optimal", GL_RGBA32UI
, VK_FORMAT_R32G32B32A32_UINT
, FLOAT_FS
, 32, 32, 32, 32,
137 VK_IMAGE_TILING_OPTIMAL
},
140 const struct ds_format depth_stencil_formats
[] = {
141 {"D16", GL_DEPTH_COMPONENT16
, VK_FORMAT_D16_UNORM
},
142 {"D32S8", GL_DEPTH32F_STENCIL8
, VK_FORMAT_D32_SFLOAT_S8_UINT
},
143 {"D24S8", GL_DEPTH24_STENCIL8
, VK_FORMAT_D24_UNORM_S8_UINT
},
146 #endif /* PARAMS_H */