Debian Codegraph @

gsk/gpu/gskvulkandevice.c

raw symbols SCIP
1 #cxx . . $ `<file>/gsk/gpu/gskvulkandevice.c`/include "config.h"cxx . . $ `<file>/build/config.h`/
2
3 #include "gskvulkandeviceprivate.h"cxx . . $ `<file>/gsk/gpu/gskvulkandeviceprivate.h`/
4
5 #include "gskgpuglobalsopprivate.h"cxx . . $ `<file>/gsk/gpu/gskgpuglobalsopprivate.h`/
6 #include "gskgpushaderopprivate.h"cxx . . $ `<file>/gsk/gpu/gskgpushaderopprivate.h`/
7 #include "gskvulkanbufferprivate.h"cxx . . $ `<file>/gsk/gpu/gskvulkanbufferprivate.h`/
8 #include "gskvulkanimageprivate.h"cxx . . $ `<file>/gsk/gpu/gskvulkanimageprivate.h`/
9 #include "gskvulkanycbcrprivate.h"cxx . . $ `<file>/gsk/gpu/gskvulkanycbcrprivate.h`/
10
11 #include "gdk/gdkdisplayprivate.h"cxx . . $ `<file>/gdk/gdkdisplayprivate.h`/
12 #include "gdk/gdkvulkancontextprivate.h"cxx . . $ `<file>/gdk/gdkvulkancontextprivate.h`/
13 #include "gdk/gdkprofilerprivate.h"cxx . . $ `<file>/gdk/gdkprofilerprivate.h`/
14
15 #define GDK_ARRAY_NAMEcxx . . $ `gsk/gpu/gskvulkandevice.c:15:9`! descriptor_pools
16 #define GDK_ARRAY_TYPE_NAMEcxx . . $ `gsk/gpu/gskvulkandevice.c:16:9`! DescriptorPools
17 #define GDK_ARRAY_ELEMENT_TYPEcxx . . $ `gsk/gpu/gskvulkandevice.c:17:9`! VkDescriptorPool
18 #define GDK_ARRAY_PREALLOCcxx . . $ `gsk/gpu/gskvulkandevice.c:18:9`! 4
19 #define GDK_ARRAY_NO_MEMSETcxx . . $ `gsk/gpu/gskvulkandevice.c:19:9`! 1
20 #include "gdk/gdkarrayimpl.c"cxx . . $ `<file>/gdk/gdkarrayimpl.c`/
21
22 struct _GskVulkanDevicecxx . . $ _GskVulkanDevice#
23 {
24 GskGpuDevicecxx . . $ GskGpuDevice# parent_instancecxx . . $ _GskVulkanDevice#parent_instance.;
25
26 GskVulkanAllocatorcxx . . $ GskVulkanAllocator# *allocatorscxx . . $ _GskVulkanDevice#allocators.[VK_MAX_MEMORY_TYPEScxx . . $ `<external>/13734482859137699468/vulkan_core.h:131:9`!];
27 GskVulkanAllocatorcxx . . $ GskVulkanAllocator# *external_allocatorcxx . . $ _GskVulkanDevice#external_allocator.;
28 GdkVulkanFeaturescxx . . $ GdkVulkanFeatures# featurescxx . . $ _GskVulkanDevice#features.;
29
30 GHashTablecxx . . $ GHashTable# *render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache.;
31 GHashTablecxx . . $ GHashTable# *pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache.;
32
33 VkCommandPoolcxx . . $ VkCommandPool# vk_command_poolcxx . . $ _GskVulkanDevice#vk_command_pool.;
34 DescriptorPoolscxx . . $ DescriptorPools# descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.;
35 gsizecxx . . $ gsize# last_poolcxx . . $ _GskVulkanDevice#last_pool.;
36 VkSamplercxx . . $ VkSampler# vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[GSK_GPU_SAMPLER_N_SAMPLERScxx . . $ GSK_GPU_SAMPLER_N_SAMPLERS.];
37 VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout# vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout.;
38 VkPipelineLayoutcxx . . $ VkPipelineLayout# default_vk_pipeline_layoutcxx . . $ _GskVulkanDevice#default_vk_pipeline_layout.;
39 };
40
41 struct _GskVulkanDeviceClasscxx . . $ _GskVulkanDeviceClass#
42 {
43 GskGpuDeviceClasscxx . . $ GskGpuDeviceClass# parent_classcxx . . $ _GskVulkanDeviceClass#parent_class.;
44 };
45
46 G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (GskVulkanDevice, gsk_vulkan_device, GSK_TYPE_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:9:9`!)
47
48 typedef struct _ConversionCacheEntrycxx . . $ _ConversionCacheEntry# ConversionCacheEntrycxx . . $ ConversionCacheEntry#;
49 typedef struct _PipelineCacheKeycxx . . $ _PipelineCacheKey# PipelineCacheKeycxx . . $ PipelineCacheKey#;
50 typedef struct _RenderPassCacheKeycxx . . $ _RenderPassCacheKey# RenderPassCacheKeycxx . . $ RenderPassCacheKey#;
51
52 struct _ConversionCacheEntrycxx . . $ _ConversionCacheEntry#
53 {
54 VkFormatcxx . . $ VkFormat# vk_formatcxx . . $ _ConversionCacheEntry#vk_format.;
55
56 /* actual data */
57 VkSamplerYcbcrConversioncxx . . $ VkSamplerYcbcrConversion# vk_conversioncxx . . $ _ConversionCacheEntry#vk_conversion.;
58 VkSamplercxx . . $ VkSampler# vk_samplercxx . . $ _ConversionCacheEntry#vk_sampler.;
59 };
60
61 struct _PipelineCacheKeycxx . . $ _PipelineCacheKey#
62 {
63 const GskGpuShaderOpClasscxx . . $ GskGpuShaderOpClass# *op_classcxx . . $ _PipelineCacheKey#op_class.;
64 GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flagscxx . . $ _PipelineCacheKey#flags.;
65 GskGpuColorStatescxx . . $ GskGpuColorStates# color_statescxx . . $ _PipelineCacheKey#color_states.;
66 guint32cxx . . $ guint32# variationcxx . . $ _PipelineCacheKey#variation.;
67 GskGpuBlendcxx . . $ GskGpuBlend# blendcxx . . $ _PipelineCacheKey#blend.;
68 VkFormatcxx . . $ VkFormat# vk_formatcxx . . $ _PipelineCacheKey#vk_format.;
69 VkPipelineLayoutcxx . . $ VkPipelineLayout# vk_layoutcxx . . $ _PipelineCacheKey#vk_layout.;
70 VkPipelinecxx . . $ VkPipeline# vk_pipelinecxx . . $ _PipelineCacheKey#vk_pipeline.;
71 };
72
73 struct _RenderPassCacheKeycxx . . $ _RenderPassCacheKey#
74 {
75 VkFormatcxx . . $ VkFormat# formatcxx . . $ _RenderPassCacheKey#format.;
76 VkAttachmentLoadOpcxx . . $ VkAttachmentLoadOp# vk_load_opcxx . . $ _RenderPassCacheKey#vk_load_op.;
77 VkImageLayoutcxx . . $ VkImageLayout# from_layoutcxx . . $ _RenderPassCacheKey#from_layout.;
78 VkImageLayoutcxx . . $ VkImageLayout# to_layoutcxx . . $ _RenderPassCacheKey#to_layout.;
79 VkRenderPasscxx . . $ VkRenderPass# render_passcxx . . $ _RenderPassCacheKey#render_pass.;
80 };
81
82 static guintcxx . . $ guint#
83 pipeline_cache_key_hashcxx . . $ pipeline_cache_key_hash(b11f534102b1ad6). (gconstpointercxx . . $ gconstpointer# data)
84 {
85 const PipelineCacheKeycxx . . $ PipelineCacheKey# *key = data;
86
87 return GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (key->op_class) ^
88 key->flagscxx . . $ _PipelineCacheKey#flags. ^
89 (key->color_statescxx . . $ _PipelineCacheKey#color_states. << 8) ^
90 (key->variationcxx . . $ _PipelineCacheKey#variation. << 16) ^
91 (key->blendcxx . . $ _PipelineCacheKey#blend. << 24) ^
92 GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (key->vk_layout) ^
93 (key->vk_formatcxx . . $ _PipelineCacheKey#vk_format. << 21) ^ (key->vk_formatcxx . . $ _PipelineCacheKey#vk_format. >> 11);
94 }
95
96 static gbooleancxx . . $ gboolean#
97 pipeline_cache_key_equalcxx . . $ pipeline_cache_key_equal(9148c8c3ff42c9d8). (gconstpointercxx . . $ gconstpointer# a,
98 gconstpointercxx . . $ gconstpointer# b)
99 {
100 const PipelineCacheKeycxx . . $ PipelineCacheKey# *keya = a;
101 const PipelineCacheKeycxx . . $ PipelineCacheKey# *keyb = b;
102
103 return keya->op_classcxx . . $ _PipelineCacheKey#op_class. == keyb->op_classcxx . . $ _PipelineCacheKey#op_class. &&
104 keya->flagscxx . . $ _PipelineCacheKey#flags. == keyb->flagscxx . . $ _PipelineCacheKey#flags. &&
105 keya->color_statescxx . . $ _PipelineCacheKey#color_states. == keyb->color_statescxx . . $ _PipelineCacheKey#color_states. &&
106 keya->variationcxx . . $ _PipelineCacheKey#variation. == keyb->variationcxx . . $ _PipelineCacheKey#variation. &&
107 keya->blendcxx . . $ _PipelineCacheKey#blend. == keyb->blendcxx . . $ _PipelineCacheKey#blend. &&
108 keya->vk_layoutcxx . . $ _PipelineCacheKey#vk_layout. == keyb->vk_layoutcxx . . $ _PipelineCacheKey#vk_layout. &&
109 keya->vk_formatcxx . . $ _PipelineCacheKey#vk_format. == keyb->vk_formatcxx . . $ _PipelineCacheKey#vk_format.;
110 }
111
112 static guintcxx . . $ guint#
113 render_pass_cache_key_hashcxx . . $ render_pass_cache_key_hash(b11f534102b1ad6). (gconstpointercxx . . $ gconstpointer# data)
114 {
115 const RenderPassCacheKeycxx . . $ RenderPassCacheKey# *key = data;
116
117 return (key->from_layoutcxx . . $ _RenderPassCacheKey#from_layout. << 26) ^
118 (key->to_layoutcxx . . $ _RenderPassCacheKey#to_layout. << 18) ^
119 (key->vk_load_opcxx . . $ _RenderPassCacheKey#vk_load_op. << 16) ^
120 (key->formatcxx . . $ _RenderPassCacheKey#format.);
121 }
122
123 static gbooleancxx . . $ gboolean#
124 render_pass_cache_key_equalcxx . . $ render_pass_cache_key_equal(9148c8c3ff42c9d8). (gconstpointercxx . . $ gconstpointer# a,
125 gconstpointercxx . . $ gconstpointer# b)
126 {
127 const RenderPassCacheKeycxx . . $ RenderPassCacheKey# *keya = a;
128 const RenderPassCacheKeycxx . . $ RenderPassCacheKey# *keyb = b;
129
130 return keya->from_layoutcxx . . $ _RenderPassCacheKey#from_layout. == keyb->from_layoutcxx . . $ _RenderPassCacheKey#from_layout. &&
131 keya->to_layoutcxx . . $ _RenderPassCacheKey#to_layout. == keyb->to_layoutcxx . . $ _RenderPassCacheKey#to_layout. &&
132 keya->vk_load_opcxx . . $ _RenderPassCacheKey#vk_load_op. == keyb->vk_load_opcxx . . $ _RenderPassCacheKey#vk_load_op. &&
133 keya->formatcxx . . $ _RenderPassCacheKey#format. == keyb->formatcxx . . $ _RenderPassCacheKey#format.;
134 }
135
136 static VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout#
137 gsk_vulkan_device_create_vk_image_set_layoutcxx . . $ gsk_vulkan_device_create_vk_image_set_layout(f25e28857a1e2aa8). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
138 {
139 VkDevicecxx . . $ VkDevice# vk_device;
140 VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout# result;
141
142 vk_device = gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self);
143
144 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateDescriptorSetLayout, vk_device,
145 &(VkDescriptorSetLayoutCreateInfo) {
146 .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO,
147 .bindingCount = 1,
148 .flags = 0,
149 .pBindings = (VkDescriptorSetLayoutBinding[1]) {
150 {
151 .binding = 0,
152 .descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
153 .descriptorCount = 3,
154 .stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT,
155 }
156 },
157 },
158 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
159 &result);
160
161 return result;
162 }
163
164 VkPipelineLayoutcxx . . $ VkPipelineLayout#
165 gsk_vulkan_device_create_vk_pipeline_layoutcxx . . $ gsk_vulkan_device_create_vk_pipeline_layout(ea73c18f42b0223e). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
166 VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout# image1_layout,
167 VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout# image2_layout)
168 {
169 VkDevicecxx . . $ VkDevice# vk_device;
170 VkPipelineLayoutcxx . . $ VkPipelineLayout# result;
171
172 vk_device = gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self);
173
174 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreatePipelineLayout, vk_device,
175 &(VkPipelineLayoutCreateInfo) {
176 .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
177 .setLayoutCount = 2,
178 .pSetLayouts = (VkDescriptorSetLayout[2]) {
179 image1_layout,
180 image2_layout,
181 },
182 .pushConstantRangeCount = 1,
183 .pPushConstantRanges = (VkPushConstantRange[1]) {
184 {
185 .stageFlags = VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT,
186 .offset = 0,
187 .size = sizeof (GskGpuGlobalsInstance)
188 }
189 }
190 },
191 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
192 &result);
193
194 return result;
195 }
196
197 static GskGpuImagecxx . . $ GskGpuImage# *
198 gsk_vulkan_device_create_offscreen_imagecxx . . $ gsk_vulkan_device_create_offscreen_image(6b528020e6467c41). (GskGpuDevicecxx . . $ GskGpuDevice# *device,
199 gbooleancxx . . $ gboolean# with_mipmap,
200 GdkMemoryFormatcxx . . $ GdkMemoryFormat# format,
201 gbooleancxx . . $ gboolean# is_srgb,
202 gsizecxx . . $ gsize# width,
203 gsizecxx . . $ gsize# height)
204 {
205 GskVulkanDevicecxx . . $ GskVulkanDevice# *self = GSK_VULKAN_DEVICEcxx . . $ GSK_VULKAN_DEVICE(2a7a45f679d87ef0). (device);
206
207 return gsk_vulkan_image_new_for_offscreencxx . . $ gsk_vulkan_image_new_for_offscreen(91dd39fc8120a300). (self,
208 with_mipmap,
209 format,
210 is_srgb,
211 width,
212 height);
213 }
214
215 static GskGpuImagecxx . . $ GskGpuImage# *
216 gsk_vulkan_device_create_atlas_imagecxx . . $ gsk_vulkan_device_create_atlas_image(1caf50e10af4e5b7). (GskGpuDevicecxx . . $ GskGpuDevice# *device,
217 gsizecxx . . $ gsize# width,
218 gsizecxx . . $ gsize# height)
219 {
220 GskVulkanDevicecxx . . $ GskVulkanDevice# *self = GSK_VULKAN_DEVICEcxx . . $ GSK_VULKAN_DEVICE(2a7a45f679d87ef0). (device);
221
222 return gsk_vulkan_image_new_for_atlascxx . . $ gsk_vulkan_image_new_for_atlas(3b8dc5acfad566a1). (self,
223 width,
224 height);
225 }
226
227 static GskGpuImagecxx . . $ GskGpuImage# *
228 gsk_vulkan_device_create_upload_imagecxx . . $ gsk_vulkan_device_create_upload_image(a07706f50eb86484). (GskGpuDevicecxx . . $ GskGpuDevice# *device,
229 gbooleancxx . . $ gboolean# with_mipmap,
230 GdkMemoryFormatcxx . . $ GdkMemoryFormat# format,
231 GskGpuConversioncxx . . $ GskGpuConversion# conv,
232 gsizecxx . . $ gsize# width,
233 gsizecxx . . $ gsize# height)
234 {
235 GskVulkanDevicecxx . . $ GskVulkanDevice# *self = GSK_VULKAN_DEVICEcxx . . $ GSK_VULKAN_DEVICE(2a7a45f679d87ef0). (device);
236
237 return gsk_vulkan_image_new_for_uploadcxx . . $ gsk_vulkan_image_new_for_upload(78efe1fc65058df7). (self,
238 with_mipmap,
239 format,
240 conv,
241 width,
242 height);
243 }
244
245 static GskGpuImagecxx . . $ GskGpuImage# *
246 gsk_vulkan_device_create_download_imagecxx . . $ gsk_vulkan_device_create_download_image(4476b7a14593eca). (GskGpuDevicecxx . . $ GskGpuDevice# *device,
247 GdkMemoryDepthcxx . . $ GdkMemoryDepth# depth,
248 gsizecxx . . $ gsize# width,
249 gsizecxx . . $ gsize# height)
250 {
251 GskVulkanDevicecxx . . $ GskVulkanDevice# *self = GSK_VULKAN_DEVICEcxx . . $ GSK_VULKAN_DEVICE(2a7a45f679d87ef0). (device);
252 GskGpuImagecxx . . $ GskGpuImage# *image;
253
254 #ifdef HAVE_DMABUFcxx . . $ `build/config.h:34:9`!
255 image = gsk_vulkan_image_new_dmabufcxx . . $ gsk_vulkan_image_new_dmabuf(c661ead3e2143954). (self,
256 gdk_memory_depth_get_formatcxx . . $ gdk_memory_depth_get_format(26117449a7af4f22). (depth),
257 gdk_memory_depth_is_srgbcxx . . $ gdk_memory_depth_is_srgb(7a45cfb6ee7d51af). (depth),
258 width,
259 height);
260 if (image != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
261 return image;
262 #endif
263
264 image = gsk_vulkan_image_new_for_offscreencxx . . $ gsk_vulkan_image_new_for_offscreen(91dd39fc8120a300). (self,
265 FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!,
266 gdk_memory_depth_get_formatcxx . . $ gdk_memory_depth_get_format(26117449a7af4f22). (depth),
267 gdk_memory_depth_is_srgbcxx . . $ gdk_memory_depth_is_srgb(7a45cfb6ee7d51af). (depth),
268 width,
269 height);
270
271 return image;
272 }
273
274 static void
275 gsk_vulkan_device_make_currentcxx . . $ gsk_vulkan_device_make_current(4d47fb05a7f505ef). (GskGpuDevicecxx . . $ GskGpuDevice# *device)
276 {
277 }
278
279 static void
280 gsk_vulkan_device_finalizecxx . . $ gsk_vulkan_device_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object)
281 {
282 GskVulkanDevicecxx . . $ GskVulkanDevice# *self = GSK_VULKAN_DEVICEcxx . . $ GSK_VULKAN_DEVICE(2a7a45f679d87ef0). (object);
283 GskGpuDevicecxx . . $ GskGpuDevice# *device = GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self);
284 VkDevicecxx . . $ VkDevice# vk_device;
285 GdkDisplaycxx . . $ GdkDisplay# *display;
286 GHashTableItercxx . . $ GHashTableIter# iter;
287 gpointercxx . . $ gpointer# key, value;
288 gsizecxx . . $ gsize# i;
289
290 display = gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (device);
291 vk_device = gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self);
292
293 g_object_steal_datacxx . . $ g_object_steal_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (display), "-gsk-vulkan-device");
294
295 g_hash_table_iter_initcxx . . $ g_hash_table_iter_init(1fd6bbae530c3b4). (&iter, self->pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache.);
296 while (g_hash_table_iter_nextcxx . . $ g_hash_table_iter_next(1740d3f8cffea03c). (&iter, &key, &value))
297 {
298 vkDestroyPipelinecxx . . $ vkDestroyPipeline(28a730df6cfa1a0d). (vk_device,
299 ((PipelineCacheKeycxx . . $ PipelineCacheKey# *)key)->vk_pipelinecxx . . $ _PipelineCacheKey#vk_pipeline.,
300 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
301 g_freecxx . . $ g_free(5d22bdacc48458e8). (key);
302 }
303 g_hash_table_unrefcxx . . $ g_hash_table_unref(ce4eddf544b9218). (self->pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache.);
304
305 g_hash_table_iter_initcxx . . $ g_hash_table_iter_init(1fd6bbae530c3b4). (&iter, self->render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache.);
306 while (g_hash_table_iter_nextcxx . . $ g_hash_table_iter_next(1740d3f8cffea03c). (&iter, &key, &value))
307 {
308 vkDestroyRenderPasscxx . . $ vkDestroyRenderPass(380f68f8f87a1b1a). (vk_device,
309 ((RenderPassCacheKeycxx . . $ RenderPassCacheKey# *)key)->render_passcxx . . $ _RenderPassCacheKey#render_pass.,
310 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
311 g_freecxx . . $ g_free(5d22bdacc48458e8). (key);
312 }
313 g_hash_table_unrefcxx . . $ g_hash_table_unref(ce4eddf544b9218). (self->render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache.);
314
315 for (i = 0; i < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (self->vk_samplers); i++)
316 {
317 if (self->vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[i] != VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!)
318 vkDestroySamplercxx . . $ vkDestroySampler(322864eae4efc7af). (vk_device,
319 self->vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[i],
320 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
321 }
322
323 vkDestroyPipelineLayoutcxx . . $ vkDestroyPipelineLayout(34ff8110c59f6f0f). (vk_device,
324 self->default_vk_pipeline_layoutcxx . . $ _GskVulkanDevice#default_vk_pipeline_layout.,
325 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
326 vkDestroyDescriptorSetLayoutcxx . . $ vkDestroyDescriptorSetLayout(695332bc5934d6e5). (vk_device,
327 self->vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout.,
328 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
329 for (i = 0; i < descriptor_pools_get_sizecxx . . $ descriptor_pools_get_size(ced1aef655f3c968). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.); i++)
330 vkDestroyDescriptorPoolcxx . . $ vkDestroyDescriptorPool(1129543df718fcab). (vk_device,
331 descriptor_pools_getcxx . . $ descriptor_pools_get(cfda41231558795c). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools., i),
332 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
333 descriptor_pools_clearcxx . . $ descriptor_pools_clear(9095b24b02b8ba8d). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.);
334 vkDestroyCommandPoolcxx . . $ vkDestroyCommandPool(79ff94ba057d964b). (vk_device,
335 self->vk_command_poolcxx . . $ _GskVulkanDevice#vk_command_pool.,
336 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
337
338 for (i = 0; i < VK_MAX_MEMORY_TYPEScxx . . $ `<external>/13734482859137699468/vulkan_core.h:131:9`!; i++)
339 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->allocators[i], gsk_vulkan_allocator_unref);
340 g_clear_pointercxx . . $ `<external>/1123956534522462559/gmem.h:135:9`! (&self->external_allocator, gsk_vulkan_allocator_unref);
341
342 G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gsk_vulkan_device_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object);
343 }
344
345 static void
346 gsk_vulkan_device_class_initcxx . . $ gsk_vulkan_device_class_init(a81f159f4511ca04). (GskVulkanDeviceClasscxx . . $ GskVulkanDeviceClass# *klass)
347 {
348 GskGpuDeviceClasscxx . . $ GskGpuDeviceClass# *gpu_device_class = GSK_GPU_DEVICE_CLASScxx . . $ `gsk/gpu/gskgpudeviceprivate.h:11:9`! (klass);
349 GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass);
350
351 gpu_device_class->create_offscreen_imagecxx . . $ _GskGpuDeviceClass#create_offscreen_image. = gsk_vulkan_device_create_offscreen_imagecxx . . $ gsk_vulkan_device_create_offscreen_image(6b528020e6467c41).;
352 gpu_device_class->create_atlas_imagecxx . . $ _GskGpuDeviceClass#create_atlas_image. = gsk_vulkan_device_create_atlas_imagecxx . . $ gsk_vulkan_device_create_atlas_image(1caf50e10af4e5b7).;
353 gpu_device_class->create_upload_imagecxx . . $ _GskGpuDeviceClass#create_upload_image. = gsk_vulkan_device_create_upload_imagecxx . . $ gsk_vulkan_device_create_upload_image(a07706f50eb86484).;
354 gpu_device_class->create_download_imagecxx . . $ _GskGpuDeviceClass#create_download_image. = gsk_vulkan_device_create_download_imagecxx . . $ gsk_vulkan_device_create_download_image(4476b7a14593eca).;
355 gpu_device_class->make_currentcxx . . $ _GskGpuDeviceClass#make_current. = gsk_vulkan_device_make_currentcxx . . $ gsk_vulkan_device_make_current(4d47fb05a7f505ef).;
356
357 object_class->finalizecxx . . $ _GObjectClass#finalize. = gsk_vulkan_device_finalizecxx . . $ gsk_vulkan_device_finalize(6087475fa43034d3).;
358 }
359
360 static void
361 gsk_vulkan_device_initcxx . . $ gsk_vulkan_device_init(649acaf45c80f81). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
362 {
363 self->render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache. = g_hash_table_newcxx . . $ g_hash_table_new(444186de27d60923). (render_pass_cache_key_hashcxx . . $ render_pass_cache_key_hash(b11f534102b1ad6)., render_pass_cache_key_equalcxx . . $ render_pass_cache_key_equal(9148c8c3ff42c9d8).);
364 self->pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache. = g_hash_table_newcxx . . $ g_hash_table_new(444186de27d60923). (pipeline_cache_key_hashcxx . . $ pipeline_cache_key_hash(b11f534102b1ad6)., pipeline_cache_key_equalcxx . . $ pipeline_cache_key_equal(9148c8c3ff42c9d8).);
365
366 descriptor_pools_initcxx . . $ descriptor_pools_init(9095b24b02b8ba8d). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.);
367 }
368
369 static void
370 gsk_vulkan_device_create_vk_objectscxx . . $ gsk_vulkan_device_create_vk_objects(649acaf45c80f81). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
371 {
372 VkDevicecxx . . $ VkDevice# vk_device;
373
374 vk_device = gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self);
375
376 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateCommandPool, vk_device,
377 &(const VkCommandPoolCreateInfo) {
378 .sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
379 .queueFamilyIndex = gsk_vulkan_device_get_vk_queue_family_index (self),
380 .flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
381 },
382 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
383 &self->vk_command_pool);
384
385 self->vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout. = gsk_vulkan_device_create_vk_image_set_layoutcxx . . $ gsk_vulkan_device_create_vk_image_set_layout(f25e28857a1e2aa8). (self);
386
387 self->default_vk_pipeline_layoutcxx . . $ _GskVulkanDevice#default_vk_pipeline_layout. = gsk_vulkan_device_create_vk_pipeline_layoutcxx . . $ gsk_vulkan_device_create_vk_pipeline_layout(ea73c18f42b0223e). (self,
388 self->vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout.,
389 self->vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout.);
390 }
391
392 static void
393 gsk_vulkan_device_setupcxx . . $ gsk_vulkan_device_setup(c7f111911a469113). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
394 GdkDisplaycxx . . $ GdkDisplay# *display)
395 {
396 VkPhysicalDeviceProperties2cxx . . $ VkPhysicalDeviceProperties2# vk_props = {
397 .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2cxx . . $ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2.,
398 .pNext = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!
399 };
400
401 vkGetPhysicalDeviceProperties2cxx . . $ vkGetPhysicalDeviceProperties2(b4a000a0bcbdc0bd). (display->vk_physical_devicecxx . . $ _GdkDisplay#vk_physical_device., &vk_props);
402 gsk_gpu_device_setupcxx . . $ gsk_gpu_device_setup(fb49d4d89258f8ed). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self),
403 display,
404 vk_props.propertiescxx . . $ VkPhysicalDeviceProperties2#properties..limitscxx . . $ VkPhysicalDeviceProperties#limits..maxImageDimension2Dcxx . . $ VkPhysicalDeviceLimits#maxImageDimension2D.,
405 GSK_GPU_DEVICE_DEFAULT_TILE_SIZEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:7:9`!,
406 vk_props.propertiescxx . . $ VkPhysicalDeviceProperties2#properties..limitscxx . . $ VkPhysicalDeviceProperties#limits..minUniformBufferOffsetAlignmentcxx . . $ VkPhysicalDeviceLimits#minUniformBufferOffsetAlignment.);
407 }
408
409 GskGpuDevicecxx . . $ GskGpuDevice# *
410 gsk_vulkan_device_get_for_displaycxx . . $ gsk_vulkan_device_get_for_display(88962f50eb9d3072). (GdkDisplaycxx . . $ GdkDisplay# *display,
411 GErrorcxx . . $ GError# **error)
412 {
413 GskVulkanDevicecxx . . $ GskVulkanDevice# *self;
414
415 self = g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (display), "-gsk-vulkan-device");
416 if (self)
417 return GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self));
418
419 if (!gdk_display_prepare_vulkancxx . . $ gdk_display_prepare_vulkan(74e87afd5527a56f). (display, error))
420 return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;
421
422 self = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GSK_TYPE_VULKAN_DEVICEcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:18:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
423 self->featurescxx . . $ _GskVulkanDevice#features. = display->vulkan_featurescxx . . $ _GdkDisplay#vulkan_features.;
424
425 gsk_vulkan_device_setupcxx . . $ gsk_vulkan_device_setup(c7f111911a469113). (self, display);
426
427 gsk_vulkan_device_create_vk_objectscxx . . $ gsk_vulkan_device_create_vk_objects(649acaf45c80f81). (self);
428
429 g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (display), "-gsk-vulkan-device", self);
430
431 return GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self);
432 }
433
434 gbooleancxx . . $ gboolean#
435 gsk_vulkan_device_has_featurecxx . . $ gsk_vulkan_device_has_feature(b413dc2ca189b5dd). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
436 GdkVulkanFeaturescxx . . $ GdkVulkanFeatures# feature)
437 {
438 return (self->featurescxx . . $ _GskVulkanDevice#features. & feature) == feature;
439 }
440
441 VkDevicecxx . . $ VkDevice#
442 gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
443 {
444 return gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self))->vk_devicecxx . . $ _GdkDisplay#vk_device.;
445 }
446
447 VkPhysicalDevicecxx . . $ VkPhysicalDevice#
448 gsk_vulkan_device_get_vk_physical_devicecxx . . $ gsk_vulkan_device_get_vk_physical_device(fbb7f33f5baaff7). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
449 {
450 return gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self))->vk_physical_devicecxx . . $ _GdkDisplay#vk_physical_device.;
451 }
452
453 VkQueuecxx . . $ VkQueue#
454 gsk_vulkan_device_get_vk_queuecxx . . $ gsk_vulkan_device_get_vk_queue(2af141266131ae05). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
455 {
456 return gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self))->vk_queuecxx . . $ _GdkDisplay#vk_queue.;
457 }
458
459 uint32_tcxx . . $ uint32_t#
460 gsk_vulkan_device_get_vk_queue_family_indexcxx . . $ gsk_vulkan_device_get_vk_queue_family_index(79c754cf35296986). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
461 {
462 return gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self))->vk_queue_family_indexcxx . . $ _GdkDisplay#vk_queue_family_index.;
463 }
464
465 VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout#
466 gsk_vulkan_device_get_vk_image_set_layoutcxx . . $ gsk_vulkan_device_get_vk_image_set_layout(f25e28857a1e2aa8). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
467 {
468 return self->vk_image_set_layoutcxx . . $ _GskVulkanDevice#vk_image_set_layout.;
469 }
470
471 VkPipelineLayoutcxx . . $ VkPipelineLayout#
472 gsk_vulkan_device_get_default_vk_pipeline_layoutcxx . . $ gsk_vulkan_device_get_default_vk_pipeline_layout(ee9c007738b70f84). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
473 {
474 return self->default_vk_pipeline_layoutcxx . . $ _GskVulkanDevice#default_vk_pipeline_layout.;
475 }
476
477 VkPipelineLayoutcxx . . $ VkPipelineLayout#
478 gsk_vulkan_device_get_vk_pipeline_layoutcxx . . $ gsk_vulkan_device_get_vk_pipeline_layout(4c2656539ec51c9). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
479 GskVulkanYcbcrcxx . . $ GskVulkanYcbcr# *ycbcr0,
480 GskVulkanYcbcrcxx . . $ GskVulkanYcbcr# *ycbcr1)
481 {
482 if (ycbcr0 == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!)
483 {
484 if (ycbcr1 == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!)
485 return self->default_vk_pipeline_layoutcxx . . $ _GskVulkanDevice#default_vk_pipeline_layout.;
486 else
487 return gsk_vulkan_ycbcr_get_vk_pipeline_layoutcxx . . $ gsk_vulkan_ycbcr_get_vk_pipeline_layout(b9c4c672f8d2e6c2). (ycbcr1, 1);
488 }
489 else
490 {
491 if (ycbcr1 == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!)
492 return gsk_vulkan_ycbcr_get_vk_pipeline_layoutcxx . . $ gsk_vulkan_ycbcr_get_vk_pipeline_layout(b9c4c672f8d2e6c2). (ycbcr0, 0);
493 else
494 {
495 /* FIXME: someone write a test plz */
496 g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! ();
497 }
498 }
499 }
500
501 VkCommandPoolcxx . . $ VkCommandPool#
502 gsk_vulkan_device_get_vk_command_poolcxx . . $ gsk_vulkan_device_get_vk_command_pool(137eee5e5b643ae6). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
503 {
504 return self->vk_command_poolcxx . . $ _GskVulkanDevice#vk_command_pool.;
505 }
506
507 VkDescriptorSetcxx . . $ VkDescriptorSet#
508 gsk_vulkan_device_allocate_descriptorcxx . . $ gsk_vulkan_device_allocate_descriptor(b27ba07c11bd7878). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
509 const VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout# layout,
510 gsizecxx . . $ gsize# *out_pool_id)
511 {
512 VkDescriptorSetcxx . . $ VkDescriptorSet# result;
513 VkDevicecxx . . $ VkDevice# vk_device;
514 VkDescriptorPoolcxx . . $ VkDescriptorPool# new_pool;
515 gsizecxx . . $ gsize# i, n;
516
517 vk_device = gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self);
518 n = descriptor_pools_get_sizecxx . . $ descriptor_pools_get_size(ced1aef655f3c968). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.);
519
520 for (i = 0; i < n; i++)
521 {
522 gsizecxx . . $ gsize# pool_id = (i + self->last_poolcxx . . $ _GskVulkanDevice#last_pool.) % n;
523 VkResultcxx . . $ VkResult# res = vkAllocateDescriptorSetscxx . . $ vkAllocateDescriptorSets(324e8096174c3fcb). (vk_device,
524 &(VkDescriptorSetAllocateInfocxx . . $ VkDescriptorSetAllocateInfo#) {
525 .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFOcxx . . $ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO.,
526 .descriptorPool = descriptor_pools_getcxx . . $ descriptor_pools_get(cfda41231558795c). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools., pool_id),
527 .descriptorSetCount = 1,
528 .pSetLayouts = (VkDescriptorSetLayoutcxx . . $ VkDescriptorSetLayout#[1]) {
529 layout,
530 },
531 },
532 &result);
533 if (res == VK_SUCCESScxx . . $ VK_SUCCESS.)
534 {
535 self->last_poolcxx . . $ _GskVulkanDevice#last_pool. = pool_id;
536 *out_pool_id = self->last_poolcxx . . $ _GskVulkanDevice#last_pool.;
537 return result;
538 }
539 else if (res == VK_ERROR_OUT_OF_POOL_MEMORYcxx . . $ VK_ERROR_OUT_OF_POOL_MEMORY. ||
540 res == VK_ERROR_FRAGMENTED_POOLcxx . . $ VK_ERROR_FRAGMENTED_POOL.)
541 {
542 continue;
543 }
544 else
545 {
546 gsk_vulkan_handle_resultcxx . . $ gsk_vulkan_handle_result(7846cacdad6d2912). (res, "vkAllocateDescriptorSets");
547 }
548 }
549
550 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateDescriptorPool, vk_device,
551 &(VkDescriptorPoolCreateInfo) {
552 .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO,
553 .flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT,
554 .maxSets = 100,
555 .poolSizeCount = 1,
556 .pPoolSizes = (VkDescriptorPoolSize[1]) {
557 {
558 .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
559 .descriptorCount = 100,
560 },
561 }
562 },
563 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
564 &new_pool);
565 descriptor_pools_appendcxx . . $ descriptor_pools_append(1aa03d120967cd4). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools., new_pool);
566 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkAllocateDescriptorSets, vk_device,
567 &(VkDescriptorSetAllocateInfo) {
568 .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO,
569 .descriptorPool = new_pool,
570 .descriptorSetCount = 1,
571 .pSetLayouts = (VkDescriptorSetLayout[1]) {
572 layout,
573 },
574 },
575 &result);
576
577 self->last_poolcxx . . $ _GskVulkanDevice#last_pool. = descriptor_pools_get_sizecxx . . $ descriptor_pools_get_size(ced1aef655f3c968). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools.) - 1;
578 *out_pool_id = self->last_poolcxx . . $ _GskVulkanDevice#last_pool.;
579
580 return result;
581 }
582
583 void
584 gsk_vulkan_device_free_descriptorcxx . . $ gsk_vulkan_device_free_descriptor(7936c67c77d03ec9). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
585 gsizecxx . . $ gsize# pool_id,
586 VkDescriptorSetcxx . . $ VkDescriptorSet# set)
587 {
588 vkFreeDescriptorSetscxx . . $ vkFreeDescriptorSets(dcea2dffa417521). (gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self),
589 descriptor_pools_getcxx . . $ descriptor_pools_get(cfda41231558795c). (&self->descriptor_poolscxx . . $ _GskVulkanDevice#descriptor_pools., pool_id),
590 1,
591 &set);
592 }
593
594 static VkSamplercxx . . $ VkSampler#
595 gsk_vulkan_device_create_samplercxx . . $ gsk_vulkan_device_create_sampler(81e7640333fa63e1). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
596 VkSamplerYcbcrConversioncxx . . $ VkSamplerYcbcrConversion# vk_conversion,
597 VkFiltercxx . . $ VkFilter# vk_filter,
598 VkSamplerAddressModecxx . . $ VkSamplerAddressMode# vk_address_mode,
599 VkSamplerMipmapModecxx . . $ VkSamplerMipmapMode# vk_mipmap_mode,
600 float max_lod)
601 {
602 VkSamplercxx . . $ VkSampler# result;
603
604 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateSampler, gsk_vulkan_device_get_vk_device (self),
605 &(VkSamplerCreateInfo) {
606 .sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
607 .magFilter = vk_filter,
608 .minFilter = vk_filter,
609 .mipmapMode = vk_mipmap_mode,
610 .addressModeU = vk_address_mode,
611 .addressModeV = vk_address_mode,
612 .addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE,
613 .borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK,
614 .unnormalizedCoordinates = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!,
615 .maxAnisotropy = 1.0,
616 .minLod = 0.0,
617 .maxLod = max_lod,
618 .pNext = vk_conversion == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`! ? NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! : &(VkSamplerYcbcrConversionInfo) {
619 .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO,
620 .conversion = vk_conversion
621 }
622 },
623 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
624 &result);
625
626 return result;
627 }
628
629 VkSamplercxx . . $ VkSampler#
630 gsk_vulkan_device_get_vk_samplercxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
631 GskGpuSamplercxx . . $ GskGpuSampler# sampler)
632 {
633 const structcxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0# {
634 VkFiltercxx . . $ VkFilter# filtercxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#filter.;
635 VkSamplerAddressModecxx . . $ VkSamplerAddressMode# address_modecxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#address_mode.;
636 VkSamplerMipmapModecxx . . $ VkSamplerMipmapMode# mipmap_modecxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#mipmap_mode.;
637 float max_lodcxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#max_lod.;
638 } filter_attrs[GSK_GPU_SAMPLER_N_SAMPLERScxx . . $ GSK_GPU_SAMPLER_N_SAMPLERS.] = {
639 [GSK_GPU_SAMPLER_DEFAULTcxx . . $ GSK_GPU_SAMPLER_DEFAULT.] = {
640 .filter = VK_FILTER_LINEARcxx . . $ VK_FILTER_LINEAR.,
641 .address_mode = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEcxx . . $ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.,
642 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEARESTcxx . . $ VK_SAMPLER_MIPMAP_MODE_NEAREST.,
643 .max_lod = 0.0f,
644 },
645 [GSK_GPU_SAMPLER_TRANSPARENTcxx . . $ GSK_GPU_SAMPLER_TRANSPARENT.] = {
646 .filter = VK_FILTER_LINEARcxx . . $ VK_FILTER_LINEAR.,
647 .address_mode = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDERcxx . . $ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER.,
648 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEARESTcxx . . $ VK_SAMPLER_MIPMAP_MODE_NEAREST.,
649 .max_lod = 0.0f,
650 },
651 [GSK_GPU_SAMPLER_REPEATcxx . . $ GSK_GPU_SAMPLER_REPEAT.] = {
652 .filter = VK_FILTER_LINEARcxx . . $ VK_FILTER_LINEAR.,
653 .address_mode = VK_SAMPLER_ADDRESS_MODE_REPEATcxx . . $ VK_SAMPLER_ADDRESS_MODE_REPEAT.,
654 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEARESTcxx . . $ VK_SAMPLER_MIPMAP_MODE_NEAREST.,
655 .max_lod = 0.0f,
656 },
657 [GSK_GPU_SAMPLER_REFLECTcxx . . $ GSK_GPU_SAMPLER_REFLECT.] = {
658 .filter = VK_FILTER_LINEARcxx . . $ VK_FILTER_LINEAR.,
659 .address_mode = VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEATcxx . . $ VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT.,
660 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEARESTcxx . . $ VK_SAMPLER_MIPMAP_MODE_NEAREST.,
661 .max_lod = 0.0f,
662 },
663 [GSK_GPU_SAMPLER_NEARESTcxx . . $ GSK_GPU_SAMPLER_NEAREST.] = {
664 .filter = VK_FILTER_NEARESTcxx . . $ VK_FILTER_NEAREST.,
665 .address_mode = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEcxx . . $ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.,
666 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEARESTcxx . . $ VK_SAMPLER_MIPMAP_MODE_NEAREST.,
667 .max_lod = 0.0f,
668 },
669 [GSK_GPU_SAMPLER_MIPMAP_DEFAULTcxx . . $ GSK_GPU_SAMPLER_MIPMAP_DEFAULT.] = {
670 .filter = VK_FILTER_LINEARcxx . . $ VK_FILTER_LINEAR.,
671 .address_mode = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGEcxx . . $ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.,
672 .mipmap_mode = VK_SAMPLER_MIPMAP_MODE_LINEARcxx . . $ VK_SAMPLER_MIPMAP_MODE_LINEAR.,
673 .max_lod = VK_LOD_CLAMP_NONEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:125:9`!,
674 },
675 };
676
677 if (self->vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[sampler] == VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!)
678 {
679 self->vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[sampler] = gsk_vulkan_device_create_samplercxx . . $ gsk_vulkan_device_create_sampler(81e7640333fa63e1). (self,
680 VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!,
681 filter_attrs[sampler].filtercxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#filter.,
682 filter_attrs[sampler].address_modecxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#address_mode.,
683 filter_attrs[sampler].mipmap_modecxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#mipmap_mode.,
684 filter_attrs[sampler].max_lodcxx . . $ gsk_vulkan_device_get_vk_sampler(e17a4034ee184b0d).$anonymous_type_0#max_lod.);
685 }
686
687 return self->vk_samplerscxx . . $ _GskVulkanDevice#vk_samplers.[sampler];
688 }
689
690 VkRenderPasscxx . . $ VkRenderPass#
691 gsk_vulkan_device_get_vk_render_passcxx . . $ gsk_vulkan_device_get_vk_render_pass(bbd08281418aca70). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
692 VkFormatcxx . . $ VkFormat# format,
693 VkAttachmentLoadOpcxx . . $ VkAttachmentLoadOp# vk_load_op,
694 VkImageLayoutcxx . . $ VkImageLayout# from_layout,
695 VkImageLayoutcxx . . $ VkImageLayout# to_layout)
696 {
697 RenderPassCacheKeycxx . . $ RenderPassCacheKey# cache_key;
698 RenderPassCacheKeycxx . . $ RenderPassCacheKey# *cached_result;
699 VkRenderPasscxx . . $ VkRenderPass# render_pass;
700 GdkDisplaycxx . . $ GdkDisplay# *display;
701
702 cache_key = (RenderPassCacheKeycxx . . $ RenderPassCacheKey#) {
703 .format = format,
704 .vk_load_op = vk_load_op,
705 .from_layout = from_layout,
706 .to_layout = to_layout,
707 };
708 cached_result = g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (self->render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache., &cache_key);
709 if (cached_result)
710 return cached_result->render_passcxx . . $ _RenderPassCacheKey#render_pass.;
711
712 display = gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self));
713
714 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateRenderPass, display->vk_device,
715 &(VkRenderPassCreateInfo) {
716 .sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
717 .attachmentCount = 1,
718 .pAttachments = (VkAttachmentDescription[]) {
719 {
720 .format = format,
721 .samples = VK_SAMPLE_COUNT_1_BIT,
722 .loadOp = vk_load_op,
723 .storeOp = VK_ATTACHMENT_STORE_OP_STORE,
724 .initialLayout = from_layout,
725 .finalLayout = to_layout
726 }
727 },
728 .subpassCount = 1,
729 .pSubpasses = (VkSubpassDescription []) {
730 {
731 .pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS,
732 .inputAttachmentCount = 0,
733 .colorAttachmentCount = 1,
734 .pColorAttachments = (VkAttachmentReference []) {
735 {
736 .attachment = 0,
737 .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
738 }
739 },
740 .pResolveAttachments = (VkAttachmentReference []) {
741 {
742 .attachment = VK_ATTACHMENT_UNUSEDcxx . . $ `<external>/13734482859137699468/vulkan_core.h:137:9`!,
743 .layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
744 }
745 },
746 .pDepthStencilAttachment = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
747 }
748 },
749 .dependencyCount = 0,
750 },
751 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
752 &render_pass);
753
754 cached_result = g_memdup2cxx . . $ g_memdup2(7ca5e6a2fd1baf31). (&cache_key, sizeof (RenderPassCacheKeycxx . . $ RenderPassCacheKey#));
755 cached_result->render_passcxx . . $ _RenderPassCacheKey#render_pass. = render_pass;
756
757 g_hash_table_insertcxx . . $ g_hash_table_insert(6a7c46015dd5ef26). (self->render_pass_cachecxx . . $ _GskVulkanDevice#render_pass_cache., cached_result, cached_result);
758
759 return render_pass;
760 }
761
762 typedef struct _GskVulkanShaderSpecializationcxx . . $ _GskVulkanShaderSpecialization# GskVulkanShaderSpecializationcxx . . $ GskVulkanShaderSpecialization#;
763 struct _GskVulkanShaderSpecializationcxx . . $ _GskVulkanShaderSpecialization#
764 {
765 guint32cxx . . $ guint32# flagscxx . . $ _GskVulkanShaderSpecialization#flags.;
766 guint32cxx . . $ guint32# color_statescxx . . $ _GskVulkanShaderSpecialization#color_states.;
767 guint32cxx . . $ guint32# variationcxx . . $ _GskVulkanShaderSpecialization#variation.;
768 };
769
770 static VkPipelineColorBlendAttachmentStatecxx . . $ VkPipelineColorBlendAttachmentState# blend_attachment_statescxx . . $ blend_attachment_states.[] = {
771 [GSK_GPU_BLEND_NONEcxx . . $ GSK_GPU_BLEND_NONE.] = {
772 .blendEnable = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!,
773 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
774 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
775 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
776 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
777 },
778 [GSK_GPU_BLEND_OVERcxx . . $ GSK_GPU_BLEND_OVER.] = {
779 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
780 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
781 .srcColorBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
782 .dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA.,
783 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
784 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
785 .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA.,
786 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
787 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
788 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
789 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
790 },
791 [GSK_GPU_BLEND_ADDcxx . . $ GSK_GPU_BLEND_ADD.] = {
792 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
793 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
794 .srcColorBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
795 .dstColorBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
796 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
797 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
798 .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
799 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
800 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
801 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
802 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
803 },
804 [GSK_GPU_BLEND_CLEARcxx . . $ GSK_GPU_BLEND_CLEAR.] = {
805 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
806 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
807 .srcColorBlendFactor = VK_BLEND_FACTOR_ZEROcxx . . $ VK_BLEND_FACTOR_ZERO.,
808 .dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA.,
809 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
810 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ZEROcxx . . $ VK_BLEND_FACTOR_ZERO.,
811 .dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA.,
812 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
813 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
814 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
815 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
816 },
817 [GSK_GPU_BLEND_MASK_ONEcxx . . $ GSK_GPU_BLEND_MASK_ONE.] = {
818 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
819 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
820 .srcColorBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
821 .dstColorBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
822 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
823 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONEcxx . . $ VK_BLEND_FACTOR_ONE.,
824 .dstAlphaBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
825 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
826 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
827 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
828 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
829 },
830 [GSK_GPU_BLEND_MASK_ALPHAcxx . . $ GSK_GPU_BLEND_MASK_ALPHA.] = {
831 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
832 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
833 .srcColorBlendFactor = VK_BLEND_FACTOR_DST_ALPHAcxx . . $ VK_BLEND_FACTOR_DST_ALPHA.,
834 .dstColorBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
835 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
836 .srcAlphaBlendFactor = VK_BLEND_FACTOR_DST_ALPHAcxx . . $ VK_BLEND_FACTOR_DST_ALPHA.,
837 .dstAlphaBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
838 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
839 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
840 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
841 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
842 },
843 [GSK_GPU_BLEND_MASK_INV_ALPHAcxx . . $ GSK_GPU_BLEND_MASK_INV_ALPHA.] = {
844 .blendEnable = VK_TRUEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:129:9`!,
845 .colorBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
846 .srcColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA.,
847 .dstColorBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
848 .alphaBlendOp = VK_BLEND_OP_ADDcxx . . $ VK_BLEND_OP_ADD.,
849 .srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHAcxx . . $ VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA.,
850 .dstAlphaBlendFactor = VK_BLEND_FACTOR_SRC1_ALPHAcxx . . $ VK_BLEND_FACTOR_SRC1_ALPHA.,
851 .colorWriteMask = VK_COLOR_COMPONENT_A_BITcxx . . $ VK_COLOR_COMPONENT_A_BIT.
852 | VK_COLOR_COMPONENT_R_BITcxx . . $ VK_COLOR_COMPONENT_R_BIT.
853 | VK_COLOR_COMPONENT_G_BITcxx . . $ VK_COLOR_COMPONENT_G_BIT.
854 | VK_COLOR_COMPONENT_B_BITcxx . . $ VK_COLOR_COMPONENT_B_BIT.
855 },
856 };
857
858 VkPipelinecxx . . $ VkPipeline#
859 gsk_vulkan_device_get_vk_pipelinecxx . . $ gsk_vulkan_device_get_vk_pipeline(f58a0d85a1c43755). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
860 VkPipelineLayoutcxx . . $ VkPipelineLayout# vk_layout,
861 const GskGpuShaderOpClasscxx . . $ GskGpuShaderOpClass# *op_class,
862 GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flags,
863 GskGpuColorStatescxx . . $ GskGpuColorStates# color_states,
864 guint32cxx . . $ guint32# variation,
865 GskGpuBlendcxx . . $ GskGpuBlend# blend,
866 VkFormatcxx . . $ VkFormat# vk_format,
867 VkRenderPasscxx . . $ VkRenderPass# render_pass)
868 {
869 PipelineCacheKeycxx . . $ PipelineCacheKey# cache_key;
870 PipelineCacheKeycxx . . $ PipelineCacheKey# *cached_result;
871 VkPipelinecxx . . $ VkPipeline# vk_pipeline;
872 GdkDisplaycxx . . $ GdkDisplay# *display;
873 char *vertex_shader_name, *fragment_shader_name;
874 G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! gint64cxx . . $ gint64# begin_time = GDK_PROFILER_CURRENT_TIMEcxx . . $ `gdk/gdkprofilerprivate.h:39:9`!;
875 const char *blend_name[] = { "NONE", "OVER", "ADD", "CLEAR" };
876
877 cache_key = (PipelineCacheKeycxx . . $ PipelineCacheKey#) {
878 .vk_layout = vk_layout,
879 .op_class = op_class,
880 .color_states = color_states,
881 .variation = variation,
882 .flags = flags,
883 .blend = blend,
884 .vk_format = vk_format,
885 };
886 cached_result = g_hash_table_lookupcxx . . $ g_hash_table_lookup(8183d62c39a6a245). (self->pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache., &cache_key);
887 if (cached_result)
888 return cached_result->vk_pipelinecxx . . $ _PipelineCacheKey#vk_pipeline.;
889
890 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (blend <= G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (blend_attachment_states));
891
892 display = gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self));
893
894 vertex_shader_name = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). ("/org/gtk/libgsk/shaders/vulkan/",
895 op_class->shader_namecxx . . $ _GskGpuShaderOpClass#shader_name.,
896 ".vert.spv",
897 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
898 fragment_shader_name = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). ("/org/gtk/libgsk/shaders/vulkan/",
899 op_class->shader_namecxx . . $ _GskGpuShaderOpClass#shader_name.,
900 ".frag.spv",
901 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
902
903 GSK_VK_CHECKcxx . . $ `gsk/gpu/gskvulkandeviceprivate.h:85:9`! (vkCreateGraphicsPipelines, display->vk_device,
904 display->vk_pipeline_cache,
905 1,
906 &(VkGraphicsPipelineCreateInfo) {
907 .sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO,
908 .stageCount = 2,
909 .pStages = (VkPipelineShaderStageCreateInfo[2]) {
910 {
911 .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
912 .stage = VK_SHADER_STAGE_VERTEX_BIT,
913 .module = gdk_display_get_vk_shader_module (display, vertex_shader_name),
914 .pName = "main",
915 .pSpecializationInfo = &(VkSpecializationInfo) {
916 .mapEntryCount = 3,
917 .pMapEntries = (VkSpecializationMapEntry[6]) {
918 {
919 .constantID = 0,
920 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, flags),
921 .size = sizeof (guint32),
922 },
923 {
924 .constantID = 1,
925 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, color_states),
926 .size = sizeof (guint32),
927 },
928 {
929 .constantID = 2,
930 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, variation),
931 .size = sizeof (guint32),
932 },
933 },
934 .dataSize = sizeof (GskVulkanShaderSpecialization),
935 .pData = &(GskVulkanShaderSpecialization) {
936 .flags = flags,
937 .color_states = color_states,
938 .variation = variation,
939 },
940 },
941 },
942 {
943 .sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
944 .stage = VK_SHADER_STAGE_FRAGMENT_BIT,
945 .module = gdk_display_get_vk_shader_module (display, fragment_shader_name),
946 .pName = "main",
947 .pSpecializationInfo = &(VkSpecializationInfo) {
948 .mapEntryCount = 3,
949 .pMapEntries = (VkSpecializationMapEntry[6]) {
950 {
951 .constantID = 0,
952 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, flags),
953 .size = sizeof (guint32),
954 },
955 {
956 .constantID = 1,
957 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, color_states),
958 .size = sizeof (guint32),
959 },
960 {
961 .constantID = 2,
962 .offset = G_STRUCT_OFFSETcxx . . $ `<external>/12741050725406041920/gmacros.h:1005:9`! (GskVulkanShaderSpecialization, variation),
963 .size = sizeof (guint32),
964 },
965 },
966 .dataSize = sizeof (GskVulkanShaderSpecialization),
967 .pData = &(GskVulkanShaderSpecialization) {
968 .flags = flags,
969 .color_states = color_states,
970 .variation = variation,
971 },
972 },
973 },
974 },
975
976 .pVertexInputState = op_class->vertex_input_state,
977 .pInputAssemblyState = &(VkPipelineInputAssemblyStateCreateInfo) {
978 .sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO,
979 .topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST,
980 .primitiveRestartEnable = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!,
981 },
982 .pTessellationState = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
983 .pViewportState = &(VkPipelineViewportStateCreateInfo) {
984 .sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
985 .viewportCount = 1,
986 .scissorCount = 1
987 },
988 .pRasterizationState = &(VkPipelineRasterizationStateCreateInfo) {
989 .sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
990 .depthClampEnable = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!,
991 .rasterizerDiscardEnable = VK_FALSEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:124:9`!,
992 .polygonMode = VK_POLYGON_MODE_FILL,
993 .cullMode = VK_CULL_MODE_NONE,
994 .frontFace = VK_FRONT_FACE_CLOCKWISE,
995 .lineWidth = 1.0f,
996 },
997 .pMultisampleState = &(VkPipelineMultisampleStateCreateInfo) {
998 .sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
999 .rasterizationSamples = 1,
1000 },
1001 .pDepthStencilState = &(VkPipelineDepthStencilStateCreateInfo) {
1002 .sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1003 },
1004 .pColorBlendState = &(VkPipelineColorBlendStateCreateInfo) {
1005 .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
1006 .attachmentCount = 1,
1007 .pAttachments = &blend_attachment_states[blend],
1008 },
1009 .pDynamicState = &(VkPipelineDynamicStateCreateInfo) {
1010 .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
1011 .dynamicStateCount = 2,
1012 .pDynamicStates = (VkDynamicState[2]) {
1013 VK_DYNAMIC_STATE_VIEWPORT,
1014 VK_DYNAMIC_STATE_SCISSOR
1015 },
1016 },
1017 .layout = vk_layout,
1018 .renderPass = render_pass,
1019 .subpass = 0,
1020 .basePipelineHandle = VK_NULL_HANDLEcxx . . $ `<external>/13734482859137699468/vulkan_core.h:43:21`!,
1021 .basePipelineIndex = -1,
1022 },
1023 NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!,
1024 &vk_pipeline);
1025
1026 gdk_profiler_end_markfcxx . . $ `gdk/gdkprofilerprivate.h:80:9`! (begin_time,
1027 "Create Vulkan pipeline", "%s color states=%u variation=%u clip=%u blend=%s format=%u",
1028 op_class->shader_name,
1029 flags,
1030 color_states,
1031 variation,
1032 blend_name[blend],
1033 vk_format);
1034
1035 GSK_DEBUGcxx . . $ `gsk/gskdebugprivate.h:41:9`! (SHADERS,
1036 "Create Vulkan pipeline (%s, %u/%u/%u/%s/%u)",
1037 op_class->shader_name,
1038 flags,
1039 color_states,
1040 variation,
1041 blend_name[blend],
1042 vk_format);
1043
1044 g_freecxx . . $ g_free(5d22bdacc48458e8). (fragment_shader_name);
1045 g_freecxx . . $ g_free(5d22bdacc48458e8). (vertex_shader_name);
1046
1047 cached_result = g_memdup2cxx . . $ g_memdup2(7ca5e6a2fd1baf31). (&cache_key, sizeof (PipelineCacheKeycxx . . $ PipelineCacheKey#));
1048 cached_result->vk_pipelinecxx . . $ _PipelineCacheKey#vk_pipeline. = vk_pipeline;
1049 g_hash_table_addcxx . . $ g_hash_table_add(69c5b3b3568d4848). (self->pipeline_cachecxx . . $ _GskVulkanDevice#pipeline_cache., cached_result);
1050 gdk_display_vulkan_pipeline_cache_updatedcxx . . $ gdk_display_vulkan_pipeline_cache_updated(2f702f82283e587b). (display);
1051
1052 return vk_pipeline;
1053 }
1054
1055 GskVulkanAllocatorcxx . . $ GskVulkanAllocator# *
1056 gsk_vulkan_device_get_allocatorcxx . . $ gsk_vulkan_device_get_allocator(1dc6e80fd5bf1545). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
1057 gsizecxx . . $ gsize# index)
1058 {
1059 if (self->allocatorscxx . . $ _GskVulkanDevice#allocators.[index] == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1060 {
1061 VkPhysicalDeviceMemoryPropertiescxx . . $ VkPhysicalDeviceMemoryProperties# properties;
1062
1063 vkGetPhysicalDeviceMemoryPropertiescxx . . $ vkGetPhysicalDeviceMemoryProperties(813adcf1e803573f). (gsk_vulkan_device_get_vk_physical_devicecxx . . $ gsk_vulkan_device_get_vk_physical_device(fbb7f33f5baaff7). (self),
1064 &properties);
1065
1066 self->allocatorscxx . . $ _GskVulkanDevice#allocators.[index] = gsk_vulkan_direct_allocator_newcxx . . $ gsk_vulkan_direct_allocator_new(51c29667b8ae6e0c). (gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self),
1067 index,
1068 &properties.memoryTypescxx . . $ VkPhysicalDeviceMemoryProperties#memoryTypes.[index]);
1069 self->allocatorscxx . . $ _GskVulkanDevice#allocators.[index] = gsk_vulkan_buddy_allocator_newcxx . . $ gsk_vulkan_buddy_allocator_new(43f4f48e72b3ed8f). (self->allocatorscxx . . $ _GskVulkanDevice#allocators.[index],
1070 1024 * 1024);
1071 //allocators[index] = gsk_vulkan_stats_allocator_new (allocators[index]);
1072 }
1073
1074 return self->allocatorscxx . . $ _GskVulkanDevice#allocators.[index];
1075 }
1076
1077 /* following code found in
1078 * https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkPhysicalDeviceMemoryProperties.html */
1079 gsizecxx . . $ gsize#
1080 gsk_vulkan_device_find_allocatorcxx . . $ gsk_vulkan_device_find_allocator(3b98c1ed9ff9deb7). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self,
1081 uint32_tcxx . . $ uint32_t# allowed_types,
1082 VkMemoryPropertyFlagscxx . . $ VkMemoryPropertyFlags# required_flags,
1083 VkMemoryPropertyFlagscxx . . $ VkMemoryPropertyFlags# desired_flags)
1084 {
1085 VkPhysicalDeviceMemoryPropertiescxx . . $ VkPhysicalDeviceMemoryProperties# properties;
1086 uint32_tcxx . . $ uint32_t# i, found;
1087
1088 vkGetPhysicalDeviceMemoryPropertiescxx . . $ vkGetPhysicalDeviceMemoryProperties(813adcf1e803573f). (gsk_vulkan_device_get_vk_physical_devicecxx . . $ gsk_vulkan_device_get_vk_physical_device(fbb7f33f5baaff7). (self),
1089 &properties);
1090
1091 found = properties.memoryTypeCountcxx . . $ VkPhysicalDeviceMemoryProperties#memoryTypeCount.;
1092 for (i = 0; i < properties.memoryTypeCountcxx . . $ VkPhysicalDeviceMemoryProperties#memoryTypeCount.; i++)
1093 {
1094 if (!(allowed_types & (1 << i)))
1095 continue;
1096
1097 if ((properties.memoryTypescxx . . $ VkPhysicalDeviceMemoryProperties#memoryTypes.[i].propertyFlagscxx . . $ VkMemoryType#propertyFlags. & required_flags) != required_flags)
1098 continue;
1099
1100 found = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (i, found);
1101
1102 if ((properties.memoryTypescxx . . $ VkPhysicalDeviceMemoryProperties#memoryTypes.[i].propertyFlagscxx . . $ VkMemoryType#propertyFlags. & desired_flags) == desired_flags)
1103 {
1104 found = i;
1105 break;
1106 }
1107 }
1108
1109 g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (found < properties.memoryTypeCount);
1110
1111 return found;
1112 }
1113
1114 GskVulkanAllocatorcxx . . $ GskVulkanAllocator# *
1115 gsk_vulkan_device_get_external_allocatorcxx . . $ gsk_vulkan_device_get_external_allocator(19d372d1a0656920). (GskVulkanDevicecxx . . $ GskVulkanDevice# *self)
1116 {
1117 if (self->external_allocatorcxx . . $ _GskVulkanDevice#external_allocator. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
1118 {
1119 self->external_allocatorcxx . . $ _GskVulkanDevice#external_allocator. = gsk_vulkan_external_allocator_newcxx . . $ gsk_vulkan_external_allocator_new(762b64364e899464). (gsk_vulkan_device_get_vk_devicecxx . . $ gsk_vulkan_device_get_vk_device(4319e0de3864a3a5). (self));
1120 //self->external_allocator = gsk_vulkan_stats_allocator_new (self->external_allocator);
1121 }
1122
1123 return self->external_allocatorcxx . . $ _GskVulkanDevice#external_allocator.;
1124 }