Mir

Merge lp:~vanvugt/mir/fix-1583532 into lp:mir

Proposed by Daniel van Vugt on 2016-05-24
Status: Merged
Approved by: Daniel van Vugt on 2016-05-26
Approved revision: 3519
Merged at revision: 3524
Proposed branch: lp:~vanvugt/mir/fix-1583532
Merge into: lp:mir
Diff against target: 82 lines (+19/-33)
1 file modified
examples/eglplasma.c (+19/-33)
To merge this branch: bzr merge lp:~vanvugt/mir/fix-1583532
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve on 2016-05-26
Daniel van Vugt Approve on 2016-05-26
Andreas Pokorny (community) Approve on 2016-05-25
Cemil Azizoglu (community) 2016-05-24 Approve on 2016-05-24
Review via email: mp+295564@code.launchpad.net

Commit message

Simplify the eglplasma fragment shader so it now fits within the
hardware limitations of i915, and can render in hardware on an
Intel Atom instead of software (30.0FPS vs 0.15FPS == 200x faster).
(LP: #1583532)

Description of the change

It may not sound important, but this is a proof of concept for resolving Unity8 bug 1580792.

To post a comment you must log in.
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3516
https://mir-jenkins.ubuntu.com/job/mir-ci/1026/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/1123
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1171
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1162
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1162
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1133
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1133/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1133
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1133/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1133
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1133/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1133
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1133/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1133
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1133/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1026/rebuild

review: Approve (continuous-integration)
Cemil Azizoglu (cemil-azizoglu) wrote :

Ok

review: Approve
lp:~vanvugt/mir/fix-1583532 updated on 2016-05-25
3517. By Daniel van Vugt on 2016-05-25

Merge latest trunk

3518. By Daniel van Vugt on 2016-05-25

Swirl it up - more detail instead of one large blur.

Andreas Pokorny (andreas-pokorny) wrote :

oh.. so cos is supported then?

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3518
https://mir-jenkins.ubuntu.com/job/mir-ci/1034/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1136/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1184
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1175
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1175
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1146
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1146/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1146
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1146/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1146
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1146/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1146
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1146/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1146/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1034/rebuild

review: Needs Fixing (continuous-integration)
Daniel van Vugt (vanvugt) wrote :

Yes, there are COS and SIN instructions:
http://www.renderguild.com/gpuguide.pdf

Daniel van Vugt (vanvugt) wrote :

The Jenkins failure is bug 1576690, which was fixed only hours after the failure.

lp:~vanvugt/mir/fix-1583532 updated on 2016-05-26
3519. By Daniel van Vugt on 2016-05-26

Merge latest trunk

Daniel van Vugt (vanvugt) wrote :

I approve this message.

review: Approve
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3519
https://mir-jenkins.ubuntu.com/job/mir-ci/1038/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/1142/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/1190
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1181
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1181
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1152
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/1152/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1152
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/1152/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1152
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/1152/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1152
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/1152/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/1152/console

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/1038/rebuild

review: Needs Fixing (continuous-integration)
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/eglplasma.c'
2--- examples/eglplasma.c 2014-03-05 09:26:01 +0000
3+++ examples/eglplasma.c 2016-05-26 02:13:43 +0000
4@@ -61,40 +61,23 @@
5
6 const char fshadersrc[] =
7 "precision mediump float; \n"
8- "uniform float theta; \n"
9+ "uniform vec4 theta; \n"
10 "varying vec2 texcoord; \n"
11 "uniform vec3 low_color, high_color; \n"
12 " \n"
13- "vec3 gradient(float x) \n"
14- "{ \n"
15- " vec3 col; \n"
16- " const vec3 white = vec3(1.0, 1.0, 1.0); \n"
17- " if (x < 0.333) \n"
18- " col = x * low_color / 0.333; \n"
19- " else if (x < 0.666) \n"
20- " col = (x - 0.333) * (high_color - low_color) / \n"
21- " 0.333 + low_color; \n"
22- " else \n"
23- " col = (x - 0.666) * (white - high_color) / \n"
24- " 0.333 + high_color; \n"
25- " return col; \n"
26- "} \n"
27- " \n"
28 "void main() \n"
29 "{ \n"
30 " const float pi2 = 6.283185308; \n"
31- " float u = texcoord.x * pi2; \n"
32- " float v = texcoord.y * pi2; \n"
33- " float us = (cos(1.1 * u + 7.0 * theta) + \n"
34- " cos(2.3 * v * cos(1.0 * theta)) + \n"
35- " cos(0.3 * u * cos(3.0 * theta)) \n"
36- " ) / 3.0; \n"
37- " float vs = (cos(2.3 * v + 8.0 * theta) + \n"
38- " cos(1.3 * u * cos(3.0 * theta)) + \n"
39- " cos(1.7 * v * cos(2.0 * theta)) \n"
40- " ) / 3.0; \n"
41- " float x = (us * vs + 1.0) / 2.0; \n"
42- " gl_FragColor = vec4(gradient(x), 1.0); \n"
43+ " float x = texcoord.x * pi2; \n"
44+ " float y = texcoord.y * pi2; \n"
45+ " float a = cos(1.0 * (x + theta.x)); \n"
46+ " float b = cos(2.0 * (y + theta.y + a)); \n"
47+ " float c = cos(2.0 * (2.0*x + theta.z + b)); \n"
48+ " float d = cos(1.0 * (3.0*y + theta.w + c)); \n"
49+ " float v = (a+b+c+d + 4.0) / 8.0; \n"
50+ " vec3 color = v * (high_color - low_color) + \n"
51+ " low_color; \n"
52+ " gl_FragColor = vec4(color, 1.0); \n"
53 "} \n";
54
55 const GLfloat vertices[] =
56@@ -108,7 +91,7 @@
57 GLuint vshader, fshader, prog;
58 GLint linked, low_color, high_color, vpos, theta;
59 unsigned int width = 0, height = 0;
60- GLfloat angle = 0.0f;
61+ GLfloat angle[4] = {3.1f, 4.1f, 5.9f, 2.6f};
62
63 if (!mir_eglapp_init(argc, argv, &width, &height))
64 return 1;
65@@ -149,10 +132,13 @@
66
67 while (mir_eglapp_running())
68 {
69- glUniform1f(theta, angle);
70- angle += 0.005f;
71- if (angle > pi2)
72- angle -= pi2;
73+ glUniform4fv(theta, 1, angle);
74+ angle[0] += 0.00345f;
75+ angle[1] += 0.01947f;
76+ angle[2] += 0.03758f;
77+ angle[3] += 0.01711f;
78+ for (int a = 0; a < 4; ++a)
79+ if (angle[a] > pi2) angle[a] -= pi2;
80 glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
81 mir_eglapp_swap_buffers();
82 }

Subscribers

People subscribed via source and target branches