| 1 | #cxx . . $ `<file>/gsk/gpu/gskgldevice.c`/include "config.h"cxx . . $ `<file>/build/config.h`/ |
| 2 | |
| 3 | #include "gskgldeviceprivate.h"cxx . . $ `<file>/gsk/gpu/gskgldeviceprivate.h`/ |
| 4 | |
| 5 | #include "gskdebugprivate.h"cxx . . $ `<file>/gsk/gskdebugprivate.h`/ |
| 6 | #include "gskgpushaderflagsprivate.h"cxx . . $ `<file>/gsk/gpu/gskgpushaderflagsprivate.h`/ |
| 7 | #include "gskgpushaderopprivate.h"cxx . . $ `<file>/gsk/gpu/gskgpushaderopprivate.h`/ |
| 8 | #include "gskglbufferprivate.h"cxx . . $ `<file>/gsk/gpu/gskglbufferprivate.h`/ |
| 9 | #include "gskglimageprivate.h"cxx . . $ `<file>/gsk/gpu/gskglimageprivate.h`/ |
| 10 | |
| 11 | #include "gdk/gdkdisplayprivate.h"cxx . . $ `<file>/gdk/gdkdisplayprivate.h`/ |
| 12 | #include "gdk/gdkglcontextprivate.h"cxx . . $ `<file>/gdk/gdkglcontextprivate.h`/ |
| 13 | #include "gdk/gdkprofilerprivate.h"cxx . . $ `<file>/gdk/gdkprofilerprivate.h`/ |
| 14 | |
| 15 | #include <glib/gi18n-lib.h> |
| 16 | |
| 17 | struct _GskGLDevicecxx . . $ _GskGLDevice# |
| 18 | { |
| 19 | GskGpuDevicecxx . . $ GskGpuDevice# parent_instancecxx . . $ _GskGLDevice#parent_instance.; |
| 20 | |
| 21 | GHashTablecxx . . $ GHashTable# *gl_programscxx . . $ _GskGLDevice#gl_programs.; |
| 22 | const char *version_stringcxx . . $ _GskGLDevice#version_string.; |
| 23 | GdkGLAPIcxx . . $ GdkGLAPI# apicxx . . $ _GskGLDevice#api.; |
| 24 | |
| 25 | guintcxx . . $ guint# sampler_idscxx . . $ _GskGLDevice#sampler_ids.[GSK_GPU_SAMPLER_N_SAMPLERScxx . . $ GSK_GPU_SAMPLER_N_SAMPLERS.]; |
| 26 | }; |
| 27 | |
| 28 | struct _GskGLDeviceClasscxx . . $ _GskGLDeviceClass# |
| 29 | { |
| 30 | GskGpuDeviceClasscxx . . $ GskGpuDeviceClass# parent_classcxx . . $ _GskGLDeviceClass#parent_class.; |
| 31 | }; |
| 32 | |
| 33 | typedef struct _GLProgramKeycxx . . $ _GLProgramKey# GLProgramKeycxx . . $ GLProgramKey#; |
| 34 | |
| 35 | struct _GLProgramKeycxx . . $ _GLProgramKey# |
| 36 | { |
| 37 | const GskGpuShaderOpClasscxx . . $ GskGpuShaderOpClass# *op_classcxx . . $ _GLProgramKey#op_class.; |
| 38 | GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flagscxx . . $ _GLProgramKey#flags.; |
| 39 | GskGpuColorStatescxx . . $ GskGpuColorStates# color_statescxx . . $ _GLProgramKey#color_states.; |
| 40 | guint32cxx . . $ guint32# variationcxx . . $ _GLProgramKey#variation.; |
| 41 | }; |
| 42 | |
| 43 | G_DEFINE_TYPEcxx . . $ `<external>/9567554376676449156/gtype.h:1834:9`! (GskGLDevice, gsk_gl_device, GSK_TYPE_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:9:9`!) |
| 44 | |
| 45 | static guintcxx . . $ guint# |
| 46 | gl_program_key_hashcxx . . $ gl_program_key_hash(b11f534102b1ad6). (gconstpointercxx . . $ gconstpointer# data) |
| 47 | { |
| 48 | const GLProgramKeycxx . . $ GLProgramKey# *key = data; |
| 49 | |
| 50 | return GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (key->op_class) ^ |
| 51 | ((key->flagscxx . . $ _GLProgramKey#flags. << 11) | (key->flagscxx . . $ _GLProgramKey#flags. >> 21)) ^ |
| 52 | ((key->variationcxx . . $ _GLProgramKey#variation. << 21) | ( key->variationcxx . . $ _GLProgramKey#variation. >> 11)) ^ |
| 53 | key->color_statescxx . . $ _GLProgramKey#color_states.; |
| 54 | } |
| 55 | |
| 56 | static gbooleancxx . . $ gboolean# |
| 57 | gl_program_key_equalcxx . . $ gl_program_key_equal(9148c8c3ff42c9d8). (gconstpointercxx . . $ gconstpointer# a, |
| 58 | gconstpointercxx . . $ gconstpointer# b) |
| 59 | { |
| 60 | const GLProgramKeycxx . . $ GLProgramKey# *keya = a; |
| 61 | const GLProgramKeycxx . . $ GLProgramKey# *keyb = b; |
| 62 | |
| 63 | return keya->op_classcxx . . $ _GLProgramKey#op_class. == keyb->op_classcxx . . $ _GLProgramKey#op_class. && |
| 64 | keya->flagscxx . . $ _GLProgramKey#flags. == keyb->flagscxx . . $ _GLProgramKey#flags. && |
| 65 | keya->color_statescxx . . $ _GLProgramKey#color_states. == keyb->color_statescxx . . $ _GLProgramKey#color_states. && |
| 66 | keya->variationcxx . . $ _GLProgramKey#variation. == keyb->variationcxx . . $ _GLProgramKey#variation.; |
| 67 | } |
| 68 | |
| 69 | static GskGpuImagecxx . . $ GskGpuImage# * |
| 70 | gsk_gl_device_create_offscreen_imagecxx . . $ gsk_gl_device_create_offscreen_image(6b528020e6467c41). (GskGpuDevicecxx . . $ GskGpuDevice# *device, |
| 71 | gbooleancxx . . $ gboolean# with_mipmap, |
| 72 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# format, |
| 73 | gbooleancxx . . $ gboolean# is_srgb, |
| 74 | gsizecxx . . $ gsize# width, |
| 75 | gsizecxx . . $ gsize# height) |
| 76 | { |
| 77 | GskGLDevicecxx . . $ GskGLDevice# *self = GSK_GL_DEVICEcxx . . $ GSK_GL_DEVICE(60c07165c20e694d). (device); |
| 78 | |
| 79 | return gsk_gl_image_newcxx . . $ gsk_gl_image_new(a4276edb1a591a37). (self, |
| 80 | format, |
| 81 | is_srgb, |
| 82 | GSK_GPU_IMAGE_RENDERABLEcxx . . $ GSK_GPU_IMAGE_RENDERABLE. | GSK_GPU_IMAGE_FILTERABLEcxx . . $ GSK_GPU_IMAGE_FILTERABLE., |
| 83 | width, |
| 84 | height); |
| 85 | } |
| 86 | |
| 87 | static GskGpuImagecxx . . $ GskGpuImage# * |
| 88 | gsk_gl_device_create_upload_imagecxx . . $ gsk_gl_device_create_upload_image(a07706f50eb86484). (GskGpuDevicecxx . . $ GskGpuDevice# *device, |
| 89 | gbooleancxx . . $ gboolean# with_mipmap, |
| 90 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# format, |
| 91 | GskGpuConversioncxx . . $ GskGpuConversion# conv, |
| 92 | gsizecxx . . $ gsize# width, |
| 93 | gsizecxx . . $ gsize# height) |
| 94 | { |
| 95 | GskGLDevicecxx . . $ GskGLDevice# *self = GSK_GL_DEVICEcxx . . $ GSK_GL_DEVICE(60c07165c20e694d). (device); |
| 96 | |
| 97 | return gsk_gl_image_newcxx . . $ gsk_gl_image_new(a4276edb1a591a37). (self, |
| 98 | format, |
| 99 | conv == GSK_GPU_CONVERSION_SRGBcxx . . $ GSK_GPU_CONVERSION_SRGB., |
| 100 | 0, |
| 101 | width, |
| 102 | height); |
| 103 | } |
| 104 | |
| 105 | static GskGpuImagecxx . . $ GskGpuImage# * |
| 106 | gsk_gl_device_create_download_imagecxx . . $ gsk_gl_device_create_download_image(4476b7a14593eca). (GskGpuDevicecxx . . $ GskGpuDevice# *device, |
| 107 | GdkMemoryDepthcxx . . $ GdkMemoryDepth# depth, |
| 108 | gsizecxx . . $ gsize# width, |
| 109 | gsizecxx . . $ gsize# height) |
| 110 | { |
| 111 | GskGLDevicecxx . . $ GskGLDevice# *self = GSK_GL_DEVICEcxx . . $ GSK_GL_DEVICE(60c07165c20e694d). (device); |
| 112 | |
| 113 | return gsk_gl_image_newcxx . . $ gsk_gl_image_new(a4276edb1a591a37). (self, |
| 114 | gdk_memory_depth_get_formatcxx . . $ gdk_memory_depth_get_format(26117449a7af4f22). (depth), |
| 115 | gdk_memory_depth_is_srgbcxx . . $ gdk_memory_depth_is_srgb(7a45cfb6ee7d51af). (depth), |
| 116 | GSK_GPU_IMAGE_RENDERABLEcxx . . $ GSK_GPU_IMAGE_RENDERABLE. | GSK_GPU_IMAGE_DOWNLOADABLEcxx . . $ GSK_GPU_IMAGE_DOWNLOADABLE., |
| 117 | width, |
| 118 | height); |
| 119 | } |
| 120 | |
| 121 | static GskGpuImagecxx . . $ GskGpuImage# * |
| 122 | gsk_gl_device_create_atlas_imagecxx . . $ gsk_gl_device_create_atlas_image(1caf50e10af4e5b7). (GskGpuDevicecxx . . $ GskGpuDevice# *device, |
| 123 | gsizecxx . . $ gsize# width, |
| 124 | gsizecxx . . $ gsize# height) |
| 125 | { |
| 126 | GskGLDevicecxx . . $ GskGLDevice# *self = GSK_GL_DEVICEcxx . . $ GSK_GL_DEVICE(60c07165c20e694d). (device); |
| 127 | |
| 128 | return gsk_gl_image_newcxx . . $ gsk_gl_image_new(a4276edb1a591a37). (self, |
| 129 | GDK_MEMORY_DEFAULTcxx . . $ `gdk/gdkmemorytexture.h:43:9`!, |
| 130 | FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!, |
| 131 | GSK_GPU_IMAGE_RENDERABLEcxx . . $ GSK_GPU_IMAGE_RENDERABLE., |
| 132 | width, |
| 133 | height); |
| 134 | } |
| 135 | |
| 136 | static void |
| 137 | gsk_gl_device_make_currentcxx . . $ gsk_gl_device_make_current(4d47fb05a7f505ef). (GskGpuDevicecxx . . $ GskGpuDevice# *device) |
| 138 | { |
| 139 | gdk_gl_context_make_currentcxx . . $ gdk_gl_context_make_current(6e1c86d47c4ef917). (gdk_display_get_gl_contextcxx . . $ gdk_display_get_gl_context(d4cdb27e784da454). (gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (device))); |
| 140 | } |
| 141 | |
| 142 | static void |
| 143 | gsk_gl_device_finalizecxx . . $ gsk_gl_device_finalize(6087475fa43034d3). (GObjectcxx . . $ GObject# *object) |
| 144 | { |
| 145 | GskGLDevicecxx . . $ GskGLDevice# *self = GSK_GL_DEVICEcxx . . $ GSK_GL_DEVICE(60c07165c20e694d). (object); |
| 146 | GskGpuDevicecxx . . $ GskGpuDevice# *device = GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self); |
| 147 | |
| 148 | g_object_steal_datacxx . . $ g_object_steal_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (gsk_gpu_device_get_display (device)), "-gsk-gl-device"); |
| 149 | |
| 150 | gdk_gl_context_make_currentcxx . . $ gdk_gl_context_make_current(6e1c86d47c4ef917). (gdk_display_get_gl_contextcxx . . $ gdk_display_get_gl_context(d4cdb27e784da454). (gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (device))); |
| 151 | |
| 152 | g_hash_table_unrefcxx . . $ g_hash_table_unref(ce4eddf544b9218). (self->gl_programscxx . . $ _GskGLDevice#gl_programs.); |
| 153 | glDeleteSamplerscxx . . $ `<external>/17235136775614108268/gl_generated.h:17163:9`! (G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (self->sampler_ids), self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.); |
| 154 | |
| 155 | G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (gsk_gl_device_parent_class)->finalizecxx . . $ _GObjectClass#finalize. (object); |
| 156 | } |
| 157 | |
| 158 | static void |
| 159 | gsk_gl_device_class_initcxx . . $ gsk_gl_device_class_init(c15cd44c4dec97a5). (GskGLDeviceClasscxx . . $ GskGLDeviceClass# *klass) |
| 160 | { |
| 161 | GskGpuDeviceClasscxx . . $ GskGpuDeviceClass# *gpu_device_class = GSK_GPU_DEVICE_CLASScxx . . $ `gsk/gpu/gskgpudeviceprivate.h:11:9`! (klass); |
| 162 | GObjectClasscxx . . $ GObjectClass# *object_class = G_OBJECT_CLASScxx . . $ `<external>/1341695927569185362/gobject.h:61:9`! (klass); |
| 163 | |
| 164 | gpu_device_class->create_offscreen_imagecxx . . $ _GskGpuDeviceClass#create_offscreen_image. = gsk_gl_device_create_offscreen_imagecxx . . $ gsk_gl_device_create_offscreen_image(6b528020e6467c41).; |
| 165 | gpu_device_class->create_atlas_imagecxx . . $ _GskGpuDeviceClass#create_atlas_image. = gsk_gl_device_create_atlas_imagecxx . . $ gsk_gl_device_create_atlas_image(1caf50e10af4e5b7).; |
| 166 | gpu_device_class->create_upload_imagecxx . . $ _GskGpuDeviceClass#create_upload_image. = gsk_gl_device_create_upload_imagecxx . . $ gsk_gl_device_create_upload_image(a07706f50eb86484).; |
| 167 | gpu_device_class->create_download_imagecxx . . $ _GskGpuDeviceClass#create_download_image. = gsk_gl_device_create_download_imagecxx . . $ gsk_gl_device_create_download_image(4476b7a14593eca).; |
| 168 | gpu_device_class->make_currentcxx . . $ _GskGpuDeviceClass#make_current. = gsk_gl_device_make_currentcxx . . $ gsk_gl_device_make_current(4d47fb05a7f505ef).; |
| 169 | |
| 170 | object_class->finalizecxx . . $ _GObjectClass#finalize. = gsk_gl_device_finalizecxx . . $ gsk_gl_device_finalize(6087475fa43034d3).; |
| 171 | } |
| 172 | |
| 173 | static void |
| 174 | free_gl_programcxx . . $ free_gl_program(5d22bdacc48458e8). (gpointercxx . . $ gpointer# program) |
| 175 | { |
| 176 | glDeleteProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:17151:9`! (GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (program)); |
| 177 | } |
| 178 | |
| 179 | static void |
| 180 | gsk_gl_device_initcxx . . $ gsk_gl_device_init(a82fdbe084553ff). (GskGLDevicecxx . . $ GskGLDevice# *self) |
| 181 | { |
| 182 | self->gl_programscxx . . $ _GskGLDevice#gl_programs. = g_hash_table_new_fullcxx . . $ g_hash_table_new_full(e2dd12b570de7430). (gl_program_key_hashcxx . . $ gl_program_key_hash(b11f534102b1ad6)., gl_program_key_equalcxx . . $ gl_program_key_equal(9148c8c3ff42c9d8)., g_freecxx . . $ g_free(5d22bdacc48458e8)., free_gl_programcxx . . $ free_gl_program(5d22bdacc48458e8).); |
| 183 | } |
| 184 | |
| 185 | static void |
| 186 | gsk_gl_device_setup_samplerscxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff). (GskGLDevicecxx . . $ GskGLDevice# *self) |
| 187 | { |
| 188 | structcxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0# { |
| 189 | GLuintcxx . . $ GLuint# min_filtercxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#min_filter.; |
| 190 | GLuintcxx . . $ GLuint# mag_filtercxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#mag_filter.; |
| 191 | GLuintcxx . . $ GLuint# wrapcxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#wrap.; |
| 192 | } sampler_flags[GSK_GPU_SAMPLER_N_SAMPLERScxx . . $ GSK_GPU_SAMPLER_N_SAMPLERS.] = { |
| 193 | [GSK_GPU_SAMPLER_DEFAULTcxx . . $ GSK_GPU_SAMPLER_DEFAULT.] = { |
| 194 | .min_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 195 | .mag_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 196 | .wrap = GL_CLAMP_TO_EDGEcxx . . $ `<external>/17235136775614108268/gl_generated.h:2324:9`!, |
| 197 | }, |
| 198 | [GSK_GPU_SAMPLER_TRANSPARENTcxx . . $ GSK_GPU_SAMPLER_TRANSPARENT.] = { |
| 199 | .min_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 200 | .mag_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 201 | .wrap = GL_CLAMP_TO_BORDERcxx . . $ `<external>/17235136775614108268/gl_generated.h:2317:9`!, |
| 202 | }, |
| 203 | [GSK_GPU_SAMPLER_REPEATcxx . . $ GSK_GPU_SAMPLER_REPEAT.] = { |
| 204 | .min_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 205 | .mag_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 206 | .wrap = GL_REPEATcxx . . $ `<external>/17235136775614108268/gl_generated.h:1743:9`!, |
| 207 | }, |
| 208 | [GSK_GPU_SAMPLER_REFLECTcxx . . $ GSK_GPU_SAMPLER_REFLECT.] = { |
| 209 | .min_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 210 | .mag_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 211 | .wrap = GL_MIRRORED_REPEATcxx . . $ `<external>/17235136775614108268/gl_generated.h:2912:9`!, |
| 212 | }, |
| 213 | [GSK_GPU_SAMPLER_NEARESTcxx . . $ GSK_GPU_SAMPLER_NEAREST.] = { |
| 214 | .min_filter = GL_NEARESTcxx . . $ `<external>/17235136775614108268/gl_generated.h:1732:9`!, |
| 215 | .mag_filter = GL_NEARESTcxx . . $ `<external>/17235136775614108268/gl_generated.h:1732:9`!, |
| 216 | .wrap = GL_CLAMP_TO_EDGEcxx . . $ `<external>/17235136775614108268/gl_generated.h:2324:9`!, |
| 217 | }, |
| 218 | [GSK_GPU_SAMPLER_MIPMAP_DEFAULTcxx . . $ GSK_GPU_SAMPLER_MIPMAP_DEFAULT.] = { |
| 219 | .min_filter = GL_LINEAR_MIPMAP_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1737:9`!, |
| 220 | .mag_filter = GL_LINEARcxx . . $ `<external>/17235136775614108268/gl_generated.h:1733:9`!, |
| 221 | .wrap = GL_CLAMP_TO_EDGEcxx . . $ `<external>/17235136775614108268/gl_generated.h:2324:9`!, |
| 222 | } |
| 223 | }; |
| 224 | guintcxx . . $ guint# i; |
| 225 | |
| 226 | glGenSamplerscxx . . $ `<external>/17235136775614108268/gl_generated.h:17497:9`! (G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (self->sampler_ids), self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.); |
| 227 | |
| 228 | for (i = 0; i < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (self->sampler_ids); i++) |
| 229 | { |
| 230 | glSamplerParametericxx . . $ `<external>/17235136775614108268/gl_generated.h:18968:9`! (self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.[i], GL_TEXTURE_MIN_FILTERcxx . . $ `<external>/17235136775614108268/gl_generated.h:1739:9`!, sampler_flags[i].min_filtercxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#min_filter.); |
| 231 | glSamplerParametericxx . . $ `<external>/17235136775614108268/gl_generated.h:18968:9`! (self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.[i], GL_TEXTURE_MAG_FILTERcxx . . $ `<external>/17235136775614108268/gl_generated.h:1738:9`!, sampler_flags[i].mag_filtercxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#mag_filter.); |
| 232 | glSamplerParametericxx . . $ `<external>/17235136775614108268/gl_generated.h:18968:9`! (self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.[i], GL_TEXTURE_WRAP_Scxx . . $ `<external>/17235136775614108268/gl_generated.h:1740:9`!, sampler_flags[i].wrapcxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#wrap.); |
| 233 | glSamplerParametericxx . . $ `<external>/17235136775614108268/gl_generated.h:18968:9`! (self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.[i], GL_TEXTURE_WRAP_Tcxx . . $ `<external>/17235136775614108268/gl_generated.h:1741:9`!, sampler_flags[i].wrapcxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff).$anonymous_type_0#wrap.); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | GskGpuDevicecxx . . $ GskGpuDevice# * |
| 238 | gsk_gl_device_get_for_displaycxx . . $ gsk_gl_device_get_for_display(88962f50eb9d3072). (GdkDisplaycxx . . $ GdkDisplay# *display, |
| 239 | GErrorcxx . . $ GError# **error) |
| 240 | { |
| 241 | GskGLDevicecxx . . $ GskGLDevice# *self; |
| 242 | GdkGLContextcxx . . $ GdkGLContext# *context; |
| 243 | GLintcxx . . $ GLint# max_texture_size, globals_alignment; |
| 244 | |
| 245 | self = g_object_get_datacxx . . $ g_object_get_data(973400aee2f864c2). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (display), "-gsk-gl-device"); |
| 246 | if (self) |
| 247 | return GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (g_object_refcxx . . $ `<external>/1341695927569185362/gobject.h:533:9`! (self)); |
| 248 | |
| 249 | if (!gdk_display_prepare_glcxx . . $ gdk_display_prepare_gl(74e87afd5527a56f). (display, error)) |
| 250 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 251 | |
| 252 | context = gdk_display_get_gl_contextcxx . . $ gdk_display_get_gl_context(d4cdb27e784da454). (display); |
| 253 | |
| 254 | /* GLES 2 is not supported */ |
| 255 | if (!gdk_gl_context_check_versioncxx . . $ gdk_gl_context_check_version(3fe2a571b5544c30). (context, "3.0", "3.0")) |
| 256 | { |
| 257 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, GDK_GL_ERRORcxx . . $ `gdk/gdkglcontext.h:35:9`!, GDK_GL_ERROR_NOT_AVAILABLEcxx . . $ GDK_GL_ERROR_NOT_AVAILABLE., |
| 258 | _cxx . . $ `<external>/16453136837583379545/gi18n-lib.h:32:10`!("OpenGL ES 3.0 is not supported by this renderer.")); |
| 259 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 260 | } |
| 261 | |
| 262 | self = g_object_newcxx . . $ g_object_new(8485fe61b4be4c78). (GSK_TYPE_GL_DEVICEcxx . . $ `gsk/gpu/gskgldeviceprivate.h:7:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 263 | |
| 264 | gdk_gl_context_make_currentcxx . . $ gdk_gl_context_make_current(6e1c86d47c4ef917). (context); |
| 265 | |
| 266 | glGetIntegervcxx . . $ `<external>/17235136775614108268/gl_generated.h:17646:9`! (GL_MAX_TEXTURE_SIZEcxx . . $ `<external>/17235136775614108268/gl_generated.h:1487:9`!, &max_texture_size); |
| 267 | glGetIntegervcxx . . $ `<external>/17235136775614108268/gl_generated.h:17646:9`! (GL_UNIFORM_BUFFER_OFFSET_ALIGNMENTcxx . . $ `<external>/17235136775614108268/gl_generated.h:4554:9`!, &globals_alignment); |
| 268 | |
| 269 | gsk_gpu_device_setupcxx . . $ gsk_gpu_device_setup(fb49d4d89258f8ed). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self), |
| 270 | display, |
| 271 | max_texture_size, |
| 272 | GSK_GPU_DEVICE_DEFAULT_TILE_SIZEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:7:9`!, |
| 273 | globals_alignment); |
| 274 | |
| 275 | self->version_stringcxx . . $ _GskGLDevice#version_string. = gdk_gl_context_get_glsl_version_stringcxx . . $ gdk_gl_context_get_glsl_version_string(ec378a335c9c845e). (context); |
| 276 | self->apicxx . . $ _GskGLDevice#api. = gdk_gl_context_get_apicxx . . $ gdk_gl_context_get_api(d0a05448c3d42611). (context); |
| 277 | gsk_gl_device_setup_samplerscxx . . $ gsk_gl_device_setup_samplers(a82fdbe084553ff). (self); |
| 278 | |
| 279 | g_object_set_datacxx . . $ g_object_set_data(c3d5001d890c27fc). (G_OBJECTcxx . . $ `<external>/1341695927569185362/gobject.h:54:9`! (display), "-gsk-gl-device", self); |
| 280 | |
| 281 | return GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self); |
| 282 | } |
| 283 | |
| 284 | static char * |
| 285 | prepend_line_numberscxx . . $ prepend_line_numbers(7a9722d75b371431). (char *code) |
| 286 | { |
| 287 | GStringcxx . . $ GString# *s; |
| 288 | char *p; |
| 289 | int line; |
| 290 | |
| 291 | s = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (""); |
| 292 | p = code; |
| 293 | line = 1; |
| 294 | while (*p) |
| 295 | { |
| 296 | char *end = strchrcxx . . $ strchr(2050848944e00d54). (p, '\n'); |
| 297 | if (end) |
| 298 | end = end + 1; /* Include newline */ |
| 299 | else |
| 300 | end = p + strlencxx . . $ strlen(751346f8406fd082). (p); |
| 301 | |
| 302 | g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (s, "%3d| ", line++); |
| 303 | g_string_append_lencxx . . $ `<external>/2906017559248664336/gstring.h:252:9`! (s, p, end - p); |
| 304 | |
| 305 | p = end; |
| 306 | } |
| 307 | |
| 308 | g_freecxx . . $ g_free(5d22bdacc48458e8). (code); |
| 309 | |
| 310 | return g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (s, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 311 | } |
| 312 | |
| 313 | static gbooleancxx . . $ gboolean# |
| 314 | gsk_gl_device_check_shader_errorcxx . . $ gsk_gl_device_check_shader_error(a4fe8053069f528d). (const char *name, |
| 315 | int shader_id, |
| 316 | GErrorcxx . . $ GError# **error) |
| 317 | { |
| 318 | GLintcxx . . $ GLint# status; |
| 319 | GLintcxx . . $ GLint# log_len; |
| 320 | GLintcxx . . $ GLint# code_len; |
| 321 | char *log; |
| 322 | char *code; |
| 323 | |
| 324 | glGetShaderivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17842:9`! (shader_id, GL_COMPILE_STATUScxx . . $ `<external>/17235136775614108268/gl_generated.h:4665:9`!, &status); |
| 325 | |
| 326 | if G_LIKELYcxx . . $ `<external>/12741050725406041920/gmacros.h:1284:9`! (status == GL_TRUEcxx . . $ `<external>/17235136775614108268/gl_generated.h:6835:9`!) |
| 327 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 328 | |
| 329 | glGetShaderivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17842:9`! (shader_id, GL_INFO_LOG_LENGTHcxx . . $ `<external>/17235136775614108268/gl_generated.h:4671:9`!, &log_len); |
| 330 | log = g_malloc0cxx . . $ g_malloc0(bfcfa4d6b7f7ef64). (log_len + 1); |
| 331 | glGetShaderInfoLogcxx . . $ `<external>/17235136775614108268/gl_generated.h:17838:9`! (shader_id, log_len, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, log); |
| 332 | |
| 333 | glGetShaderivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17842:9`! (shader_id, GL_SHADER_SOURCE_LENGTHcxx . . $ `<external>/17235136775614108268/gl_generated.h:4680:9`!, &code_len); |
| 334 | code = g_malloc0cxx . . $ g_malloc0(bfcfa4d6b7f7ef64). (code_len + 1); |
| 335 | glGetShaderSourcecxx . . $ `<external>/17235136775614108268/gl_generated.h:17840:9`! (shader_id, code_len, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, code); |
| 336 | |
| 337 | code = prepend_line_numberscxx . . $ prepend_line_numbers(7a9722d75b371431). (code); |
| 338 | |
| 339 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 340 | GDK_GL_ERRORcxx . . $ `gdk/gdkglcontext.h:35:9`!, |
| 341 | GDK_GL_ERROR_COMPILATION_FAILEDcxx . . $ GDK_GL_ERROR_COMPILATION_FAILED., |
| 342 | "Compilation failure in shader %s.\n" |
| 343 | "Source Code:\n" |
| 344 | "%s\n" |
| 345 | "\n" |
| 346 | "Error Message:\n" |
| 347 | "%s\n" |
| 348 | "\n", |
| 349 | name, |
| 350 | code, |
| 351 | log); |
| 352 | |
| 353 | g_freecxx . . $ g_free(5d22bdacc48458e8). (code); |
| 354 | g_freecxx . . $ g_free(5d22bdacc48458e8). (log); |
| 355 | |
| 356 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 357 | } |
| 358 | |
| 359 | static void |
| 360 | print_shader_infocxx . . $ print_shader_info(89794384c242646). (const char *prefix, |
| 361 | GLuintcxx . . $ GLuint# shader_id, |
| 362 | const char *name) |
| 363 | { |
| 364 | if (GSK_DEBUG_CHECKcxx . . $ `gsk/gskdebugprivate.h:31:9`! (SHADERS)) |
| 365 | { |
| 366 | int code_len; |
| 367 | |
| 368 | glGetShaderivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17842:9`! (shader_id, GL_SHADER_SOURCE_LENGTHcxx . . $ `<external>/17235136775614108268/gl_generated.h:4680:9`!, &code_len); |
| 369 | |
| 370 | if (code_len > 0) |
| 371 | { |
| 372 | char *code; |
| 373 | |
| 374 | code = g_malloc0cxx . . $ g_malloc0(bfcfa4d6b7f7ef64). (code_len + 1); |
| 375 | glGetShaderSourcecxx . . $ `<external>/17235136775614108268/gl_generated.h:17840:9`! (shader_id, code_len, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, code); |
| 376 | |
| 377 | code = prepend_line_numberscxx . . $ prepend_line_numbers(7a9722d75b371431). (code); |
| 378 | |
| 379 | g_messagecxx . . $ `<external>/5169755362661750954/gmessages.h:334:9`! ("%s %d, %s:\n%s", |
| 380 | prefix, shader_id, |
| 381 | name ? name : "unnamed", |
| 382 | code); |
| 383 | g_freecxx . . $ g_free(5d22bdacc48458e8). (code); |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | static gbooleancxx . . $ gboolean# |
| 389 | gsk_gl_device_has_gl_featurecxx . . $ gsk_gl_device_has_gl_feature(e48f3b071bf1b1d3). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 390 | GdkGLFeaturescxx . . $ GdkGLFeatures# feature) |
| 391 | { |
| 392 | GdkDisplaycxx . . $ GdkDisplay# *display = gsk_gpu_device_get_displaycxx . . $ gsk_gpu_device_get_display(4085a5602869895b). (GSK_GPU_DEVICEcxx . . $ `gsk/gpu/gskgpudeviceprivate.h:10:9`! (self)); |
| 393 | GdkGLContextcxx . . $ GdkGLContext# *context = gdk_display_get_gl_contextcxx . . $ gdk_display_get_gl_context(d4cdb27e784da454). (display); |
| 394 | |
| 395 | return gdk_gl_context_has_featurecxx . . $ gdk_gl_context_has_feature(20adff16f5baf5ca). (context, feature); |
| 396 | } |
| 397 | |
| 398 | static GLuintcxx . . $ GLuint# |
| 399 | gsk_gl_device_load_shadercxx . . $ gsk_gl_device_load_shader(531aa3fea193a4b5). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 400 | const char *program_name, |
| 401 | GLenumcxx . . $ GLenum# shader_type, |
| 402 | GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flags, |
| 403 | GskGpuColorStatescxx . . $ GskGpuColorStates# color_states, |
| 404 | guint32cxx . . $ guint32# variation, |
| 405 | GErrorcxx . . $ GError# **error) |
| 406 | { |
| 407 | GStringcxx . . $ GString# *preamble; |
| 408 | char *resource_name; |
| 409 | GBytescxx . . $ GBytes# *bytes; |
| 410 | GLuintcxx . . $ GLuint# shader_id; |
| 411 | |
| 412 | preamble = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 413 | |
| 414 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, self->version_string); |
| 415 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "\n"); |
| 416 | if (self->apicxx . . $ _GskGLDevice#api. == GDK_GL_API_GLEScxx . . $ GDK_GL_API_GLES.) |
| 417 | { |
| 418 | if (gsk_gl_device_has_gl_featurecxx . . $ gsk_gl_device_has_gl_feature(e48f3b071bf1b1d3). (self, GDK_GL_FEATURE_BLEND_FUNC_EXTENDEDcxx . . $ GDK_GL_FEATURE_BLEND_FUNC_EXTENDED.)) |
| 419 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#extension GL_EXT_blend_func_extended : require\n"); |
| 420 | if (gsk_gpu_shader_flags_has_external_texturescxx . . $ gsk_gpu_shader_flags_has_external_textures(4c679297bf94b9eb). (flags)) |
| 421 | { |
| 422 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#extension GL_OES_EGL_image_external_essl3 : require\n"); |
| 423 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#extension GL_OES_EGL_image_external : require\n"); |
| 424 | } |
| 425 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#define GSK_GLES 1\n"); |
| 426 | } |
| 427 | else |
| 428 | { |
| 429 | g_assertcxx . . $ `<external>/15287032793271088244/gtestutils.h:275:9`! (!gsk_gpu_shader_flags_has_external_textures (flags)); |
| 430 | } |
| 431 | |
| 432 | /* work with AMD's compiler, too */ |
| 433 | if (gsk_gpu_shader_flags_has_external_texture0cxx . . $ gsk_gpu_shader_flags_has_external_texture0(4c679297bf94b9eb). (flags)) |
| 434 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#define GSK_TEXTURE0_IS_EXTERNAL 1\n"); |
| 435 | if (gsk_gpu_shader_flags_has_external_texture1cxx . . $ gsk_gpu_shader_flags_has_external_texture1(4c679297bf94b9eb). (flags)) |
| 436 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#define GSK_TEXTURE1_IS_EXTERNAL 1\n"); |
| 437 | |
| 438 | switch (shader_type) |
| 439 | { |
| 440 | case GL_VERTEX_SHADERcxx . . $ `<external>/17235136775614108268/gl_generated.h:4586:9`!: |
| 441 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#define GSK_VERTEX_SHADER 1\n"); |
| 442 | break; |
| 443 | |
| 444 | case GL_FRAGMENT_SHADERcxx . . $ `<external>/17235136775614108268/gl_generated.h:4584:9`!: |
| 445 | g_string_appendcxx . . $ `<external>/2906017559248664336/gstring.h:270:9`! (preamble, "#define GSK_FRAGMENT_SHADER 1\n"); |
| 446 | break; |
| 447 | |
| 448 | default: |
| 449 | g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! (); |
| 450 | return 0; |
| 451 | } |
| 452 | |
| 453 | g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (preamble, "#define GSK_FLAGS %uu\n", flags); |
| 454 | g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (preamble, "#define GSK_COLOR_STATES %uu\n", color_states); |
| 455 | g_string_append_printfcxx . . $ g_string_append_printf(eeccf837eb821d11). (preamble, "#define GSK_VARIATION %uu\n", variation); |
| 456 | |
| 457 | resource_name = g_strconcatcxx . . $ g_strconcat(a849077ff1b8d812). ("/org/gtk/libgsk/shaders/gl/", program_name, ".glsl", NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 458 | bytes = g_resources_lookup_datacxx . . $ g_resources_lookup_data(1e5d2fa68f17580e). (resource_name, 0, error); |
| 459 | g_freecxx . . $ g_free(5d22bdacc48458e8). (resource_name); |
| 460 | if (bytes == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 461 | return 0; |
| 462 | |
| 463 | shader_id = glCreateShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17102:9`! (shader_type); |
| 464 | |
| 465 | glShaderSourcecxx . . $ `<external>/17235136775614108268/gl_generated.h:19042:9`! (shader_id, |
| 466 | 2, |
| 467 | (const char *[]) { |
| 468 | preamble->strcxx . . $ _GString#str., |
| 469 | g_bytes_get_datacxx . . $ g_bytes_get_data(e1c692f77020eb9f). (bytes, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!), |
| 470 | }, |
| 471 | NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 472 | |
| 473 | g_bytes_unrefcxx . . $ g_bytes_unref(8fa06155751f251e). (bytes); |
| 474 | g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (preamble, TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!); |
| 475 | |
| 476 | glCompileShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:16992:9`! (shader_id); |
| 477 | |
| 478 | print_shader_infocxx . . $ print_shader_info(89794384c242646). (shader_type == GL_FRAGMENT_SHADERcxx . . $ `<external>/17235136775614108268/gl_generated.h:4584:9`! ? "fragment" : "vertex", shader_id, program_name); |
| 479 | |
| 480 | if (!gsk_gl_device_check_shader_errorcxx . . $ gsk_gl_device_check_shader_error(a4fe8053069f528d). (program_name, shader_id, error)) |
| 481 | { |
| 482 | glDeleteShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17165:9`! (shader_id); |
| 483 | return 0; |
| 484 | } |
| 485 | |
| 486 | return shader_id; |
| 487 | } |
| 488 | |
| 489 | static GLuintcxx . . $ GLuint# |
| 490 | gsk_gl_device_load_programcxx . . $ gsk_gl_device_load_program(f8a99406feba35e7). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 491 | const GskGpuShaderOpClasscxx . . $ GskGpuShaderOpClass# *op_class, |
| 492 | GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flags, |
| 493 | GskGpuColorStatescxx . . $ GskGpuColorStates# color_states, |
| 494 | guint32cxx . . $ guint32# variation, |
| 495 | GErrorcxx . . $ GError# **error) |
| 496 | { |
| 497 | G_GNUC_UNUSEDcxx . . $ `<external>/12741050725406041920/gmacros.h:647:9`! gint64cxx . . $ gint64# begin_time = GDK_PROFILER_CURRENT_TIMEcxx . . $ `gdk/gdkprofilerprivate.h:39:9`!; |
| 498 | GLuintcxx . . $ GLuint# vertex_shader_id, fragment_shader_id, program_id; |
| 499 | GLintcxx . . $ GLint# link_status; |
| 500 | |
| 501 | vertex_shader_id = gsk_gl_device_load_shadercxx . . $ gsk_gl_device_load_shader(531aa3fea193a4b5). (self, op_class->shader_namecxx . . $ _GskGpuShaderOpClass#shader_name., GL_VERTEX_SHADERcxx . . $ `<external>/17235136775614108268/gl_generated.h:4586:9`!, flags, color_states, variation, error); |
| 502 | if (vertex_shader_id == 0) |
| 503 | return 0; |
| 504 | |
| 505 | fragment_shader_id = gsk_gl_device_load_shadercxx . . $ gsk_gl_device_load_shader(531aa3fea193a4b5). (self, op_class->shader_namecxx . . $ _GskGpuShaderOpClass#shader_name., GL_FRAGMENT_SHADERcxx . . $ `<external>/17235136775614108268/gl_generated.h:4584:9`!, flags, color_states, variation, error); |
| 506 | if (fragment_shader_id == 0) |
| 507 | return 0; |
| 508 | |
| 509 | program_id = glCreateProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:17095:9`! (); |
| 510 | |
| 511 | glAttachShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:16705:9`! (program_id, vertex_shader_id); |
| 512 | glAttachShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:16705:9`! (program_id, fragment_shader_id); |
| 513 | |
| 514 | op_class->setup_attrib_locationscxx . . $ _GskGpuShaderOpClass#setup_attrib_locations. (program_id); |
| 515 | |
| 516 | glLinkProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:18157:9`! (program_id); |
| 517 | |
| 518 | glGetProgramivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17803:9`! (program_id, GL_LINK_STATUScxx . . $ `<external>/17235136775614108268/gl_generated.h:4667:9`!, &link_status); |
| 519 | |
| 520 | glDetachShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17194:9`! (program_id, vertex_shader_id); |
| 521 | glDeleteShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17165:9`! (vertex_shader_id); |
| 522 | glDetachShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17194:9`! (program_id, fragment_shader_id); |
| 523 | glDeleteShadercxx . . $ `<external>/17235136775614108268/gl_generated.h:17165:9`! (fragment_shader_id); |
| 524 | |
| 525 | if (link_status == GL_FALSEcxx . . $ `<external>/17235136775614108268/gl_generated.h:961:9`!) |
| 526 | { |
| 527 | char *buffer = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 528 | int log_len = 0; |
| 529 | |
| 530 | glGetProgramivcxx . . $ `<external>/17235136775614108268/gl_generated.h:17803:9`! (program_id, GL_INFO_LOG_LENGTHcxx . . $ `<external>/17235136775614108268/gl_generated.h:4671:9`!, &log_len); |
| 531 | |
| 532 | if (log_len > 0) |
| 533 | { |
| 534 | /* log_len includes NULL */ |
| 535 | buffer = g_malloc0cxx . . $ g_malloc0(bfcfa4d6b7f7ef64). (log_len); |
| 536 | glGetProgramInfoLogcxx . . $ `<external>/17235136775614108268/gl_generated.h:17778:9`! (program_id, log_len, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!, buffer); |
| 537 | } |
| 538 | |
| 539 | g_set_errorcxx . . $ g_set_error(ca0c191bc68fc328). (error, |
| 540 | GDK_GL_ERRORcxx . . $ `gdk/gdkglcontext.h:35:9`!, |
| 541 | GDK_GL_ERROR_LINK_FAILEDcxx . . $ GDK_GL_ERROR_LINK_FAILED., |
| 542 | "Linking failure in shader: %s", |
| 543 | buffer ? buffer : ""); |
| 544 | |
| 545 | g_freecxx . . $ g_free(5d22bdacc48458e8). (buffer); |
| 546 | |
| 547 | glDeleteProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:17151:9`! (program_id); |
| 548 | |
| 549 | return 0; |
| 550 | } |
| 551 | |
| 552 | gdk_profiler_end_markfcxx . . $ `gdk/gdkprofilerprivate.h:80:9`! (begin_time, |
| 553 | "Compile Program", |
| 554 | "name=%s id=%u frag=%u vert=%u", |
| 555 | op_class->shader_name, program_id, fragment_shader_id, vertex_shader_id); |
| 556 | |
| 557 | return program_id; |
| 558 | } |
| 559 | |
| 560 | void |
| 561 | gsk_gl_device_use_programcxx . . $ gsk_gl_device_use_program(2c3426ae9bdb581d). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 562 | const GskGpuShaderOpClasscxx . . $ GskGpuShaderOpClass# *op_class, |
| 563 | GskGpuShaderFlagscxx . . $ GskGpuShaderFlags# flags, |
| 564 | GskGpuColorStatescxx . . $ GskGpuColorStates# color_states, |
| 565 | guint32cxx . . $ guint32# variation) |
| 566 | { |
| 567 | GErrorcxx . . $ GError# *error = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 568 | GLuintcxx . . $ GLuint# program_id; |
| 569 | GLProgramKeycxx . . $ GLProgramKey# key = { |
| 570 | .op_class = op_class, |
| 571 | .flags = flags, |
| 572 | .color_states = color_states, |
| 573 | .variation = variation, |
| 574 | }; |
| 575 | |
| 576 | program_id = GPOINTER_TO_UINTcxx . . $ `<external>/10505296616216143549/glibconfig.h:104:9`! (g_hash_table_lookup (self->gl_programs, &key)); |
| 577 | if (program_id) |
| 578 | { |
| 579 | glUseProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:19476:9`! (program_id); |
| 580 | return; |
| 581 | } |
| 582 | |
| 583 | program_id = gsk_gl_device_load_programcxx . . $ gsk_gl_device_load_program(f8a99406feba35e7). (self, op_class, flags, color_states, variation, &error); |
| 584 | if (program_id == 0) |
| 585 | { |
| 586 | g_criticalcxx . . $ `<external>/5169755362661750954/gmessages.h:337:9`! ("Failed to load shader program: %s", error->message); |
| 587 | g_clear_errorcxx . . $ g_clear_error(19f343512d040fc2). (&error); |
| 588 | return; |
| 589 | } |
| 590 | |
| 591 | g_hash_table_insertcxx . . $ g_hash_table_insert(6a7c46015dd5ef26). (self->gl_programscxx . . $ _GskGLDevice#gl_programs., g_memdup2cxx . . $ g_memdup2(7ca5e6a2fd1baf31). (&key, sizeof (GLProgramKeycxx . . $ GLProgramKey#)), GUINT_TO_POINTERcxx . . $ `<external>/10505296616216143549/glibconfig.h:107:9`! (program_id)); |
| 592 | |
| 593 | glUseProgramcxx . . $ `<external>/17235136775614108268/gl_generated.h:19476:9`! (program_id); |
| 594 | |
| 595 | /* space by 3 because external textures may need 3 texture units */ |
| 596 | if (op_class->n_texturescxx . . $ _GskGpuShaderOpClass#n_textures. >= 1) |
| 597 | { |
| 598 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE0"), 0); |
| 599 | if (!gsk_gpu_shader_flags_has_external_texture0cxx . . $ gsk_gpu_shader_flags_has_external_texture0(4c679297bf94b9eb). (flags)) |
| 600 | { |
| 601 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE0_1"), 1); |
| 602 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE0_2"), 2); |
| 603 | } |
| 604 | } |
| 605 | if (op_class->n_texturescxx . . $ _GskGpuShaderOpClass#n_textures. >= 2) |
| 606 | { |
| 607 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE1"), 3); |
| 608 | if (!gsk_gpu_shader_flags_has_external_texture1cxx . . $ gsk_gpu_shader_flags_has_external_texture1(4c679297bf94b9eb). (flags)) |
| 609 | { |
| 610 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE1_1"), 4); |
| 611 | glUniform1icxx . . $ `<external>/17235136775614108268/gl_generated.h:19346:9`! (glGetUniformLocationcxx . . $ `<external>/17235136775614108268/gl_generated.h:17913:9`! (program_id, "GSK_TEXTURE1_2"), 5); |
| 612 | } |
| 613 | } |
| 614 | } |
| 615 | |
| 616 | GLuintcxx . . $ GLuint# |
| 617 | gsk_gl_device_get_sampler_idcxx . . $ gsk_gl_device_get_sampler_id(9897b0e1b144a767). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 618 | GskGpuSamplercxx . . $ GskGpuSampler# sampler) |
| 619 | { |
| 620 | g_return_val_if_failcxx . . $ `<external>/5169755362661750954/gmessages.h:665:9`! (sampler < G_N_ELEMENTScxx . . $ `<external>/12741050725406041920/gmacros.h:993:9`! (self->sampler_ids), 0); |
| 621 | |
| 622 | return self->sampler_idscxx . . $ _GskGLDevice#sampler_ids.[sampler]; |
| 623 | } |
| 624 | |
| 625 | static gbooleancxx . . $ gboolean# |
| 626 | gsk_gl_device_get_format_flagscxx . . $ gsk_gl_device_get_format_flags(d489df95c7f3620a). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 627 | GdkGLContextcxx . . $ GdkGLContext# *context, |
| 628 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# format, |
| 629 | GdkSwizzlecxx . . $ GdkSwizzle# swizzle, |
| 630 | GskGpuImageFlagscxx . . $ GskGpuImageFlags# *out_flags) |
| 631 | { |
| 632 | GdkGLMemoryFlagscxx . . $ GdkGLMemoryFlags# gl_flags; |
| 633 | |
| 634 | *out_flags = 0; |
| 635 | |
| 636 | gl_flags = gdk_gl_context_get_format_flagscxx . . $ gdk_gl_context_get_format_flags(89f6198f510283c0). (context, format); |
| 637 | |
| 638 | if (!(gl_flags & GDK_GL_FORMAT_USABLEcxx . . $ GDK_GL_FORMAT_USABLE.)) |
| 639 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 640 | |
| 641 | if (gdk_shader_op_get_n_shaderscxx . . $ gdk_shader_op_get_n_shaders(67b74ccb46f51491). (gdk_memory_format_get_default_shader_opcxx . . $ gdk_memory_format_get_default_shader_op(5326846c0929fc0c). (format)) <= 1) |
| 642 | *out_flags |= GSK_GPU_IMAGE_DOWNLOADABLEcxx . . $ GSK_GPU_IMAGE_DOWNLOADABLE.; |
| 643 | |
| 644 | if ((gl_flags & GDK_GL_FORMAT_RENDERABLEcxx . . $ GDK_GL_FORMAT_RENDERABLE.) && gdk_swizzle_is_framebuffer_compatiblecxx . . $ gdk_swizzle_is_framebuffer_compatible(4c679297bf94b9eb). (swizzle)) |
| 645 | *out_flags |= GSK_GPU_IMAGE_RENDERABLEcxx . . $ GSK_GPU_IMAGE_RENDERABLE.; |
| 646 | if (gl_flags & GDK_GL_FORMAT_FILTERABLEcxx . . $ GDK_GL_FORMAT_FILTERABLE.) |
| 647 | *out_flags |= GSK_GPU_IMAGE_FILTERABLEcxx . . $ GSK_GPU_IMAGE_FILTERABLE.; |
| 648 | if ((gl_flags & (GDK_GL_FORMAT_RENDERABLEcxx . . $ GDK_GL_FORMAT_RENDERABLE. | GDK_GL_FORMAT_FILTERABLEcxx . . $ GDK_GL_FORMAT_FILTERABLE.)) == (GDK_GL_FORMAT_RENDERABLEcxx . . $ GDK_GL_FORMAT_RENDERABLE. | GDK_GL_FORMAT_FILTERABLEcxx . . $ GDK_GL_FORMAT_FILTERABLE.)) |
| 649 | { |
| 650 | *out_flags |= GSK_GPU_IMAGE_CAN_MIPMAPcxx . . $ GSK_GPU_IMAGE_CAN_MIPMAP.; |
| 651 | if (gdk_swizzle_is_identitycxx . . $ gdk_swizzle_is_identity(4c679297bf94b9eb). (swizzle)) |
| 652 | *out_flags |= GSK_GPU_IMAGE_BLITcxx . . $ GSK_GPU_IMAGE_BLIT.; |
| 653 | } |
| 654 | |
| 655 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 656 | } |
| 657 | |
| 658 | void |
| 659 | gsk_gl_device_find_gl_formatcxx . . $ gsk_gl_device_find_gl_format(eb390832d4536104). (GskGLDevicecxx . . $ GskGLDevice# *self, |
| 660 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# format, |
| 661 | GskGpuImageFlagscxx . . $ GskGpuImageFlags# required_flags, |
| 662 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# *out_format, |
| 663 | GskGpuImageFlagscxx . . $ GskGpuImageFlags# *out_flags, |
| 664 | GLintcxx . . $ GLint# *out_gl_internal_format, |
| 665 | GLintcxx . . $ GLint# *out_gl_internal_srgb_format, |
| 666 | GLenumcxx . . $ GLenum# *out_gl_format, |
| 667 | GLenumcxx . . $ GLenum# *out_gl_type, |
| 668 | GdkSwizzlecxx . . $ GdkSwizzle# *out_swizzle) |
| 669 | { |
| 670 | GdkGLContextcxx . . $ GdkGLContext# *context = gdk_gl_context_get_currentcxx . . $ gdk_gl_context_get_current(2947070f1144fb24). (); |
| 671 | GskGpuImageFlagscxx . . $ GskGpuImageFlags# flags; |
| 672 | GdkMemoryFormatcxx . . $ GdkMemoryFormat# alt_format; |
| 673 | const GdkMemoryFormatcxx . . $ GdkMemoryFormat# *fallbacks; |
| 674 | gsizecxx . . $ gsize# i; |
| 675 | GdkSwizzlecxx . . $ GdkSwizzle# swizzle; |
| 676 | |
| 677 | /* First, try the actual format */ |
| 678 | if (gdk_memory_format_gl_formatcxx . . $ gdk_memory_format_gl_format(318ef7e02fc0fff7). (format, |
| 679 | 0, |
| 680 | gdk_gl_context_get_use_escxx . . $ gdk_gl_context_get_use_es(1e0c129a50965ec2). (context), |
| 681 | out_gl_internal_format, |
| 682 | out_gl_internal_srgb_format, |
| 683 | out_gl_format, |
| 684 | out_gl_type, |
| 685 | out_swizzle) && |
| 686 | gsk_gl_device_get_format_flagscxx . . $ gsk_gl_device_get_format_flags(d489df95c7f3620a). (self, context, format, *out_swizzle, &flags) && |
| 687 | ((flags & required_flags) == required_flags)) |
| 688 | { |
| 689 | *out_format = format; |
| 690 | *out_flags = flags; |
| 691 | return; |
| 692 | } |
| 693 | |
| 694 | /* Second, try the potential RGBA format */ |
| 695 | if (gdk_memory_format_get_rgba_formatcxx . . $ gdk_memory_format_get_rgba_format(55025bd1e5f58516). (format, |
| 696 | &alt_format, |
| 697 | &swizzle) && |
| 698 | gdk_memory_format_gl_formatcxx . . $ gdk_memory_format_gl_format(318ef7e02fc0fff7). (alt_format, |
| 699 | 0, |
| 700 | gdk_gl_context_get_use_escxx . . $ gdk_gl_context_get_use_es(1e0c129a50965ec2). (context), |
| 701 | out_gl_internal_format, |
| 702 | out_gl_internal_srgb_format, |
| 703 | out_gl_format, |
| 704 | out_gl_type, |
| 705 | out_swizzle)) |
| 706 | { |
| 707 | *out_swizzle = swizzle; |
| 708 | if (gsk_gl_device_get_format_flagscxx . . $ gsk_gl_device_get_format_flags(d489df95c7f3620a). (self, context, alt_format, *out_swizzle, &flags) && |
| 709 | ((flags & required_flags) == required_flags)) |
| 710 | { |
| 711 | *out_format = format; |
| 712 | *out_flags = flags; |
| 713 | return; |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | /* Next, try the fallbacks */ |
| 718 | fallbacks = gdk_memory_format_get_fallbackscxx . . $ gdk_memory_format_get_fallbacks(88fc4d54335d67b1). (format); |
| 719 | for (i = 0; fallbacks[i] != -1; i++) |
| 720 | { |
| 721 | if (gdk_memory_format_gl_formatcxx . . $ gdk_memory_format_gl_format(318ef7e02fc0fff7). (fallbacks[i], |
| 722 | 0, |
| 723 | gdk_gl_context_get_use_escxx . . $ gdk_gl_context_get_use_es(1e0c129a50965ec2). (context), |
| 724 | out_gl_internal_format, |
| 725 | out_gl_internal_srgb_format, |
| 726 | out_gl_format, |
| 727 | out_gl_type, |
| 728 | out_swizzle) && |
| 729 | gsk_gl_device_get_format_flagscxx . . $ gsk_gl_device_get_format_flags(d489df95c7f3620a). (self, context, fallbacks[i], *out_swizzle, &flags) && |
| 730 | ((flags & required_flags) == required_flags)) |
| 731 | { |
| 732 | *out_format = fallbacks[i]; |
| 733 | *out_flags = flags; |
| 734 | return; |
| 735 | } |
| 736 | } |
| 737 | |
| 738 | /* fallbacks will always fallback to a supported format */ |
| 739 | g_assert_not_reachedcxx . . $ `<external>/15287032793271088244/gtestutils.h:274:9`! (); |
| 740 | } |
| 741 |