Forums - Drawcall without input stream

5 posts / 0 new
Last post
Drawcall without input stream
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Tue, 2014-11-04 03:12

Hi

I have several #version 300 es shaders using gl_VertexID as only input (no vertex buffer)

the "driver" reports

Tag : Adreno-ES20 (shouldn't it be 30 ?)

Text : <validate_vertex_attrib_state:55> : validate_vertex_attrib_state : No vertex attrib is enabled in a draw call

 

and the drawcall seems to be discarded.

I add some dummy GL_ARRAY_BUFFER and dummy AttribPointer, no more output from the driver, but the result is not valid.

 

Two questions:

Is it possible to issue a drawcall with a (3.0) vertexshader using only gl_VertexID as input ? (without dummy buffer)

Are there any known issues with gl_VertexID on Adreno (330) devices ?

 

BTW : as sample shader code (used to draw a fullscreen triangle, scissoring transforming the zone to a fullscreen quad)

void main() {
int iVertexId = int(  uint(gl_VertexID)  );
ivec2  iPos =  ivec2 ( ((iVertexId * 2) & 2) * 2 - 1, 1 - ((iVertexId & 2) * 2) );
gl_Position .xy =  highp vec2 ( iPos );
gl_Position .z = 0.5;
gl_Position .w = 1.0;
}
 
nb : the original shader code is in HLSL, converted "automatically" to GLSL (and runs fine on all GLSL hardware I'm using except Adreno)
 
  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2014-11-04 08:01

Ronan - We had a made a driver fix earlier this year for a similar problem. 

\Do you have a test apk we can try out and see if it works?

Also can you confirm that you are setting up an ES3.0 context in your app and is there a "#version 300 es" line in your shader?

Also which device and build date are you running on?

-thanks

 

 

 

  • Up0
  • Down0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Tue, 2014-11-04 08:44

thanks for your fast answer.

I can make an APK, is there a way to send a "private file" please ?

This code is running on other Android 4.4 devices.

There is a #version 300 es (1st line of all my shaders)

With an OpenGL ES 3.0 context created this way (maybe it's the problem)

 

const EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_BLUE_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_RED_SIZE, 8,
EGL_NONE
};
EGLint w, h, dummy, format;
EGLint numConfigs;
EGLConfig config;
 
mo_EGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(mo_EGLDisplay, 0, 0);
eglGetConfigAttrib(mo_EGLDisplay, config, EGL_NATIVE_VISUAL_ID, &format);
mo_EGLSurface = eglCreateWindowSurface(mo_EGLDisplay, config, (EGLNativeWindowType) _ro_CreateConfig.GetWindow(), NULL);
const EGLint context_attrib_list[] = { 
        // request a context using Open GL ES 3.0
EGL_CONTEXT_CLIENT_VERSION, 3, 
EGL_NONE 
};
mo_EGLContext = eglCreateContext(mo_EGLDisplay, config, NULL, context_attrib_list);
 
 
by the way, I'm trying to figure out what's happening, with a TransformFeedback shader (SO = StreamOutput from DirectX terminology)
using a VertexBuffer (R8_UINT) containing values from 0 to 255 for a quad produces the right values
so at least, with a valid VertexBuffer, gl_VertexID (fourth output) is valid.
I will continue my tests tonight (french local time)
 
#version 300 es
layout(location = 0) in uint VS_INPUT_uiIndex ;
layout(location = 0) out float4 SO_TEXCOORD0 ;
void main()
{
int iVertexId = int( VS_INPUT_uiIndex );
ivec2  iPos =  ivec2 ( ((iVertexId * 2) & 2) * 2 - 1, 1 - ((iVertexId & 2) * 2) );
SO_TEXCOORD0  =  highp vec4 ( float(iVertexId),  highp vec2 (iPos), float( gl_VertexID ) );
}
 

 

  • Up0
  • Down0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Tue, 2014-11-04 13:26

Hi.

Just ran several tests on several devices (OpenGL ES 3.0)

The shader listed on the previous post runs fine on all devices (which implies both computation & transformfeedback process)

Changing the shader code (not the CPU code) with :

#version 300 es
layout(location = 0) out float4 SO_TEXCOORD0 ;
void main()
{
int iVertexId = int( gl_VertexID );
ivec2  iPos =  ivec2 ( ((iVertexId * 2) & 2) * 2 - 1, 1 - ((iVertexId & 2) * 2) );
SO_TEXCOORD0  =  highp vec4 ( float(iVertexId),  highp vec2 (iPos), float( gl_VertexID ) );
}
 
(vertexbuffer is set, but not read by the shader)

outputs only values "0", only on Adreno devices (Samsung Galaxy Tab Pro 8.4 & Kindle fire HDX), on other Android devices (Asus K010) it outputs correct values

(I'm not sure that the output buffer is overwritten with "0" or not updated at all)(will do other tests)

  • Up0
  • Down0
ronan.bel
Profile picture
Join Date: 24 Oct 14
Location: Montpellier
Posts: 13
Posted: Tue, 2014-11-04 13:46

I made the following test :

Shader1 : takes a VB as input, outputs results in a buffer

Shader2 : uses only gl_VertexID, outputs results in a buffer

on non-Adreno, both Shaders output correct values.

on Adreno, Shader1 outputs correct values, Shader2 outputs ZERO

on Adreno, running Shader1, then Shader2 with the same output buffer, gives correct values (values from Shader1)

so I assume that on Adreno, Shader2 outputs nothing (since output from Shader1 is not overwritten), thus Shader2 is not executed.

Am I correct ?

 

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