Bug 73631 - es2tri fragment shader did not compile AMD ARUBA
Summary: es2tri fragment shader did not compile AMD ARUBA
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Demos (show other bugs)
Version: 10.0
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 21:14 UTC by Aaron Paden
Modified: 2014-01-27 11:54 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Aaron Paden 2014-01-14 21:14:14 UTC
some version info:
Linux: 3.12.7
mesa: 10.0.2
ati-dri: 10.0.2
mesa-demos: 8.1.0

This is the output of es2tri:

EGL_VERSION = 1.4 (Gallium)
EGL_VENDOR = Mesa Project
EGL_EXTENSIONS = EGL_WL_bind_wayland_display EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_surfaceless_context EGL_NOK_swap_region EGL_NV_post_sub_buffer 
EGL_CLIENT_APIS = OpenGL OpenGL_ES OpenGL_ES2 
Error: fragment shader did not compile!

I know nothing of value about OpenGL, but a DDG search pointed me toward glGetShaderInfoLog, so I tossed that in the code and got this:

0:1(14): error: no precision specified this scope for type `vec4'
Comment 1 Ian Romanick 2014-01-17 22:10:26 UTC
It sounds like the shader is broken.  Probably just add

precision mediump float;

at global scope before any float (or vec, or mat) types are used.
Comment 2 Emil Velikov 2014-01-17 22:26:22 UTC
Nice one Ian, adding "precision mediump float;" before the vec4 variable declaration in the fragment shader did the job.

Running nouveau on a nv96, in case it matters.
Comment 3 Aaron Paden 2014-01-18 15:42:36 UTC
Yep, that solves the problem on my machine as well.
Comment 4 Emil Velikov 2014-01-19 16:36:12 UTC
Patch send to the ML
http://lists.freedesktop.org/archives/mesa-dev/2014-January/051916.html
Comment 5 Tapani Pälli 2014-01-20 05:55:46 UTC
In this case it should not be needed though as there are no float variables declared in the shader, isn't this a bug in the compiler instead?
Comment 6 Tapani Pälli 2014-01-20 06:00:12 UTC
(In reply to comment #5)
> In this case it should not be needed though as there are no float variables
> declared in the shader, isn't this a bug in the compiler instead?

oops, I missed the varying vec4 and precision qualifier makes it to work, it is correct fix.
Comment 7 Emil Velikov 2014-01-27 11:54:20 UTC
Thanks for the report Aaron, the issue should be fixed with

commit 18a2f916afcb482458d03b468b46cf271953d789
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Jan 19 16:28:33 2014 +0000

    opengles2/es2tri: add precision qualifier to the fragment shader

    The missing qualifier causes failure during the compilation stage.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73631


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.