Forums - Adreno drivers version 14 shader compilation error

6 posts / 0 new
Last post
Adreno drivers version 14 shader compilation error
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Mon, 2013-05-06 04:34

The Adreno drivers have a issue with compiling GLSL shaders with a function define in them. It errors out with "unexpected EOF"

Even the most simple pixel shader error doesn't work.

Simple Example

Quote:

varying highp vec2 uv0;

uniform sampler2D Texture;
#define saturate(x) clamp(x, 0.0f, 1.0f)
void main() {
       gl_FragColor = saturate(texture2D(Texture, uv0));
};

Hope you guys fix this.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2013-05-06 10:41

Hi...

We're aware of this compiler error and have a fix in the works.  You can workaround it by removing the floating point suffixes (use 1.0 instead of 1.0f)

Thanks

 

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Tue, 2013-06-18 09:41

In addition to the first issue in this post, I've hit another issue with function defines again.

with either of the following function defines in a GLSL ES 3 shader and them being used in the shader, it'll fail to compile and I can't see why since the drivers max at 1024 bytes returned for the shader info log

#define frac(x) fract(x)

#define lerp(x, y, z) mix(x, y, z)

 

changing these function defines to the following makes it work, but then they really aren't function defines

#define frac fract

#define lerp mix

 

Hope this can be rectified in future drivers sooner rather than later.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2013-06-18 12:51

Hi..

These parsing problems may have been fixed in a more recent Adreno driver.  Can you provide information that is written to the android logcat regarding the Adreno driver (e.g. during eglInitialize), and also let us know what device you are running on?

Also are you able to try on any other Snapdragon/Adreno devices?

thanks

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Tue, 2013-07-16 06:57

Took me a while to get back on this.

I/Adreno200-EGL( 3442): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build:  (CL3544079)
I/Adreno200-EGL( 3442): Build Date: 03/28/13 Thu
I/Adreno200-EGL( 3442): Local Branch: adreno_20130328
I/Adreno200-EGL( 3442): Remote Branch:
I/Adreno200-EGL( 3442): Local Patches:
I/Adreno200-EGL( 3442): Reconstruct Branch:
 
It's running on the Samsung Galaxy S4.
  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2013-07-17 10:10

I believe there may be a parsing problem in our shader compiler that was just fixed.  Can you try removing the floating point "f" suffix and see if that fixes the problem?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.