aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-benchmark/glmark2
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-benchmark/glmark2')
-rw-r--r--meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch2
-rw-r--r--meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch12
-rw-r--r--meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch103
-rw-r--r--meta-oe/recipes-benchmark/glmark2/files/0003-fix-precision-handling-bugs.patch138
-rw-r--r--meta-oe/recipes-benchmark/glmark2/glmark2_git.bb18
5 files changed, 120 insertions, 153 deletions
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch b/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
index e9b880c260..9d652e10ad 100644
--- a/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
+++ b/meta-oe/recipes-benchmark/glmark2/files/0001-fix-dispmanx-build.patch
@@ -16,7 +16,7 @@ See:
My contribution is to tweak the wscript to link all the required libraries.
-Upstream-status: submitted [https://github.com/glmark2/glmark2/pull/135]
+Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/135]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
src/native-state-dispmanx.cpp | 22 +++++++++++++++++-----
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch b/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch
index 27bd62edb9..05a074cf55 100644
--- a/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch
+++ b/meta-oe/recipes-benchmark/glmark2/files/0002-run-dispmanx-fullscreen.patch
@@ -6,17 +6,17 @@ Subject: [PATCH] run dispmanx fullscreen
The dispmanx flavour can only run fullscreen, therefore set the size to
fullscreen when glmark2-es2-dispmanx is run.
-Upstream-status: submitted [https://github.com/glmark2/glmark2/pull/135]
+Upstream-Status: Submitted [https://github.com/glmark2/glmark2/pull/135]
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
src/main.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/main.cpp b/src/main.cpp
-index 677962e..273a217 100644
+index d1077fe..d717cd4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
-@@ -164,6 +164,11 @@ main(int argc, char *argv[])
+@@ -202,6 +202,11 @@ main(int argc, char *argv[])
Options::size = std::pair<int,int>(800, 600);
}
@@ -26,5 +26,7 @@ index 677962e..273a217 100644
+#endif
+
// Create the canvas
- #if GLMARK2_USE_X11
- NativeStateX11 native_state;
+ #if GLMARK2_USE_EGL
+ GLStateEGL gl_state;
+--
+2.25.1
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch b/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch
new file mode 100644
index 0000000000..dc47af83e7
--- /dev/null
+++ b/meta-oe/recipes-benchmark/glmark2/files/0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch
@@ -0,0 +1,103 @@
+From b59ec731c8c7e084b289e4ea92938faaebcc389d Mon Sep 17 00:00:00 2001
+From: Alexandros Frantzis <alexandros.frantzis@collabora.com>
+Date: Wed, 1 Nov 2023 13:43:00 +0200
+Subject: [PATCH] GLVisualConfig: By default don't care about the stencil
+ config component
+
+Our benchmarks don't use a stencil buffer, but its presence doesn't hurt
+either, so don't mark configs that have one as unacceptable. Our scoring
+still favors configs without one, unless the user explicitly specifies
+otherwise with --visual-config.
+
+Upstream-Status: Backport [https://github.com/glmark2/glmark2/commit/5f23d540342ba69e12afeb6a1ac4f6fd36747975]
+---
+ doc/glmark2.1.in | 2 +-
+ src/gl-visual-config.cpp | 9 ++++++---
+ src/gl-visual-config.h | 2 +-
+ src/options.cpp | 6 +++---
+ 4 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/doc/glmark2.1.in b/doc/glmark2.1.in
+index 015ba20..1f4a047 100644
+--- a/doc/glmark2.1.in
++++ b/doc/glmark2.1.in
+@@ -38,7 +38,7 @@ Render to an off-screen surface
+ The visual configuration to use for the rendering target:
+ \'id=ID:red=R:green=G:blue=B:alpha=A:buffer=BUF:stencil=STENCIL:samples=SAMPLES'.
+ The parameters may be defined in any order, and any omitted parameters assume a
+-default value of '0' (id, stencil, samples) or '1' (red, green, blue, alpha, buffer).
++default value of '0' (id, samples), -1 (stencil) or '1' (red, green, blue, alpha, buffer).
+ If 'id' is set to a non-zero value, all other parameters are ignored
+ .TP
+ \fB\-\-reuse\-context\fR
+diff --git a/src/gl-visual-config.cpp b/src/gl-visual-config.cpp
+index de92f93..665f53a 100644
+--- a/src/gl-visual-config.cpp
++++ b/src/gl-visual-config.cpp
+@@ -26,7 +26,7 @@
+ #include <vector>
+
+ GLVisualConfig::GLVisualConfig(const std::string &s) :
+- id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1), samples(0)
++ GLVisualConfig()
+ {
+ std::vector<std::string> elems;
+
+@@ -85,7 +85,7 @@ GLVisualConfig::match_score(const GLVisualConfig &target) const
+ score += score_component(blue, target.blue, 4);
+ score += score_component(alpha, target.alpha, 4);
+ score += score_component(depth, target.depth, 1);
+- score += score_component(stencil, target.stencil, 0);
++ score += score_component(stencil, target.stencil, 1);
+ score += score_component(buffer, target.buffer, 1);
+ score += score_component(samples, target.samples, -1);
+
+@@ -135,11 +135,14 @@ GLVisualConfig::score_component(int component, int target, int scale) const
+ * score for all components ranges from [0,MAXIMUM_COMPONENT_SCORE).
+ * If scale > 0, we reward the largest positive difference from target,
+ * otherwise the smallest positive difference from target.
++ * We also reward the smallest positive difference from the target,
++ * if the target < 0, i.e., we don't care about this value.
+ */
+ int diff = std::abs(scale) * (component - target);
+ if (diff > 0)
+ {
+- score = scale < 0 ? MAXIMUM_COMPONENT_SCORE - diff : diff;
++ score = (scale < 0 || target < 0) ?
++ MAXIMUM_COMPONENT_SCORE - diff : diff;
+ score = std::min(MAXIMUM_COMPONENT_SCORE, score);
+ score = std::max(0, score);
+ }
+diff --git a/src/gl-visual-config.h b/src/gl-visual-config.h
+index b28473f..013ce14 100644
+--- a/src/gl-visual-config.h
++++ b/src/gl-visual-config.h
+@@ -31,7 +31,7 @@ class GLVisualConfig
+ {
+ public:
+ GLVisualConfig():
+- id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(0), buffer(1), samples(0) {}
++ id(0), red(1), green(1), blue(1), alpha(1), depth(1), stencil(-1), buffer(1), samples(0) {}
+ GLVisualConfig(const std::string &s);
+
+ /**
+diff --git a/src/options.cpp b/src/options.cpp
+index 8d1ec16..3a31d3d 100644
+--- a/src/options.cpp
++++ b/src/options.cpp
+@@ -213,9 +213,9 @@ Options::print_help()
+ " target: 'id=ID:red=R:green=G:blue=B:alpha=A:buffer=BUF:\n"
+ " stencil=STENCIL:samples=SAMPLES'. The parameters may be\n"
+ " defined in any order, and any omitted parameters assume a\n"
+- " default value of '0' (id, stencil, samples) or '1' (red,\n"
+- " green, blue, alpha, buffer). If 'id' is set to a non-zero\n"
+- " value, all other parameters are ignored\n"
++ " default value of '0' (id, samples), '-1' (stencil) or\n"
++ " '1' (red, green, blue, alpha, buffer). If 'id' is set to\n"
++ " a non-zero value, all other parameters are ignored\n"
+ " --reuse-context Use a single context for all scenes\n"
+ " (by default, each scene gets its own context)\n"
+ " -s, --size WxH Size of the output window (default: 800x600)\n"
+--
+2.44.0
+
diff --git a/meta-oe/recipes-benchmark/glmark2/files/0003-fix-precision-handling-bugs.patch b/meta-oe/recipes-benchmark/glmark2/files/0003-fix-precision-handling-bugs.patch
deleted file mode 100644
index af88f6cd23..0000000000
--- a/meta-oe/recipes-benchmark/glmark2/files/0003-fix-precision-handling-bugs.patch
+++ /dev/null
@@ -1,138 +0,0 @@
-From 90e837ffd1ff5c9add1074d69de23e58a3a4810e Mon Sep 17 00:00:00 2001
-From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-Date: Wed, 11 Nov 2020 09:26:03 -0500
-Subject: [PATCH 1/3] terrain: Fix precision bug in light rendering
-
-Resulting in overly bright rendering when mediump is implemented as
-fp16.
-
-Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
----
- data/shaders/terrain.frag | 5 +++++
- 1 file changed, 5 insertions(+)
-
-diff --git a/data/shaders/terrain.frag b/data/shaders/terrain.frag
-index 84d085c..58f17ea 100644
---- a/data/shaders/terrain.frag
-+++ b/data/shaders/terrain.frag
-@@ -67,7 +67,12 @@ void main() {
- vec3 pointSpecular = vec3( 0.0 );
- for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {
- vec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );
-+#ifdef GL_FRAGMENT_PRECISION_HIGH
-+ // should be highp for correct behaviour if mediump is implemented as fp16
-+ highp vec3 lVector = lPosition.xyz + vViewPosition.xyz;
-+#else
- vec3 lVector = lPosition.xyz + vViewPosition.xyz;
-+#endif
- float lDistance = 1.0;
- if ( pointLightDistance[ i ] > 0.0 )
- lDistance = 1.0 - min( ( length( lVector ) / pointLightDistance[ i ] ), 1.0 );
-
-From 1edd76fda77edabd49d713912aee49b8360c86c3 Mon Sep 17 00:00:00 2001
-From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-Date: Wed, 11 Nov 2020 09:49:52 -0500
-Subject: [PATCH 2/3] terrain: Fix precision handling in noise shader
-
-Another overflow resulting in infinity in mediump. Note this bug is
-masked if the driver clamps infinity to MAX_FLOAT, but it's still our
-bug.
-
-Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
----
- data/shaders/terrain-noise.frag | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/data/shaders/terrain-noise.frag b/data/shaders/terrain-noise.frag
-index 7fea5c0..9535e58 100644
---- a/data/shaders/terrain-noise.frag
-+++ b/data/shaders/terrain-noise.frag
-@@ -17,7 +17,13 @@ uniform float time;
- uniform MEDIUMP vec2 uvScale;
- varying vec2 vUv;
-
-+#ifdef GL_FRAGMENT_PRECISION_HIGH
-+// x should be passed as highp since the intermediate multiplications can
-+// overflow with mediump
-+vec4 permute(highp vec4 x)
-+#else
- vec4 permute(vec4 x)
-+#endif
- {
- return mod(((x * 34.0) + 1.0) * x, 289.0);
- }
-
-From e866cc633ffc450e5358b2742f32ca360e4f3f12 Mon Sep 17 00:00:00 2001
-From: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
-Date: Wed, 11 Nov 2020 09:35:21 -0500
-Subject: [PATCH 3/3] loop,function,conditionals: Fix mediump overflow
-
-The multiplication can produce infinity.
-
-Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
----
- data/shaders/conditionals.frag | 9 ++++++++-
- data/shaders/function.frag | 9 ++++++++-
- data/shaders/loop.frag | 9 ++++++++-
- 3 files changed, 24 insertions(+), 3 deletions(-)
-
-diff --git a/data/shaders/conditionals.frag b/data/shaders/conditionals.frag
-index 3bd2507..e902263 100644
---- a/data/shaders/conditionals.frag
-+++ b/data/shaders/conditionals.frag
-@@ -2,7 +2,14 @@ varying vec4 dummy;
-
- void main(void)
- {
-- float d = fract(gl_FragCoord.x * gl_FragCoord.y * 0.0001);
-+#ifdef GL_FRAGMENT_PRECISION_HIGH
-+ // should be declared highp since the multiplication can overflow in
-+ // mediump, particularly if mediump is implemented as fp16
-+ highp vec2 FragCoord = gl_FragCoord.xy;
-+#else
-+ vec2 FragCoord = gl_FragCoord.xy;
-+#endif
-+ float d = fract(FragCoord.x * FragCoord.y * 0.0001);
-
- $MAIN$
-
-diff --git a/data/shaders/function.frag b/data/shaders/function.frag
-index 3e3c74f..9d0230e 100644
---- a/data/shaders/function.frag
-+++ b/data/shaders/function.frag
-@@ -8,7 +8,14 @@ $PROCESS$
-
- void main(void)
- {
-- float d = fract(gl_FragCoord.x * gl_FragCoord.y * 0.0001);
-+#ifdef GL_FRAGMENT_PRECISION_HIGH
-+ // should be declared highp since the multiplication can overflow in
-+ // mediump, particularly if mediump is implemented as fp16
-+ highp vec2 FragCoord = gl_FragCoord.xy;
-+#else
-+ vec2 FragCoord = gl_FragCoord.xy;
-+#endif
-+ float d = fract(FragCoord.x * FragCoord.y * 0.0001);
-
- $MAIN$
-
-diff --git a/data/shaders/loop.frag b/data/shaders/loop.frag
-index 31ae23e..9a6afd2 100644
---- a/data/shaders/loop.frag
-+++ b/data/shaders/loop.frag
-@@ -3,7 +3,14 @@ uniform int FragmentLoops;
-
- void main(void)
- {
-- float d = fract(gl_FragCoord.x * gl_FragCoord.y * 0.0001);
-+#ifdef GL_FRAGMENT_PRECISION_HIGH
-+ // should be declared highp since the multiplication can overflow in
-+ // mediump, particularly if mediump is implemented as fp16
-+ highp vec2 FragCoord = gl_FragCoord.xy;
-+#else
-+ vec2 FragCoord = gl_FragCoord.xy;
-+#endif
-+ float d = fract(FragCoord.x * FragCoord.y * 0.0001);
-
- $MAIN$
-
diff --git a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
index a5872f4354..0b61d6ed62 100644
--- a/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
+++ b/meta-oe/recipes-benchmark/glmark2/glmark2_git.bb
@@ -4,26 +4,26 @@ It uses only the subset of the OpenGL 2.0 API that is compatible with OpenGL ES
HOMEPAGE = "https://github.com/glmark2/glmark2"
BUGTRACKER = "https://github.com/glmark2/glmark2/issues"
-LICENSE = "GPLv3+ & SGIv1"
+LICENSE = "GPL-3.0-or-later & SGI-1"
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
file://COPYING.SGI;beginline=5;md5=269cdab4af6748677acce51d9aa13552"
DEPENDS = "libpng jpeg udev"
-DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-native', '', d)}"
+DEPENDS:append = " ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland-native wayland-protocols', '', d)}"
-PV = "20201114+${SRCPV}"
+PV = "2023.01"
SRC_URI = " \
- git://github.com/glmark2/glmark2.git;protocol=https \
+ git://github.com/glmark2/glmark2.git;protocol=https;branch=master \
file://0001-fix-dispmanx-build.patch \
file://0002-run-dispmanx-fullscreen.patch \
- file://0003-fix-precision-handling-bugs.patch \
- "
-SRCREV = "784aca755a469b144acf3cae180b6e613b7b057a"
+ file://0003-GLVisualConfig-By-default-don-t-care-about-the-stenc.patch \
+"
+SRCREV = "42e3d8fe3aa88743ef90348138f643f7b04a9237"
S = "${WORKDIR}/git"
-inherit waf pkgconfig features_check
+inherit meson pkgconfig features_check
ANY_OF_DISTRO_FEATURES = "opengl dispmanx"
@@ -59,6 +59,6 @@ python __anonymous() {
if "dispmanx" in packageconfig:
flavors = ["dispmanx-glesv2"]
if flavors:
- d.appendVar("EXTRA_OECONF", " --with-flavors=%s" % ",".join(flavors))
+ d.appendVar("EXTRA_OEMESON", " -Dflavors=%s" % ",".join(flavors))
}