* [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
@ 2018-08-28 22:19 Andreas Müller
2018-08-29 14:16 ` Richard Purdie
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Müller @ 2018-08-28 22:19 UTC (permalink / raw)
To: openembedded-core
The patch should increase performance for libsdl2 on GLES2 too.
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
...01-GLES2-Get-sin-cos-out-of-vertex-shader.patch | 141 +++++++++++++++++++++
meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 1 +
2 files changed, 142 insertions(+)
create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-shader.patch
diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-shader.patch b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-shader.patch
new file mode 100644
index 0000000000..621b7ea1a0
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-shader.patch
@@ -0,0 +1,141 @@
+From c215ba1d52a3d4ef03af3ab1a5baa1863f812aed Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Fri, 24 Aug 2018 23:10:25 +0200
+Subject: [PATCH] GLES2: Get sin/cos out of vertex shader
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The only place angle is activated and causes effect is RenderCopyEx. All other
+methods which use vertex shader, leave angle disabled and cause useless sin/cos
+calculation in shader.
+
+To get around shader's interface is changed to a vector that contains results
+of sin and cos. To behave properly when disabled, cos value is set with offset
+-1.0 making 0.0 default when deactivated.
+
+As nice side effect it simplifies GLES2_UpdateVertexBuffer: All attributes are
+vectors now.
+
+Additional background:
+
+* On RaspberryPi it gives a performace win for operations. Tested with
+ [1] numbers go down for 5-10% (not easy to estimate due to huge variation).
+* SDL_RenderCopyEx was tested with [2]
+* It works around left rotated display caused by low accuracy sin implemetation
+ in RaspberryPi/VC4 [3]
+
+Upstream-Status: Submitted [4]
+
+[1] https://github.com/schnitzeltony/sdl2box
+[2] https://github.com/schnitzeltony/sdl2rendercopyex
+[3] https://github.com/anholt/mesa/issues/110
+[4] https://hg.libsdl.org/SDL/rev/e5a666405750
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/render/opengles2/SDL_render_gles2.c | 17 ++++++++++++-----
+ src/render/opengles2/SDL_shaders_gles2.c | 14 +++++++++-----
+ 2 files changed, 21 insertions(+), 10 deletions(-)
+
+diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c
+index 14671f7c8..7c54a7333 100644
+--- a/src/render/opengles2/SDL_render_gles2.c
++++ b/src/render/opengles2/SDL_render_gles2.c
+@@ -1530,7 +1530,7 @@ GLES2_UpdateVertexBuffer(SDL_Renderer *renderer, GLES2_Attribute attr,
+ GLES2_DriverContext *data = (GLES2_DriverContext *)renderer->driverdata;
+
+ #if !SDL_GLES2_USE_VBOS
+- data->glVertexAttribPointer(attr, attr == GLES2_ATTRIBUTE_ANGLE ? 1 : 2, GL_FLOAT, GL_FALSE, 0, vertexData);
++ data->glVertexAttribPointer(attr, 2, GL_FLOAT, GL_FALSE, 0, vertexData);
+ #else
+ if (!data->vertex_buffers[attr]) {
+ data->glGenBuffers(1, &data->vertex_buffers[attr]);
+@@ -1545,7 +1545,7 @@ GLES2_UpdateVertexBuffer(SDL_Renderer *renderer, GLES2_Attribute attr,
+ data->glBufferSubData(GL_ARRAY_BUFFER, 0, dataSizeInBytes, vertexData);
+ }
+
+- data->glVertexAttribPointer(attr, attr == GLES2_ATTRIBUTE_ANGLE ? 1 : 2, GL_FLOAT, GL_FALSE, 0, 0);
++ data->glVertexAttribPointer(attr, 2, GL_FLOAT, GL_FALSE, 0, 0);
+ #endif
+
+ return 0;
+@@ -1853,6 +1853,8 @@ GLES2_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *s
+ return GL_CheckError("", renderer);
+ }
+
++#define PI 3.14159265f
++
+ static int
+ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect,
+ const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
+@@ -1861,8 +1863,9 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect
+ GLfloat vertices[8];
+ GLfloat texCoords[8];
+ GLfloat translate[8];
+- GLfloat fAngle[4];
++ GLfloat fAngle[8];
+ GLfloat tmp;
++ float radian_angle;
+
+ GLES2_ActivateRenderer(renderer);
+
+@@ -1872,7 +1875,11 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect
+
+ data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
+ data->glEnableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
+- fAngle[0] = fAngle[1] = fAngle[2] = fAngle[3] = (GLfloat)(360.0f - angle);
++
++ radian_angle = PI * (360.0f - angle) / 180.f;
++ fAngle[0] = fAngle[2] = fAngle[4] = fAngle[6] = (GLfloat)sin(radian_angle);
++ /* render expects cos value - 1 (see GLES2_VertexSrc_Default_) */
++ fAngle[1] = fAngle[3] = fAngle[5] = fAngle[7] = (GLfloat)cos(radian_angle) - 1.0f;
+ /* Calculate the center of rotation */
+ translate[0] = translate[2] = translate[4] = translate[6] = (center->x + dstrect->x);
+ translate[1] = translate[3] = translate[5] = translate[7] = (center->y + dstrect->y);
+@@ -1901,7 +1908,7 @@ GLES2_RenderCopyEx(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect
+ data->glVertexAttribPointer(GLES2_ATTRIBUTE_CENTER, 2, GL_FLOAT, GL_FALSE, 0, translate);
+ data->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);*/
+
+- GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_ANGLE, fAngle, 4 * sizeof(GLfloat));
++ GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_ANGLE, fAngle, 8 * sizeof(GLfloat));
+ GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_CENTER, translate, 8 * sizeof(GLfloat));
+ GLES2_UpdateVertexBuffer(renderer, GLES2_ATTRIBUTE_POSITION, vertices, 8 * sizeof(GLfloat));
+
+diff --git a/src/render/opengles2/SDL_shaders_gles2.c b/src/render/opengles2/SDL_shaders_gles2.c
+index b0bcdff25..f428a4945 100644
+--- a/src/render/opengles2/SDL_shaders_gles2.c
++++ b/src/render/opengles2/SDL_shaders_gles2.c
+@@ -30,20 +30,24 @@
+ /*************************************************************************************************
+ * Vertex/fragment shader source *
+ *************************************************************************************************/
+-
++/* Notes on a_angle:
++ * It is a vector containing sin and cos for rotation matrix
++ * To get correct rotation for most cases when a_angle is disabled cos
++ value is decremented by 1.0 to get proper output with 0.0 which is
++ default value
++*/
+ static const Uint8 GLES2_VertexSrc_Default_[] = " \
+ uniform mat4 u_projection; \
+ attribute vec2 a_position; \
+ attribute vec2 a_texCoord; \
+- attribute float a_angle; \
++ attribute vec2 a_angle; \
+ attribute vec2 a_center; \
+ varying vec2 v_texCoord; \
+ \
+ void main() \
+ { \
+- float angle = radians(a_angle); \
+- float c = cos(angle); \
+- float s = sin(angle); \
++ float s = a_angle[0]; \
++ float c = a_angle[1] + 1.0; \
+ mat2 rotationMatrix = mat2(c, -s, s, c); \
+ vec2 position = rotationMatrix * (a_position - a_center) + a_center; \
+ v_texCoord = a_texCoord; \
+--
+2.14.4
+
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
index accea38aaa..52bb93a17a 100644
--- a/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb
@@ -14,6 +14,7 @@ PROVIDES = "virtual/libsdl2"
SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz \
file://more-gen-depends.patch \
+ file://0001-GLES2-Get-sin-cos-out-of-vertex-shader.patch \
"
S = "${WORKDIR}/SDL2-${PV}"
--
2.14.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-28 22:19 [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2 Andreas Müller
@ 2018-08-29 14:16 ` Richard Purdie
2018-08-29 17:22 ` Andreas Müller
0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2018-08-29 14:16 UTC (permalink / raw)
To: Andreas Müller, openembedded-core
On Wed, 2018-08-29 at 00:19 +0200, Andreas Müller wrote:
> The patch should increase performance for libsdl2 on GLES2 too.
>
> Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
> ---
> ...01-GLES2-Get-sin-cos-out-of-vertex-shader.patch | 141
> +++++++++++++++++++++
> meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 1 +
> 2 files changed, 142 insertions(+)
> create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-
> Get-sin-cos-out-of-vertex-shader.patch
>
> diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-
> sin-cos-out-of-vertex-shader.patch b/meta/recipes-
> graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-
> shader.patch
> new file mode 100644
> index 0000000000..621b7ea1a0
> --- /dev/null
> +++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-
> out-of-vertex-shader.patch
> @@ -0,0 +1,141 @@
> +From c215ba1d52a3d4ef03af3ab1a5baa1863f812aed Mon Sep 17 00:00:00
> 2001
> +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
> +Date: Fri, 24 Aug 2018 23:10:25 +0200
> +Subject: [PATCH] GLES2: Get sin/cos out of vertex shader
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +The only place angle is activated and causes effect is RenderCopyEx.
> All other
> +methods which use vertex shader, leave angle disabled and cause
> useless sin/cos
> +calculation in shader.
> +
> +To get around shader's interface is changed to a vector that
> contains results
> +of sin and cos. To behave properly when disabled, cos value is set
> with offset
> +-1.0 making 0.0 default when deactivated.
> +
> +As nice side effect it simplifies GLES2_UpdateVertexBuffer: All
> attributes are
> +vectors now.
> +
> +Additional background:
> +
> +* On RaspberryPi it gives a performace win for operations. Tested
> with
> + [1] numbers go down for 5-10% (not easy to estimate due to huge
> variation).
> +* SDL_RenderCopyEx was tested with [2]
> +* It works around left rotated display caused by low accuracy sin
> implemetation
> + in RaspberryPi/VC4 [3]
> +
> +Upstream-Status: Submitted [4]
If I'm reading the logs correctly, this was actually merged upstream so
the status would become Accepted or Backport?
> +[1] https://github.com/schnitzeltony/sdl2box
> +[2] https://github.com/schnitzeltony/sdl2rendercopyex
> +[3] https://github.com/anholt/mesa/issues/110
> +[4] https://hg.libsdl.org/SDL/rev/e5a666405750
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-29 14:16 ` Richard Purdie
@ 2018-08-29 17:22 ` Andreas Müller
2018-08-30 9:44 ` richard.purdie
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Müller @ 2018-08-29 17:22 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
On Wed, Aug 29, 2018 at 4:16 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2018-08-29 at 00:19 +0200, Andreas Müller wrote:
>> The patch should increase performance for libsdl2 on GLES2 too.
>>
>> Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
>> ---
>> ...01-GLES2-Get-sin-cos-out-of-vertex-shader.patch | 141
>> +++++++++++++++++++++
>> meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 1 +
>> 2 files changed, 142 insertions(+)
>> create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-
>> Get-sin-cos-out-of-vertex-shader.patch
>>
>> diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-
>> sin-cos-out-of-vertex-shader.patch b/meta/recipes-
>> graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-
>> shader.patch
>> new file mode 100644
>> index 0000000000..621b7ea1a0
>> --- /dev/null
>> +++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-
>> out-of-vertex-shader.patch
>> @@ -0,0 +1,141 @@
>> +From c215ba1d52a3d4ef03af3ab1a5baa1863f812aed Mon Sep 17 00:00:00
>> 2001
>> +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
>> +Date: Fri, 24 Aug 2018 23:10:25 +0200
>> +Subject: [PATCH] GLES2: Get sin/cos out of vertex shader
>> +MIME-Version: 1.0
>> +Content-Type: text/plain; charset=UTF-8
>> +Content-Transfer-Encoding: 8bit
>> +
>> +The only place angle is activated and causes effect is RenderCopyEx.
>> All other
>> +methods which use vertex shader, leave angle disabled and cause
>> useless sin/cos
>> +calculation in shader.
>> +
>> +To get around shader's interface is changed to a vector that
>> contains results
>> +of sin and cos. To behave properly when disabled, cos value is set
>> with offset
>> +-1.0 making 0.0 default when deactivated.
>> +
>> +As nice side effect it simplifies GLES2_UpdateVertexBuffer: All
>> attributes are
>> +vectors now.
>> +
>> +Additional background:
>> +
>> +* On RaspberryPi it gives a performace win for operations. Tested
>> with
>> + [1] numbers go down for 5-10% (not easy to estimate due to huge
>> variation).
>> +* SDL_RenderCopyEx was tested with [2]
>> +* It works around left rotated display caused by low accuracy sin
>> implemetation
>> + in RaspberryPi/VC4 [3]
>> +
>> +Upstream-Status: Submitted [4]
>
> If I'm reading the logs correctly, this was actually merged upstream so
> the status would become Accepted or Backport?
>
>> +[1] https://github.com/schnitzeltony/sdl2box
>> +[2] https://github.com/schnitzeltony/sdl2rendercopyex
>> +[3] https://github.com/anholt/mesa/issues/110
>> +[4] https://hg.libsdl.org/SDL/rev/e5a666405750
>
> Cheers,
>
> Richard
LOL: V1 I tried 'Applied [4]'
and received patch failure message with the following hint:
| Valid status Pending, Accepted, Backport, Denied, Inappropriate
[reason], Submitted [where]
My favourite would have been
| Accepted[4]
to state out clearly that '[4]' is oe-specific and not part of the
original patch. If I read the hint correctly that would have caused
another patch failure. So I chose Submitted.
So Accepted without []?
Sorry to ask such kind of questions...
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-29 17:22 ` Andreas Müller
@ 2018-08-30 9:44 ` richard.purdie
2018-08-30 10:45 ` Andreas Müller
0 siblings, 1 reply; 7+ messages in thread
From: richard.purdie @ 2018-08-30 9:44 UTC (permalink / raw)
To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer
On Wed, 2018-08-29 at 19:22 +0200, Andreas Müller wrote:
> On Wed, Aug 29, 2018 at 4:16 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > On Wed, 2018-08-29 at 00:19 +0200, Andreas Müller wrote:
> > > The patch should increase performance for libsdl2 on GLES2 too.
> > >
> > > Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
> > > ---
> > > ...01-GLES2-Get-sin-cos-out-of-vertex-shader.patch | 141
> > > +++++++++++++++++++++
> > > meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 1 +
> > > 2 files changed, 142 insertions(+)
> > > create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-
> > > GLES2-
> > > Get-sin-cos-out-of-vertex-shader.patch
> > >
> > > diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-
> > > Get-
> > > sin-cos-out-of-vertex-shader.patch b/meta/recipes-
> > > graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-
> > > shader.patch
> > > new file mode 100644
> > > index 0000000000..621b7ea1a0
> > > --- /dev/null
> > > +++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-
> > > cos-
> > > out-of-vertex-shader.patch
> > > @@ -0,0 +1,141 @@
> > > +From c215ba1d52a3d4ef03af3ab1a5baa1863f812aed Mon Sep 17
> > > 00:00:00
> > > 2001
> > > +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com
> > > >
> > > +Date: Fri, 24 Aug 2018 23:10:25 +0200
> > > +Subject: [PATCH] GLES2: Get sin/cos out of vertex shader
> > > +MIME-Version: 1.0
> > > +Content-Type: text/plain; charset=UTF-8
> > > +Content-Transfer-Encoding: 8bit
> > > +
> > > +The only place angle is activated and causes effect is
> > > RenderCopyEx.
> > > All other
> > > +methods which use vertex shader, leave angle disabled and cause
> > > useless sin/cos
> > > +calculation in shader.
> > > +
> > > +To get around shader's interface is changed to a vector that
> > > contains results
> > > +of sin and cos. To behave properly when disabled, cos value is
> > > set
> > > with offset
> > > +-1.0 making 0.0 default when deactivated.
> > > +
> > > +As nice side effect it simplifies GLES2_UpdateVertexBuffer: All
> > > attributes are
> > > +vectors now.
> > > +
> > > +Additional background:
> > > +
> > > +* On RaspberryPi it gives a performace win for operations.
> > > Tested
> > > with
> > > + [1] numbers go down for 5-10% (not easy to estimate due to
> > > huge
> > > variation).
> > > +* SDL_RenderCopyEx was tested with [2]
> > > +* It works around left rotated display caused by low accuracy
> > > sin
> > > implemetation
> > > + in RaspberryPi/VC4 [3]
> > > +
> > > +Upstream-Status: Submitted [4]
> >
> > If I'm reading the logs correctly, this was actually merged
> > upstream so
> > the status would become Accepted or Backport?
> >
> > > +[1] https://github.com/schnitzeltony/sdl2box
> > > +[2] https://github.com/schnitzeltony/sdl2rendercopyex
> > > +[3] https://github.com/anholt/mesa/issues/110
> > > +[4] https://hg.libsdl.org/SDL/rev/e5a666405750
> >
> > Cheers,
> >
> > Richard
>
> LOL: V1 I tried 'Applied [4]'
>
> and received patch failure message with the following hint:
>
> > Valid status Pending, Accepted, Backport, Denied, Inappropriate
>
> [reason], Submitted [where]
>
> My favourite would have been
>
> > Accepted[4]
>
> to state out clearly that '[4]' is oe-specific and not part of the
> original patch. If I read the hint correctly that would have caused
> another patch failure. So I chose Submitted.
>
> So Accepted without []?
>
> Sorry to ask such kind of questions...
I'd have thought Accepted should have a []. A quick grep shows other
patches which have that in the tree so I suspect that help text is
misleading...
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-30 9:44 ` richard.purdie
@ 2018-08-30 10:45 ` Andreas Müller
2018-08-30 15:22 ` richard.purdie
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Müller @ 2018-08-30 10:45 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
On Thu, Aug 30, 2018 at 11:44 AM, <richard.purdie@linuxfoundation.org> wrote:
> On Wed, 2018-08-29 at 19:22 +0200, Andreas Müller wrote:
>> On Wed, Aug 29, 2018 at 4:16 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>> > On Wed, 2018-08-29 at 00:19 +0200, Andreas Müller wrote:
>> > > The patch should increase performance for libsdl2 on GLES2 too.
>> > >
>> > > Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
>> > > ---
>> > > ...01-GLES2-Get-sin-cos-out-of-vertex-shader.patch | 141
>> > > +++++++++++++++++++++
>> > > meta/recipes-graphics/libsdl2/libsdl2_2.0.8.bb | 1 +
>> > > 2 files changed, 142 insertions(+)
>> > > create mode 100644 meta/recipes-graphics/libsdl2/libsdl2/0001-
>> > > GLES2-
>> > > Get-sin-cos-out-of-vertex-shader.patch
>> > >
>> > > diff --git a/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-
>> > > Get-
>> > > sin-cos-out-of-vertex-shader.patch b/meta/recipes-
>> > > graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-cos-out-of-vertex-
>> > > shader.patch
>> > > new file mode 100644
>> > > index 0000000000..621b7ea1a0
>> > > --- /dev/null
>> > > +++ b/meta/recipes-graphics/libsdl2/libsdl2/0001-GLES2-Get-sin-
>> > > cos-
>> > > out-of-vertex-shader.patch
>> > > @@ -0,0 +1,141 @@
>> > > +From c215ba1d52a3d4ef03af3ab1a5baa1863f812aed Mon Sep 17
>> > > 00:00:00
>> > > 2001
>> > > +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com
>> > > >
>> > > +Date: Fri, 24 Aug 2018 23:10:25 +0200
>> > > +Subject: [PATCH] GLES2: Get sin/cos out of vertex shader
>> > > +MIME-Version: 1.0
>> > > +Content-Type: text/plain; charset=UTF-8
>> > > +Content-Transfer-Encoding: 8bit
>> > > +
>> > > +The only place angle is activated and causes effect is
>> > > RenderCopyEx.
>> > > All other
>> > > +methods which use vertex shader, leave angle disabled and cause
>> > > useless sin/cos
>> > > +calculation in shader.
>> > > +
>> > > +To get around shader's interface is changed to a vector that
>> > > contains results
>> > > +of sin and cos. To behave properly when disabled, cos value is
>> > > set
>> > > with offset
>> > > +-1.0 making 0.0 default when deactivated.
>> > > +
>> > > +As nice side effect it simplifies GLES2_UpdateVertexBuffer: All
>> > > attributes are
>> > > +vectors now.
>> > > +
>> > > +Additional background:
>> > > +
>> > > +* On RaspberryPi it gives a performace win for operations.
>> > > Tested
>> > > with
>> > > + [1] numbers go down for 5-10% (not easy to estimate due to
>> > > huge
>> > > variation).
>> > > +* SDL_RenderCopyEx was tested with [2]
>> > > +* It works around left rotated display caused by low accuracy
>> > > sin
>> > > implemetation
>> > > + in RaspberryPi/VC4 [3]
>> > > +
>> > > +Upstream-Status: Submitted [4]
>> >
>> > If I'm reading the logs correctly, this was actually merged
>> > upstream so
>> > the status would become Accepted or Backport?
>> >
>> > > +[1] https://github.com/schnitzeltony/sdl2box
>> > > +[2] https://github.com/schnitzeltony/sdl2rendercopyex
>> > > +[3] https://github.com/anholt/mesa/issues/110
>> > > +[4] https://hg.libsdl.org/SDL/rev/e5a666405750
>> >
>> > Cheers,
>> >
>> > Richard
>>
>> LOL: V1 I tried 'Applied [4]'
>>
>> and received patch failure message with the following hint:
>>
>> > Valid status Pending, Accepted, Backport, Denied, Inappropriate
>>
>> [reason], Submitted [where]
>>
>> My favourite would have been
>>
>> > Accepted[4]
>>
>> to state out clearly that '[4]' is oe-specific and not part of the
>> original patch. If I read the hint correctly that would have caused
>> another patch failure. So I chose Submitted.
>>
>> So Accepted without []?
>>
>> Sorry to ask such kind of questions...
>
> I'd have thought Accepted should have a []. A quick grep shows other
> patches which have that in the tree so I suspect that help text is
> misleading...
>
V2 with Accepted?
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-30 10:45 ` Andreas Müller
@ 2018-08-30 15:22 ` richard.purdie
2018-08-30 19:11 ` Andreas Müller
0 siblings, 1 reply; 7+ messages in thread
From: richard.purdie @ 2018-08-30 15:22 UTC (permalink / raw)
To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer
On Thu, 2018-08-30 at 12:45 +0200, Andreas Müller wrote:
> > I'd have thought Accepted should have a []. A quick grep shows
> > other
> > patches which have that in the tree so I suspect that help text is
> > misleading...
> >
>
> V2 with Accepted?
I've tweaked it in -next to save reposting and remerging the patches :)
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2
2018-08-30 15:22 ` richard.purdie
@ 2018-08-30 19:11 ` Andreas Müller
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Müller @ 2018-08-30 19:11 UTC (permalink / raw)
To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer
On Thu, Aug 30, 2018 at 5:22 PM, <richard.purdie@linuxfoundation.org> wrote:
> On Thu, 2018-08-30 at 12:45 +0200, Andreas Müller wrote:
>> > I'd have thought Accepted should have a []. A quick grep shows
>> > other
>> > patches which have that in the tree so I suspect that help text is
>> > misleading...
>> >
>>
>> V2 with Accepted?
>
> I've tweaked it in -next to save reposting and remerging the patches :)
>
> Cheers,
>
Thanks and sorry for consuming your time on this - try to do better next time
Andreas
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-08-30 19:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 22:19 [PATCH v2] libsdl2: Fix left rotated display for RaspPi/VC4/GLES2 Andreas Müller
2018-08-29 14:16 ` Richard Purdie
2018-08-29 17:22 ` Andreas Müller
2018-08-30 9:44 ` richard.purdie
2018-08-30 10:45 ` Andreas Müller
2018-08-30 15:22 ` richard.purdie
2018-08-30 19:11 ` Andreas Müller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.