glamor: Mark a bunch of single-file data static.
This gives the compiler a chance to optimize when the data is never changed -- for example, with pict_format_combine_tab, the compiler ends up inlining the 24 bytes of data into just 10 more bytes of code. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
3fe6731b17
commit
7b6edb5243
|
@ -283,7 +283,7 @@ glamor_init_finish_access_shaders(ScreenPtr screen)
|
|||
glUniform1i(glamor_priv->finish_access_swap_rb[1], 0);
|
||||
}
|
||||
|
||||
GCOps glamor_gc_ops = {
|
||||
static GCOps glamor_gc_ops = {
|
||||
.FillSpans = glamor_fill_spans,
|
||||
.SetSpans = glamor_set_spans,
|
||||
.PutImage = glamor_put_image,
|
||||
|
|
|
@ -499,7 +499,7 @@ use_source_solid(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
const glamor_facet glamor_source_solid = {
|
||||
static const glamor_facet glamor_source_solid = {
|
||||
.name = "render_solid",
|
||||
.fs_exec = " vec4 source = fg;\n",
|
||||
.locations = glamor_program_location_fg,
|
||||
|
@ -517,7 +517,7 @@ use_source_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *pro
|
|||
prog->fill_size_inv_uniform);
|
||||
}
|
||||
|
||||
const glamor_facet glamor_source_picture = {
|
||||
static const glamor_facet glamor_source_picture = {
|
||||
.name = "render_picture",
|
||||
.vs_exec = " fill_pos = (fill_offset + primitive.xy + pos) * fill_size_inv;\n",
|
||||
.fs_exec = " vec4 source = texture2D(sampler, fill_pos);\n",
|
||||
|
@ -533,14 +533,14 @@ use_source_1x1_picture(CARD8 op, PicturePtr src, PicturePtr dst, glamor_program
|
|||
return glamor_set_texture_pixmap((PixmapPtr) src->pDrawable);
|
||||
}
|
||||
|
||||
const glamor_facet glamor_source_1x1_picture = {
|
||||
static const glamor_facet glamor_source_1x1_picture = {
|
||||
.name = "render_picture",
|
||||
.fs_exec = " vec4 source = texture2D(sampler, vec2(0.5));\n",
|
||||
.locations = glamor_program_location_fillsamp,
|
||||
.use_render = use_source_1x1_picture,
|
||||
};
|
||||
|
||||
const glamor_facet *glamor_facet_source[glamor_program_source_count] = {
|
||||
static const glamor_facet *glamor_facet_source[glamor_program_source_count] = {
|
||||
[glamor_program_source_solid] = &glamor_source_solid,
|
||||
[glamor_program_source_picture] = &glamor_source_picture,
|
||||
[glamor_program_source_1x1_picture] = &glamor_source_1x1_picture,
|
||||
|
|
|
@ -660,7 +660,7 @@ glamor_flush_composite_rects(ScreenPtr screen)
|
|||
glamor_glDrawArrays_GL_QUADS(glamor_priv, glamor_priv->render_nr_quads);
|
||||
}
|
||||
|
||||
int pict_format_combine_tab[][3] = {
|
||||
static const int pict_format_combine_tab[][3] = {
|
||||
{PICT_TYPE_ARGB, PICT_TYPE_A, PICT_TYPE_ARGB},
|
||||
{PICT_TYPE_ABGR, PICT_TYPE_A, PICT_TYPE_ABGR},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user