[gtk/ngl-clip-classification] ngl: Add infrastructure for clip-variants of shaders
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/ngl-clip-classification] ngl: Add infrastructure for clip-variants of shaders
- Date: Sun, 7 Mar 2021 22:52:42 +0000 (UTC)
commit 78ba120ac0228d82bb40389b5ac85157916f47f4
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 7 17:50:19 2021 -0500
ngl: Add infrastructure for clip-variants of shaders
Make ngl compile each shader three times.
Once with
once with
and once as before.
gsk/ngl/gsknglcompiler.c | 9 +++--
gsk/ngl/gsknglcompilerprivate.h | 1 +
gsk/ngl/gskngldriver.c | 15 +++++---
gsk/ngl/gskngldriverprivate.h | 5 ++-
gsk/ngl/gsknglrenderjob.c | 78 +++++++++++++++++++++++------------------
5 files changed, 65 insertions(+), 43 deletions(-)
---
diff --git a/gsk/ngl/gsknglcompiler.c b/gsk/ngl/gsknglcompiler.c
index 23ebdeee7e..8b1791f130 100644
--- a/gsk/ngl/gsknglcompiler.c
+++ b/gsk/ngl/gsknglcompiler.c
@@ -523,6 +523,7 @@ get_shader_string (GBytes *bytes)
GskNglProgram *
gsk_ngl_compiler_compile (GskNglCompiler *self,
const char *name,
+ const char *clip,
GError **error)
{
char version[32];
@@ -561,9 +562,10 @@ gsk_ngl_compiler_compile (GskNglCompiler *self,
vertex_id = glCreateShader (GL_VERTEX_SHADER);
glShaderSource (vertex_id,
- 9,
+ 10,
(const char *[]) {
version, debug, legacy, gl3, gles,
+ clip,
get_shader_string (self->all_preamble),
get_shader_string (self->vertex_preamble),
get_shader_string (self->vertex_source),
@@ -575,6 +577,7 @@ gsk_ngl_compiler_compile (GskNglCompiler *self,
strlen (legacy),
strlen (gl3),
strlen (gles),
+ strlen (clip),
g_bytes_get_size (self->all_preamble),
g_bytes_get_size (self->vertex_preamble),
g_bytes_get_size (self->vertex_source),
@@ -592,9 +595,10 @@ gsk_ngl_compiler_compile (GskNglCompiler *self,
fragment_id = glCreateShader (GL_FRAGMENT_SHADER);
glShaderSource (fragment_id,
- 9,
+ 10,
(const char *[]) {
version, debug, legacy, gl3, gles,
+ clip,
get_shader_string (self->all_preamble),
get_shader_string (self->fragment_preamble),
get_shader_string (self->fragment_source),
@@ -606,6 +610,7 @@ gsk_ngl_compiler_compile (GskNglCompiler *self,
strlen (legacy),
strlen (gl3),
strlen (gles),
+ strlen (clip),
g_bytes_get_size (self->all_preamble),
g_bytes_get_size (self->fragment_preamble),
g_bytes_get_size (self->fragment_source),
diff --git a/gsk/ngl/gsknglcompilerprivate.h b/gsk/ngl/gsknglcompilerprivate.h
index d61dce2697..a2cfa2fea8 100644
--- a/gsk/ngl/gsknglcompilerprivate.h
+++ b/gsk/ngl/gsknglcompilerprivate.h
@@ -62,6 +62,7 @@ void gsk_ngl_compiler_bind_attribute (GskNglCompiler
void gsk_ngl_compiler_clear_attributes (GskNglCompiler *self);
GskNglProgram *gsk_ngl_compiler_compile (GskNglCompiler *self,
const char *name,
+ const char *clip,
GError **error);
G_END_DECLS
diff --git a/gsk/ngl/gskngldriver.c b/gsk/ngl/gskngldriver.c
index a6720754be..3f81f1c4aa 100644
--- a/gsk/ngl/gskngldriver.c
+++ b/gsk/ngl/gskngldriver.c
@@ -348,7 +348,11 @@ gsk_ngl_driver_load_programs (GskNglDriver *self,
#define GSK_NGL_NO_UNIFORMS
#define GSK_NGL_ADD_UNIFORM(pos, KEY, name) \
gsk_ngl_program_add_uniform (program, #name, UNIFORM_##KEY);
-#define GSK_NGL_DEFINE_PROGRAM(name, resource, uniforms) \
+#define GSK_NGL_DEFINE_PROGRAM(name, resource, uniforms) \
+ GSK_NGL_DEFINE_PROGRAM_CLIP(name ## _no_clip, resource, uniforms, "#define NO_CLIP 1\n"); \
+ GSK_NGL_DEFINE_PROGRAM_CLIP(name ## _rect_clip, resource, uniforms, "#define RECT_CLIP 1\n"); \
+ GSK_NGL_DEFINE_PROGRAM_CLIP(name, resource, uniforms, "");
+#define GSK_NGL_DEFINE_PROGRAM_CLIP(name, resource, uniforms, clip) \
G_STMT_START { \
GskNglProgram *program; \
gboolean have_alpha; \
@@ -356,7 +360,7 @@ gsk_ngl_driver_load_programs (GskNglDriver *self,
\
gsk_ngl_compiler_set_source_from_resource (compiler, GSK_NGL_COMPILER_ALL, resource); \
\
- if (!(program = gsk_ngl_compiler_compile (compiler, #name, error))) \
+ if (!(program = gsk_ngl_compiler_compile (compiler, #name, clip, error))) \
goto failure; \
\
have_alpha = gsk_ngl_program_add_uniform (program, "u_alpha", UNIFORM_SHARED_ALPHA); \
@@ -373,10 +377,11 @@ gsk_ngl_driver_load_programs (GskNglDriver *self,
if (have_alpha) \
gsk_ngl_program_set_uniform1f (program, UNIFORM_SHARED_ALPHA, 0, 1.0f); \
\
- *(GskNglProgram **)(((guint8 *)self) + G_STRUCT_OFFSET (GskNglDriver, name)) = \
- g_steal_pointer (&program); \
+ *(GskNglProgram **)(((guint8 *)self) + G_STRUCT_OFFSET (GskNglDriver, name)) = \
+ g_steal_pointer (&program); \
} G_STMT_END;
# include "gsknglprograms.defs"
+#undef GSK_NGL_DEFINE_PROGRAM_CLIP
#undef GSK_NGL_DEFINE_PROGRAM
#undef GSK_NGL_ADD_UNIFORM
@@ -1038,7 +1043,7 @@ gsk_ngl_driver_lookup_shader (GskNglDriver *self,
gsk_ngl_compiler_bind_attribute (compiler, "aPosition", 0);
gsk_ngl_compiler_bind_attribute (compiler, "aUv", 1);
- if ((program = gsk_ngl_compiler_compile (compiler, NULL, error)))
+ if ((program = gsk_ngl_compiler_compile (compiler, NULL, "", error)))
{
gboolean have_alpha;
diff --git a/gsk/ngl/gskngldriverprivate.h b/gsk/ngl/gskngldriverprivate.h
index e5cda21adc..28199ec016 100644
--- a/gsk/ngl/gskngldriverprivate.h
+++ b/gsk/ngl/gskngldriverprivate.h
@@ -106,7 +106,10 @@ struct _GskNglDriver
#define GSK_NGL_NO_UNIFORMS
#define GSK_NGL_ADD_UNIFORM(pos, KEY, name)
-#define GSK_NGL_DEFINE_PROGRAM(name, resource, uniforms) GskNglProgram *name;
+#define GSK_NGL_DEFINE_PROGRAM(name, resource, uniforms) \
+ GskNglProgram *name ## _no_clip; \
+ GskNglProgram *name ## _rect_clip; \
+ GskNglProgram *name;
# include "gsknglprograms.defs"
#undef GSK_NGL_NO_UNIFORMS
#undef GSK_NGL_ADD_UNIFORM
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 88be386d63..c8d301d0bd 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -1082,6 +1082,13 @@ gsk_ngl_render_job_begin_draw (GskNglRenderJob *job,
job->alpha);
}
+#define CHOOSE_PROGRAM(job,name) \
+ (job->current_clip->is_fully_contained \
+ ? job->driver->name ## _no_clip \
+ : (job->current_clip->is_rectilinear \
+ ? job->driver->name ## _rect_clip \
+ : job->driver->name))
+
static inline void
gsk_ngl_render_job_split_draw (GskNglRenderJob *job)
{
@@ -1123,7 +1130,7 @@ gsk_ngl_render_job_visit_as_fallback (GskNglRenderJob *job,
if (cached_id != 0)
{
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D, GL_TEXTURE0, cached_id);
@@ -1202,7 +1209,7 @@ gsk_ngl_render_job_visit_as_fallback (GskNglRenderJob *job,
gsk_ngl_driver_cache_texture (job->driver, &key, texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1262,7 +1269,7 @@ blur_offscreen (GskNglRenderJob *job,
/* Begin drawing the first horizontal pass, using offscreen as the
* source texture for the program.
*/
- gsk_ngl_render_job_begin_draw (job, job->driver->blur);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blur));
gsk_ngl_program_set_uniform_texture (job->driver->blur,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1286,7 +1293,7 @@ blur_offscreen (GskNglRenderJob *job,
gsk_ngl_command_queue_clear (job->command_queue, 0, &job->viewport);
/* Draw using blur program with first pass as source texture */
- gsk_ngl_render_job_begin_draw (job, job->driver->blur);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blur));
gsk_ngl_program_set_uniform_texture (job->driver->blur,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1375,7 +1382,7 @@ static inline void
gsk_ngl_render_job_visit_color_node (GskNglRenderJob *job,
const GskRenderNode *node)
{
- gsk_ngl_render_job_begin_draw (job, job->driver->color);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color));
gsk_ngl_program_set_uniform_color (job->driver->color,
UNIFORM_COLOR_COLOR, 0,
gsk_color_node_get_color (node));
@@ -1399,7 +1406,7 @@ gsk_ngl_render_job_visit_linear_gradient_node (GskNglRenderJob *job,
g_assert (n_color_stops < MAX_GRADIENT_STOPS);
- gsk_ngl_render_job_begin_draw (job, job->driver->linear_gradient);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, linear_gradient));
gsk_ngl_program_set_uniform1i (job->driver->linear_gradient,
UNIFORM_LINEAR_GRADIENT_NUM_COLOR_STOPS, 0,
n_color_stops);
@@ -1431,7 +1438,7 @@ gsk_ngl_render_job_visit_conic_gradient_node (GskNglRenderJob *job,
g_assert (n_color_stops < MAX_GRADIENT_STOPS);
- gsk_ngl_render_job_begin_draw (job, job->driver->conic_gradient);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, conic_gradient));
gsk_ngl_program_set_uniform1i (job->driver->conic_gradient,
UNIFORM_CONIC_GRADIENT_NUM_COLOR_STOPS, 0,
n_color_stops);
@@ -1466,7 +1473,7 @@ gsk_ngl_render_job_visit_radial_gradient_node (GskNglRenderJob *job,
g_assert (n_color_stops < MAX_GRADIENT_STOPS);
- gsk_ngl_render_job_begin_draw (job, job->driver->radial_gradient);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, radial_gradient));
gsk_ngl_program_set_uniform1i (job->driver->radial_gradient,
UNIFORM_RADIAL_GRADIENT_NUM_COLOR_STOPS, 0,
n_color_stops);
@@ -1538,7 +1545,7 @@ gsk_ngl_render_job_visit_clipped_child (GskNglRenderJob *job,
g_assert (offscreen.texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1636,7 +1643,7 @@ gsk_ngl_render_job_visit_rounded_clip_node (GskNglRenderJob *job,
g_assert (offscreen.texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1689,7 +1696,7 @@ gsk_ngl_render_job_visit_uniform_border_node (GskNglRenderJob *job,
gsk_ngl_render_job_transform_rounded_rect (job, rounded_outline, &outline);
- gsk_ngl_render_job_begin_draw (job, job->driver->inset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, inset_shadow));
gsk_ngl_program_set_uniform_rounded_rect (job->driver->inset_shadow,
UNIFORM_INSET_SHADOW_OUTLINE_RECT, 0,
&outline);
@@ -1834,7 +1841,7 @@ gsk_ngl_render_job_visit_border_node (GskNglRenderJob *job,
if (widths[indices[i]] <= 0)
continue;
- gsk_ngl_render_job_begin_draw (job, job->driver->border);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, border));
gsk_ngl_program_set_uniform4fv (job->driver->border,
UNIFORM_BORDER_COLOR, 0,
1,
@@ -1940,7 +1947,7 @@ gsk_ngl_render_job_visit_transform_node (GskNglRenderJob *job,
*/
gsk_ngl_render_job_push_modelview (job, transform);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -1968,7 +1975,7 @@ gsk_ngl_render_job_visit_unblurred_inset_shadow_node (GskNglRenderJob *job,
gsk_ngl_render_job_transform_rounded_rect (job, outline, &transformed_outline);
- gsk_ngl_render_job_begin_draw (job, job->driver->inset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, inset_shadow));
gsk_ngl_program_set_uniform_rounded_rect (job->driver->inset_shadow,
UNIFORM_INSET_SHADOW_OUTLINE_RECT, 0,
&transformed_outline);
@@ -2071,7 +2078,7 @@ gsk_ngl_render_job_visit_blurred_inset_shadow_node (GskNglRenderJob *job,
gsk_ngl_render_job_transform_rounded_rect (job, &outline_to_blur, &transformed_outline);
/* Actual inset shadow outline drawing */
- gsk_ngl_render_job_begin_draw (job, job->driver->inset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, inset_shadow));
gsk_ngl_program_set_uniform_rounded_rect (job->driver->inset_shadow,
UNIFORM_INSET_SHADOW_OUTLINE_RECT, 0,
&transformed_outline);
@@ -2141,7 +2148,7 @@ gsk_ngl_render_job_visit_blurred_inset_shadow_node (GskNglRenderJob *job,
offscreen.area.x2 = tx2;
offscreen.area.y2 = ty2;
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -2180,7 +2187,7 @@ gsk_ngl_render_job_visit_unblurred_outset_shadow_node (GskNglRenderJob *job,
gsk_ngl_render_job_transform_rounded_rect (job, outline, &transformed_outline);
- gsk_ngl_render_job_begin_draw (job, job->driver->unblurred_outset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, unblurred_outset_shadow));
gsk_ngl_program_set_uniform_rounded_rect (job->driver->unblurred_outset_shadow,
UNIFORM_UNBLURRED_OUTSET_SHADOW_OUTLINE_RECT, 0,
&transformed_outline);
@@ -2336,7 +2343,7 @@ gsk_ngl_render_job_visit_blurred_outset_shadow_node (GskNglRenderJob *job,
gsk_ngl_command_queue_clear (job->command_queue, 0, &job->viewport);
/* Draw the outline using color program */
- gsk_ngl_render_job_begin_draw (job, job->driver->color);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color));
gsk_ngl_program_set_uniform_color (job->driver->color,
UNIFORM_COLOR_COLOR, 0,
&white);
@@ -2382,7 +2389,7 @@ gsk_ngl_render_job_visit_blurred_outset_shadow_node (GskNglRenderJob *job,
offscreen.texture_id = blurred_texture_id;
init_full_texture_region (&offscreen);
- gsk_ngl_render_job_begin_draw (job, job->driver->outset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, outset_shadow));
gsk_ngl_program_set_uniform_color (job->driver->outset_shadow,
UNIFORM_OUTSET_SHADOW_COLOR, 0,
color);
@@ -2405,7 +2412,7 @@ gsk_ngl_render_job_visit_blurred_outset_shadow_node (GskNglRenderJob *job,
return;
}
- gsk_ngl_render_job_begin_draw (job, job->driver->outset_shadow);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, outset_shadow));
gsk_ngl_program_set_uniform_color (job->driver->outset_shadow,
UNIFORM_OUTSET_SHADOW_COLOR, 0,
color);
@@ -2612,7 +2619,7 @@ gsk_ngl_render_job_visit_cross_fade_node (GskNglRenderJob *job,
g_assert (offscreen_end.texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->cross_fade);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, cross_fade));
gsk_ngl_program_set_uniform_texture (job->driver->cross_fade,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -2658,7 +2665,7 @@ gsk_ngl_render_job_visit_opacity_node (GskNglRenderJob *job,
g_assert (offscreen.texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -2691,9 +2698,9 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
float y = offset->y + job->offset_y;
GskNglGlyphLibrary *library = job->driver->glyphs;
GskNglCommandBatch *batch;
- GskNglProgram *program;
int x_position = 0;
GskNglGlyphKey lookup;
+ GskNglProgram *program;
guint last_texture = 0;
GskNglDrawVertex *vertices;
guint used = 0;
@@ -2704,11 +2711,11 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
/* If the font has color glyphs, we don't need to recolor anything */
if (!force_color && gsk_text_node_has_color_glyphs (node))
{
- program = job->driver->blit;
+ program = CHOOSE_PROGRAM (job, blit);
}
else
{
- program = job->driver->coloring;
+ program = CHOOSE_PROGRAM (job, coloring);
gsk_ngl_program_set_uniform_color (program, UNIFORM_COLORING_COLOR, 0, color);
}
@@ -2716,6 +2723,7 @@ gsk_ngl_render_job_visit_text_node (GskNglRenderJob *job,
lookup.scale = (guint) (text_scale * 1024);
gsk_ngl_render_job_begin_draw (job, program);
+
batch = gsk_ngl_command_queue_get_batch (job->command_queue);
vertices = gsk_ngl_command_queue_add_n_vertices (job->command_queue, num_glyphs);
@@ -2900,7 +2908,7 @@ gsk_ngl_render_job_visit_shadow_node (GskNglRenderJob *job,
}
gsk_ngl_render_job_offset (job, dx, dy);
- gsk_ngl_render_job_begin_draw (job, job->driver->coloring);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, coloring));
gsk_ngl_program_set_uniform_texture (job->driver->coloring,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -2954,7 +2962,7 @@ gsk_ngl_render_job_visit_blur_node (GskNglRenderJob *job,
if (cache_texture)
gsk_ngl_driver_cache_texture (job->driver, &key, offscreen.texture_id);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -2993,7 +3001,7 @@ gsk_ngl_render_job_visit_blend_node (GskNglRenderJob *job,
if (!gsk_ngl_render_job_visit_node_with_offscreen (job, top_child, &top_offscreen))
{
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -3006,7 +3014,7 @@ gsk_ngl_render_job_visit_blend_node (GskNglRenderJob *job,
g_assert (top_offscreen.was_offscreen);
- gsk_ngl_render_job_begin_draw (job, job->driver->blend);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blend));
gsk_ngl_program_set_uniform_texture (job->driver->blend,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -3042,7 +3050,7 @@ gsk_ngl_render_job_visit_color_matrix_node (GskNglRenderJob *job,
graphene_vec4_to_float (gsk_color_matrix_node_get_color_offset (node), offset);
- gsk_ngl_render_job_begin_draw (job, job->driver->color_matrix);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color_matrix));
gsk_ngl_program_set_uniform_texture (job->driver->color_matrix,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -3065,7 +3073,7 @@ gsk_ngl_render_job_visit_gl_shader_node_fallback (GskNglRenderJob *job,
{
static const GdkRGBA pink = { 255 / 255., 105 / 255., 180 / 255., 1.0 };
- gsk_ngl_render_job_begin_draw (job, job->driver->color);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, color));
gsk_ngl_program_set_uniform_color (job->driver->color,
UNIFORM_COLOR_COLOR, 0,
&pink);
@@ -3231,7 +3239,7 @@ gsk_ngl_render_job_visit_texture_node (GskNglRenderJob *job,
g_assert (offscreen.texture_id);
g_assert (offscreen.was_offscreen == FALSE);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -3256,7 +3264,7 @@ gsk_ngl_render_job_visit_texture_node (GskNglRenderJob *job,
g_assert (slices != NULL);
g_assert (n_slices > 0);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
for (guint i = 0; i < n_slices; i ++)
{
@@ -3346,7 +3354,7 @@ gsk_ngl_render_job_visit_repeat_node (GskNglRenderJob *job,
if (!gsk_ngl_render_job_visit_node_with_offscreen (job, child, &offscreen))
g_assert_not_reached ();
- gsk_ngl_render_job_begin_draw (job, job->driver->repeat);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, repeat));
gsk_ngl_program_set_uniform_texture (job->driver->repeat,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
@@ -3739,7 +3747,7 @@ gsk_ngl_render_job_render_flipped (GskNglRenderJob *job,
gsk_ngl_render_job_set_alpha (job, 1.0f);
gsk_ngl_command_queue_bind_framebuffer (job->command_queue, job->framebuffer);
gsk_ngl_command_queue_clear (job->command_queue, 0, &job->viewport);
- gsk_ngl_render_job_begin_draw (job, job->driver->blit);
+ gsk_ngl_render_job_begin_draw (job, CHOOSE_PROGRAM (job, blit));
gsk_ngl_program_set_uniform_texture (job->driver->blit,
UNIFORM_SHARED_SOURCE, 0,
GL_TEXTURE_2D,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]