AnsweredAssumed Answered

i.MX6-Sabrelite OpenGL ES 3.0 integer texture

Question asked by Adrian Hodos on Nov 7, 2016
Latest reply on Nov 29, 2016 by Artur Petukhov

I'm using the following code to draw a full screen textured quad. This code works on my desktop (Nvidia GT 430), but gets me a black screen on the SabreLite.

 

uint8_t MEM_BUFF[1280 * 800 * 4];

memset(MEM_BUFF, 0xFF, sizeof(MEM_BUFF));

 

GLuint texHandle{};
glGenTextures(1, &texHandle);
glBindTexture(GL_TEXTURE_2D, texHandle);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8UI, 1280, 800);
glTexSubImage2D(GL_TEXTURE_2D,
                    0,
                    0,
                    0,
                    1280,
                    800,
                    GL_RGBA_INTEGER,
                    GL_UNSIGNED_BYTE,
                    MEM_BUFF);

 

And the following shader code :

 

#version 300 es

 

precision highp float;

 

out vec4 FragColor;
uniform highp usampler2D YFrameData;

 

void main() {
  ivec2 pixCoords = ivec2(gl_FragCoord.xy);
  uint Y = uint(texelFetch(YFrameData, pixCoords, 0).r);
  FragColor = vec4(float(Y) / 256.0f, 0.0f, 0.0f, 1.0f);
}

 

Am I doing something wrong ?

Outcomes