Forums - Centroid in/out broken

10 posts / 0 new
Last post
Centroid in/out broken
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Fri, 2013-05-31 06:39

I'm working with a simple shader to render a texture to screen with a triangle fan and OpenGL ES 3. I noticed that centroid in/out is broken in the shaders.

I've got two images, one with centroid in/out enabled and one with regular in/out.

Don't let the texture fool you, it is a rendering from the CPU being output as a texture which I am using the draw to the screen.

This is with the Galaxy S4 with it's version 14 drivers again.

Regular: https://docs.google.com/file/d/0B2mTNE31f5JTSF9FZXF0UWp5Vlk/edit?usp=sharing

Centroid In/Out: https://docs.google.com/file/d/0B2mTNE31f5JTS3F1blFJSjE2ZDQ/edit?usp=sharing

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Fri, 2013-05-31 09:05

Hi..

Thanks for bringing this to our attention...

1) I'm not seeing the image for the Centroid In/Out after selecting the link

2) Could you share the shader code that is using the centroid function?

3) Could you let us know if multisampling is enabled?

4) What's the build number that is shown when About phone is selected?

thanks

 

 

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Fri, 2013-05-31 09:52

1) The image is actually just completely white is the issue.

2) Shaders are here

 
#version 300 es
centroid in highp vec2 TexCoordOut;
uniform sampler2D Texture;
layout (location = 0) out vec4 ocol0;
void main() {
	ocol0 = texture(Texture, TexCoordOut);
};

#version 300 es
in vec4 pos;
in vec2 TexCoordIn; 
centroid out vec2 TexCoordOut; 
void main() {
	gl_Position = pos;
	TexCoordOut = TexCoordIn;
};
 

As you can tell, they are just simple shaders.

3) MSAA isn't enabled

4) JDQ39.I337UCUAMDB

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Sat, 2013-06-01 08:18

I agree that the shader is quite simple, and the output isn't obvious..

I want to clarify a few things on the usage..

1) I don't think the centroid type qualifier is needed for the output of the vertex shader (only for the input of a fragment shader)

2) I believe the centroid type qualifier is only used when MSAA is in effect

reference: http://www.opengl.org/wiki/Type_Qualifier_(GLSL)

 

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sat, 2013-06-01 16:15

The centroid qualifier should be required on both sides to make sure it links up correctly, no?

Also it is only used when MSAA is enabled, but when MSAA is disabled it should act just like a regular in/out qualifier in the shaders, granting ease of movement from enabling and disabling MSAA, so one doesn't need different shaders when MSAA is actually enabled.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2013-06-04 07:27

1) We did some investigation, and yes, the centroid qualifer should match up between VS output and FS input

2) Yes, when MSAA is disabled, the centroid interpolation falls back to center based interpolation - clearly there's a bug or a shader linker problem that's not caught (can you verfiy that the shader is correctly linking?)

3) We recented fixed some centroid bugs, but are not sure if they're in the build for your device.  Can you let us know what "About Phone" shows for your build number and kernel version?

 

thanks

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

Yes the shaders link.

Build Number: JDQ39.I337UCUAMDB

Kernel: 3.4.0-440216

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Sat, 2013-10-12 22:10

Has this issue been fixed on Qualcomm's side with development versions?

I would like to mark this off our list of bugs as being fixed in a future driver release.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2013-10-15 07:57

Would it be possible to extract the Adreno driver version log statements from the logcat generated on your Samsung Galaxy S4, so we can figure out when a fix with the fix would be available?

adb logcat | grep EGL

 

thanks,

mark

  • Up0
  • Down0
Sonicadvance1
Join Date: 2 Nov 12
Posts: 51
Posted: Wed, 2013-10-16 15:09

I'm not too concerned about knowing when a fix will be available. Just hoping that you've already got it fixed since it isn't the biggest issue(Just happens to cause rendering issues when MSAA is used and we can't use centroid). Assuming from the tone of your sentence, it seems that Qualcomm already has this issue fixed in their working code, so I can mark it off my bug tracker as "fixed, pending consumer release."

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