Forums - MRT ES 3.0

3 posts / 0 new
Last post
MRT ES 3.0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Thu, 2014-11-20 14:15

Hi, some of my (pixel)shaders outputs to several render targets.

I had an issue for which I thought it was for a specific RT format, changing this format to a more basic (RGBA8) format causes some other issues.

Using glGetFragDataLocation to validate my shaders, it seems that on all my (pixel)shaders using MRT, at most one output is present in the compiled shader ...

I'm using this syntax

layout(location = 0) out vec4 PS_OUTPUT_fBlend1;
layout(location = 1) out vec4 PS_OUTPUT_fBlend2;
layout(location = 2) out uint PS_OUTPUT_uiFlag;
 
which works fine on all other platforms I'm developing for.
taking a look at the Adreno SDK, the quickref shows this syntax:
out vec4 gl_FragColor[3];
 
which enables MRT, but all of the same format.
 
so ...
Am I wrong or the (multiple) layout(location = n) out type nameN; syntax doesn't work ?
Does Adreno OpenGL ES 3.0 implementation allows MRT with different formats (for example, mixing a vec4 and an uint) ?
 
  • Up0
  • Down0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Fri, 2014-11-21 07:08

Hi, I spend the whole day normalizing the way I declare PS outputs in my wrapper

as long as there are more than 1 RT, even if they are of the same type, glGetFragDataLocation returns 0 for the first RT (correct), and returns -1 for all the others.

(Nexus 4 / Android 5.0 / Driver 95)

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

it seems (to me) that MRT rendering is correct, the only incorrect thing is the result value of glGetFragDataLocation in this case.

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