summaryrefslogtreecommitdiff
path: root/glamor
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-01-20 12:33:25 -0800
committerEric Anholt <eric@anholt.net>2016-01-26 12:03:49 -0800
commit5042b0652b9fe5fed57a233880c3429ba390d86d (patch)
treedc260f1cf155550711957bf755d47082f1164852 /glamor
parent1fd82c764d5b24107e60f2173e30e5d24a2f2667 (diff)
glamor: Drop duplicated GLAMOR_DEFAULT_PRECISIONs in render accel.
We only need it once at the top of the shader, so just put it there. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'glamor')
-rw-r--r--glamor/glamor_render.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index e563e4099..4e66f6d7e 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -72,7 +72,6 @@ glamor_create_composite_fs(struct shader_key *key)
"uniform int source_repeat_mode;\n"
"uniform int mask_repeat_mode;\n";
const char *relocate_texture =
- GLAMOR_DEFAULT_PRECISION
"vec2 rel_tex_coord(vec2 texture, vec4 wh, int repeat) \n"
"{\n"
" vec2 rel_tex; \n"
@@ -119,14 +118,12 @@ glamor_create_composite_fs(struct shader_key *key)
"}\n";
const char *source_solid_fetch =
- GLAMOR_DEFAULT_PRECISION
"uniform vec4 source;\n"
"vec4 get_source()\n"
"{\n"
" return source;\n"
"}\n";
const char *source_alpha_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 source_texture;\n"
"uniform sampler2D source_sampler;\n"
"uniform vec4 source_wh;"
@@ -139,7 +136,6 @@ glamor_create_composite_fs(struct shader_key *key)
" source_wh, source_repeat_mode, 0);\n"
"}\n";
const char *source_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 source_texture;\n"
"uniform sampler2D source_sampler;\n"
"uniform vec4 source_wh;\n"
@@ -152,14 +148,12 @@ glamor_create_composite_fs(struct shader_key *key)
" source_wh, source_repeat_mode, 1);\n"
"}\n";
const char *mask_solid_fetch =
- GLAMOR_DEFAULT_PRECISION
"uniform vec4 mask;\n"
"vec4 get_mask()\n"
"{\n"
" return mask;\n"
"}\n";
const char *mask_alpha_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 mask_texture;\n"
"uniform sampler2D mask_sampler;\n"
"uniform vec4 mask_wh;\n"
@@ -172,7 +166,6 @@ glamor_create_composite_fs(struct shader_key *key)
" mask_wh, mask_repeat_mode, 0);\n"
"}\n";
const char *mask_pixmap_fetch =
- GLAMOR_DEFAULT_PRECISION
"varying vec2 mask_texture;\n"
"uniform sampler2D mask_sampler;\n"
"uniform vec4 mask_wh;\n"
@@ -185,31 +178,26 @@ glamor_create_composite_fs(struct shader_key *key)
" mask_wh, mask_repeat_mode, 1);\n"
"}\n";
const char *in_source_only =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
" gl_FragColor = get_source();\n"
"}\n";
const char *in_normal =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
" gl_FragColor = get_source() * get_mask().a;\n"
"}\n";
const char *in_ca_source =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
" gl_FragColor = get_source() * get_mask();\n"
"}\n";
const char *in_ca_alpha =
- GLAMOR_DEFAULT_PRECISION
"void main()\n"
"{\n"
" gl_FragColor = get_source().a * get_mask();\n"
"}\n";
const char *in_ca_dual_blend =
- GLAMOR_DEFAULT_PRECISION
"out vec4 color0;\n"
"out vec4 color1;\n"
"void main()\n"
@@ -280,7 +268,10 @@ glamor_create_composite_fs(struct shader_key *key)
FatalError("Bad composite IN type");
}
- XNFasprintf(&source, "%s%s%s%s%s%s%s", header, repeat_define, relocate_texture,
+ XNFasprintf(&source,
+ "%s"
+ GLAMOR_DEFAULT_PRECISION
+ "%s%s%s%s%s%s", header, repeat_define, relocate_texture,
rel_sampler, source_fetch, mask_fetch, in);
prog = glamor_compile_glsl_prog(GL_FRAGMENT_SHADER, source);