diff options
author | Yash Ladani <yash.ladani@amd.com> | 2023-01-31 22:56:39 -0800 |
---|---|---|
committer | Mark Hatle <mark.hatle@amd.com> | 2023-02-01 15:24:09 -0600 |
commit | 7e984f0a35cee449968f8b1ba8749d99f4347a89 (patch) | |
tree | 68617f636c1f2c4ee996e899c292cc281c219b8d /meta-xilinx-core/dynamic-layers | |
parent | 1c497798af808b6a461a345657d39d3fecd196c4 (diff) | |
download | meta-xilinx-7e984f0a35cee449968f8b1ba8749d99f4347a89.tar.gz |
glmark2: Added patch to resolve runtime errors for glmark2-es2
This patch resolves the macro redefination and
precision differ error in glmark2-es2 application.
Signed-off-by: Yash Ladani <yash.ladani@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/dynamic-layers')
2 files changed, 62 insertions, 0 deletions
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/files/0001-Resolve-macro-redefination-and-presion-differ-error.patch b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/files/0001-Resolve-macro-redefination-and-presion-differ-error.patch new file mode 100644 index 00000000..fbcc9f4a --- /dev/null +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/files/0001-Resolve-macro-redefination-and-presion-differ-error.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From e27d75a274d038b94c908b3ade844301794b5920 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yash Ladani <yash.ladani@amd.com> | ||
3 | Date: Tue, 31 Jan 2023 01:55:03 -0800 | ||
4 | Subject: [PATCH] Resolve macro redefination and presion differ error | ||
5 | |||
6 | While running glmark2-es2 facing macro redefination error | ||
7 | Error: 0:24: P0001: Macro 'HIGHP_OR_DEFAULT' redefined | ||
8 | When glmark is compiling the fragment shaders macro | ||
9 | HIGHP_OR_DEFAULT is being redefined. | ||
10 | Added the guard(#if !defined(HIGHP_OR_DEFAULT)) to avoid | ||
11 | this sceneario. | ||
12 | |||
13 | We are also getting the precision differ error as same | ||
14 | uCurrentTime variable is defined in both fragment and | ||
15 | vertex shader and they both have different precision. | ||
16 | Error: Failed to link program created from files None and None: | ||
17 | L0010 Uniform 'uCurrentTime' differ on precision | ||
18 | Added highp in jellyfish fragment shader file to avoid this. | ||
19 | |||
20 | Signed-off-by: Yash Ladani <yash.ladani@amd.com> | ||
21 | --- | ||
22 | data/shaders/jellyfish.frag | 4 ++++ | ||
23 | src/libmatrix/shader-source.cc | 3 +++ | ||
24 | 2 files changed, 7 insertions(+) | ||
25 | |||
26 | diff --git a/data/shaders/jellyfish.frag b/data/shaders/jellyfish.frag | ||
27 | index c10477a..3431f22 100644 | ||
28 | --- a/data/shaders/jellyfish.frag | ||
29 | +++ b/data/shaders/jellyfish.frag | ||
30 | @@ -1,3 +1,7 @@ | ||
31 | +#ifdef GL_ES | ||
32 | +precision highp float; | ||
33 | +#endif | ||
34 | + | ||
35 | uniform sampler2D uSampler; | ||
36 | uniform sampler2D uSampler1; | ||
37 | uniform float uCurrentTime; | ||
38 | diff --git a/src/libmatrix/shader-source.cc b/src/libmatrix/shader-source.cc | ||
39 | index 659832e..4d13500 100644 | ||
40 | --- a/src/libmatrix/shader-source.cc | ||
41 | +++ b/src/libmatrix/shader-source.cc | ||
42 | @@ -490,6 +490,8 @@ ShaderSource::str() | ||
43 | /* Create the precision statements */ | ||
44 | std::stringstream precision_macros_ss; | ||
45 | |||
46 | + precision_macros_ss << "#if !defined(HIGHP_OR_DEFAULT)"; | ||
47 | + precision_macros_ss << std::endl; | ||
48 | precision_macros_ss << "#if defined(GL_ES)"; | ||
49 | if (type_ == ShaderSource::ShaderTypeFragment) | ||
50 | precision_macros_ss << " && defined(GL_FRAGMENT_PRECISION_HIGH)"; | ||
51 | @@ -498,6 +500,7 @@ ShaderSource::str() | ||
52 | precision_macros_ss << "#else" << std::endl; | ||
53 | precision_macros_ss << "#define HIGHP_OR_DEFAULT" << std::endl; | ||
54 | precision_macros_ss << "#endif" << std::endl; | ||
55 | + precision_macros_ss << "#endif" << std::endl; | ||
56 | precision_macros_ss << "#if defined(GL_ES)" << std::endl; | ||
57 | precision_macros_ss << "#define MEDIUMP_OR_DEFAULT mediump" << std::endl; | ||
58 | precision_macros_ss << "#else" << std::endl; | ||
59 | -- | ||
60 | 2.34.1 | ||
61 | |||
diff --git a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend index f47178a6..fb36c842 100644 --- a/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend +++ b/meta-xilinx-core/dynamic-layers/openembedded-layer/recipes-benchmark/glmark2/glmark2_%.bbappend | |||
@@ -3,6 +3,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" | |||
3 | SRC_URI:append = " \ | 3 | SRC_URI:append = " \ |
4 | file://0002-native-state-fbdev-Add-support-for-glmark2-es2-fbdev.patch \ | 4 | file://0002-native-state-fbdev-Add-support-for-glmark2-es2-fbdev.patch \ |
5 | file://0003-EGL-eglplatform.h-Remove-the-eglplatform.h-header.patch \ | 5 | file://0003-EGL-eglplatform.h-Remove-the-eglplatform.h-header.patch \ |
6 | file://0001-Resolve-macro-redefination-and-presion-differ-error.patch \ | ||
6 | " | 7 | " |
7 | 8 | ||
8 | PACKAGECONFIG[fbdev-glesv2] = ",,virtual/libgles2 virtual/egl" | 9 | PACKAGECONFIG[fbdev-glesv2] = ",,virtual/libgles2 virtual/egl" |