xserver: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Sep 20 03:01:55 UTC 2023
glamor/glamor_glyphblt.c | 1 +
glamor/glamor_points.c | 3 ++-
glamor/glamor_priv.h | 5 +++++
3 files changed, 8 insertions(+), 1 deletion(-)
New commits:
commit f273c960c15cf1eaaaccf9c00ed93f5ac75c9397
Author: Konstantin <ria.freelander at gmail.com>
Date: Tue Jul 19 11:22:30 2022 +0300
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 at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Konstantin <ria.freelander at gmail.com>
diff --git a/glamor/glamor_glyphblt.c b/glamor/glamor_glyphblt.c
index 808e9066b..ddc02656d 100644
--- a/glamor/glamor_glyphblt.c
+++ b/glamor/glamor_glyphblt.c
@@ -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)),
};
diff --git a/glamor/glamor_points.c b/glamor/glamor_points.c
index 8f0e4b1da..d6d6784f7 100644
--- a/glamor/glamor_points.c
+++ b/glamor/glamor_points.c
@@ -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
diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index 71aaeb8c2..ea27abdd5 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -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"
More information about the xorg-commit
mailing list