This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GLES3+ GL_DEPTH_COMPONENT16-32 on Nexus 10/Mali T604

So I'm trying to create a Multisampled depth texture and I'm seeing some oddities.

First off, this GLES2-like call works :

glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, Width, Height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL );

But then I can't use it for the multisampled texture :

glTexStorage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, 4, GL_DEPTH_COMPONENT, Width, Height, GL_TRUE );

It throws GL_INVALID_ENUM and reading the docs it can only be from texture target which is ok so the next wrong thing is GL_DEPTH_COMPONENT .

Then I tried creating GL_DEPTH_COMPONENT16,24 and 32 textures

glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT16, Width, Height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL );

glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, Width, Height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL );

glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, Width, Height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL );

And while they all work I don't see my depth buffer based effects like depth of field so I can only assume the values are either not being saved (all 0s) or the format is wrong, like I would need an integer sampler. I am expecting in these scenarios to use a standard sampler2D and get a .r-only texture with values from 0..1 . I have the exact same issue with Qualcomm's Adreno 320, but I don't have it with Apple's A7 GPU or my AMD R9 280X.

Am I doing something wrong ?

Parents
  • Did anyone go in depth with this ? I now get even more odd results (I did change some shaders and the draw call contents may be a bit different now) when I'm just using multisampled textures for antialiasing. What I basically do is the same thing, I create color and depth multisampled textures with 4 samples like :

    glTexStorage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, 4, GL_DEPTH_COMPONENT, Width, Height, GL_TRUE );

    and I get  :

    My debug message : Calling glTexStorage2DMultisample TextureTarget=37120 GLInternalFormat=6402 ( 6402 is GL_RGBA, I tried that and also GL_RGBA8, same result )

    KHR_debug callback : Source=OpenGL Type=Error Severity=high ID=33350 Message=Error:glTexStorage2DMultisample::<internalformat> is not an accepted value

    01-19 04:18:43.778: I/com.re3.benchmark(6877): GLDebugCallback Source=OpenGL Type=Error Severity=high ID=33350 Message=Error:glClear::currently bound framebuffer is not valid for this operation

    So basically I can't clear a multisampled texture ? odd

    My app will be updated soon here ( RE3 Benchmark ) with code that uses multisampled textures on just GL ES 3.1 (and renderbuffers otherwise). There's some other draw errors when using motion blur that could be investigated.

Reply
  • Did anyone go in depth with this ? I now get even more odd results (I did change some shaders and the draw call contents may be a bit different now) when I'm just using multisampled textures for antialiasing. What I basically do is the same thing, I create color and depth multisampled textures with 4 samples like :

    glTexStorage2DMultisample( GL_TEXTURE_2D_MULTISAMPLE, 4, GL_DEPTH_COMPONENT, Width, Height, GL_TRUE );

    and I get  :

    My debug message : Calling glTexStorage2DMultisample TextureTarget=37120 GLInternalFormat=6402 ( 6402 is GL_RGBA, I tried that and also GL_RGBA8, same result )

    KHR_debug callback : Source=OpenGL Type=Error Severity=high ID=33350 Message=Error:glTexStorage2DMultisample::<internalformat> is not an accepted value

    01-19 04:18:43.778: I/com.re3.benchmark(6877): GLDebugCallback Source=OpenGL Type=Error Severity=high ID=33350 Message=Error:glClear::currently bound framebuffer is not valid for this operation

    So basically I can't clear a multisampled texture ? odd

    My app will be updated soon here ( RE3 Benchmark ) with code that uses multisampled textures on just GL ES 3.1 (and renderbuffers otherwise). There's some other draw errors when using motion blur that could be investigated.

Children