Forums - GLES3 shader crashing on Adreno 320/Nexus 4

13 posts / 0 new
Last post
GLES3 shader crashing on Adreno 320/Nexus 4
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Thu, 2014-09-11 18:21

 

I was making a new shader designed for just GLES3, it was supposed to copy color and depth through gl_FragDepth but I think I just stumbled upon a weird issue where if I compile and link the VS and PS I get a crash.

VS :

#version 300 es


    uniform mat4 ProjectionMatrix;
    uniform mat4 InvMVP;
    uniform float  Time;
    uniform vec2 Resolution;
    uniform vec3 SunPos;
    uniform vec2 StretchRatio;


in vec4 POSITION;
in vec2 TEXCOORD;

out vec2 OutTexcoord;

void main()
{
    vec2 Coef = StretchRatio;
    if (Coef.x > 1.0)
        Coef.x = 1.0;
    if (Coef.y > 1.0)
        Coef.y = 1.0;
    
    vec2 InTexcoord = TEXCOORD;// * Coef;
    InTexcoord *=Coef;
    InTexcoord.y = Coef.y - InTexcoord.y;
    
    gl_Position = POSITION;
    OutTexcoord = InTexcoord;
}

PS :

#version 300 es
precision highp float;

uniform sampler2D Texture0;
uniform sampler2D Texture1;

in vec2 OutTexcoord;


layout(location = 0) out vec4 FragColor;

void main()
{
    vec4 Color = texture( Texture0, OutTexcoord );
    vec4 Depth = texture( Texture1, OutTexcoord );
    
    FragColor = Color;//if I comment this, everything runs just fine !
    //gl_FragDepth = Depth.x;
}

 

So basically if I comment out writting into FragColor it compiles/links ok and I get no issues, as it is, it compiles ok but crashes when it's linking.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2014-09-16 09:22

Hi..

Thanks for reporting the crash.  We've attempted to duplicate this on several devices here including a Nexus 4 and are unable to duplicate the crash.  Can you provide a sample apk, information about the build loaded on your Nexus 4 (date, Android version) and also the shader log?

  • Up0
  • Down0
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Thu, 2014-10-30 00:21

While I haven't resolved the above issue, I still see that my instanced tesselation shader is crashing on my Nexus 4. So there must be something wrong with UBOs that do random indexing/fetching.

I just made an apk that results in a crash. I'm not 100% sure it's the driver or what it is cause I can't put breakpoints in android as I found no IDE to easily do that but it crashes right before fetching the log after a glLinkProgram(). I'm currently using this particular CyanogenMod image/version:

11-20141008-SNAPSHOT-M11-mako

And it's Android 4.4.4 . I was wanting to test with the new 5.0 but looks like there's nothing official on that.

Here's the APK

https://drive.google.com/file/d/0B0P3ptcNhBGzRlRnQm44V1UzVUE/view?usp=sh...

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Thu, 2014-11-06 11:26

Thanks for providing the apk.  We've tried installing and running it on one of our 8084 devkits with a recent build, and it seems to run ok.  Are there specific instructions to cause the crash?

 

 

  • Up0
  • Down0
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Thu, 2014-11-06 21:35

Just pressing the "Start Benchmark" button without pressing any other buttons should cause the crash. I'm waiting for the official 5.0 images to try again, maybe something's changed. Is that devkit with an Adreno 320 though or your latest 420+ ?

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Fri, 2014-11-07 08:13

The dev kit has an Adreno 420.  The benchmark seems to run through ok when the "start benchmark" button is pressed.

  • Up0
  • Down0
zxcvbad
Join Date: 15 Apr 14
Posts: 20
Posted: Fri, 2014-11-07 10:12

What driver revision is on dev kit, is it v95?

  • Up0
  • Down0
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Fri, 2014-11-07 10:44

Well, this has made me a quite curious. Since Qualcomm's latest chip is the Adreno 420, are the older chips like Adreno 320/330 still being worked on ? Like are you still fixing bugs & issues for those chips or you've just moved on and those chips are stuck with whatever drivers they currently have ?

  • Up0
  • Down0
RelativeGames
Profile picture
Join Date: 16 Apr 13
Posts: 56
Posted: Wed, 2014-11-12 09:58

I've installed the Android 5.0 AOSP on my Nexus 4 and while it doesn't crash anymore when it sees my Instance Tesselation shader, I don't see the expected results on it, rather chaotic triangles, about 1/4 of total.

Expected image : https://drive.google.com/file/d/0BwDjq7lQ5oRBNkFDYVMyZjFXZkU/view?usp=sh...

Nexus 4 Android 5.0 drivers : https://drive.google.com/file/d/0BwDjq7lQ5oRBYXRwUU5RekFub1k/view?usp=sh...

the GL_VERSION also says @95 AU@ (GIT@I4803bd6c29)

  • Up0
  • Down0
Dave Astle
Profile picture
Join Date: 19 Oct 12
Location: San Diego, CA
Posts: 99
Posted: Thu, 2014-11-13 09:05

The issue isn't so much whether or not we're fixing bugs and addressing issues, it's whether or not our customers are willing to pick up those fixes and roll them out. Here's a simplified, high level view of how it works:

  • - We're constantly working on the driver, fixing bugs, improving performance, and adding support for new features
  • Any time a customer starts a new product (dozens if not hundreds of times a year), they get a drop of our driver for which we have to create a branch
  • - From this point on, as the product approaches commercialization, it becomes increasingly difficult for us to merge fixes into this branch, due to customer concerns about regressions and the need to revalidate all of their test content.
  • - Once the product ships, we have maybe one or two opportunities to include fixes as part of an update, but again, it's up to the customer what fixes they want to take.
  • - All of this results in older devices potentially missing some fixes. It also means that as a developer, you can experience a significant amount of variance from device to device.
  •  

We're taking steps to improve this situation, but there is no easy fix, because there are legitimate reasons for things working the way they do currently.

  • Up0
  • Down0
MKz
Join Date: 19 Dec 13
Posts: 7
Posted: Thu, 2014-11-13 23:16

Maybe you could ask google to include an extra option in the developer options for switching between driver versions similair to their dalvik / art switch, ie:

Current stable driver - Driver included in factory stock Android / OTAs.

Update to latest developerment driver - It checks Qualcomms site for a newer driver and downloads it the same way it would when it checks for a new ota update in a different folder / place to the stable driver so it doesn't overwrite it.

To me this makes far more sense than having to root and install custom recovery then having to check your website for a new development driver, if the development driver creates new issues you can always switchback to the stable driver without having to reflash the stock driver everytime.

  • Up0
  • Down0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Fri, 2014-11-14 12:47

Hi, I'm facing the same kind of issues.

v66 compiler/driver crashes, or stops compiling (for example reporting VS issues while compiling a PS), or produces bad code (gl_VertexId)

v95 compiler/driver solved so much of these issues, that I'm near to stop trying to make my code run on previous driver (I using in nearly 50% of my shaders gl_VertexID, so it's quite tons of code to have in 2 versions, the base one, and a hacked one without gl_VertexID)

(which nearly means at least Android 5.0 as target)

Is it possible to install a v95 compiler/driver on a device running v66 compiler/driver ?

I have a Samsung Galaxy Pro 8.4, running Android 4.4, that will be updated sometime in the future (...) by Samsung, and I would like to use it for development.

I also have a Kindle Fire HDX, running FireOS 4, and I believe it will never be updated by Amazon.

I understand that I can't ask end-user to patch his device, but as a developper, I wish I could :)

 

  • Up0
  • Down0
rxpavi
Join Date: 24 Nov 15
Posts: 1
Posted: Wed, 2015-12-02 07:49

How did you solve this, I am having similar issue with Adreno 320 hanging when glFragDepth is used.

After digging through the forum, it seems using OpenGL ES extension library is one solution but including the glesextlib.h gives me redeclaration error for a lot of gl symbols like glReadBuffer etc.

  • 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.