glamor: add gl_PointSize for ES shaders
GLES3.2 spec, page 126: > The variable gl_PointSize is intended for a shader to write > the size of the point to be rasterized. It is measured in pixels. > If gl_PointSize is not written to, its value > is undefined in subsequent pipe stages. If glamor shader is use points, we should define gl_PointSize for GLES. On Desktop GL, it "just work" due to default gl_PointSize is 1. As @anholt requested, define this only for minimal amount of shaders (point and glyphbit ones), to make sure than performance will not affected Reviewed-by: Emma Anholt <emma@anholt.net> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Konstantin <ria.freelander@gmail.com>
This commit is contained in:
parent
baaddf47d5
commit
f273c960c1
|
@ -34,6 +34,7 @@ static const glamor_facet glamor_facet_poly_glyph_blt = {
|
|||
.name = "poly_glyph_blt",
|
||||
.vs_vars = "attribute vec2 primitive;\n",
|
||||
.vs_exec = (" vec2 pos = vec2(0,0);\n"
|
||||
GLAMOR_DEFAULT_POINT_SIZE
|
||||
GLAMOR_POS(gl_Position, primitive)),
|
||||
};
|
||||
|
||||
|
|
|
@ -32,7 +32,8 @@
|
|||
static const glamor_facet glamor_facet_point = {
|
||||
.name = "poly_point",
|
||||
.vs_vars = "attribute vec2 primitive;\n",
|
||||
.vs_exec = GLAMOR_POS(gl_Position, primitive),
|
||||
.vs_exec = (GLAMOR_DEFAULT_POINT_SIZE
|
||||
GLAMOR_POS(gl_Position, primitive)),
|
||||
};
|
||||
|
||||
static Bool
|
||||
|
|
|
@ -49,6 +49,11 @@
|
|||
"precision mediump float;\n" \
|
||||
"#endif\n"
|
||||
|
||||
#define GLAMOR_DEFAULT_POINT_SIZE \
|
||||
"#ifdef GL_ES\n" \
|
||||
" gl_PointSize = 1.0;\n" \
|
||||
"#endif\n"
|
||||
|
||||
#include "glyphstr.h"
|
||||
|
||||
#include "glamor_debug.h"
|
||||
|
|
Loading…
Reference in New Issue