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
  • Having not used this before I don't have any kind of framework set up right now to test what I'm about to tell you, but according to the official spec, the format argument of glTexStorage2DMultisample is a sized internal format. As such you've already made the correct logical leap to using GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24,  or GL_DEPTH_COMPONENT32F in your glTexStorage2DMultisample call.


    It sounds like you already worked that part out, but that's the only advice I can give based on this tiny snippet. To know why nothing is showing up I'd have to see more code around what you're doing with the buffers to know what you'd expect to see.


    -Stacy

Reply
  • Having not used this before I don't have any kind of framework set up right now to test what I'm about to tell you, but according to the official spec, the format argument of glTexStorage2DMultisample is a sized internal format. As such you've already made the correct logical leap to using GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24,  or GL_DEPTH_COMPONENT32F in your glTexStorage2DMultisample call.


    It sounds like you already worked that part out, but that's the only advice I can give based on this tiny snippet. To know why nothing is showing up I'd have to see more code around what you're doing with the buffers to know what you'd expect to see.


    -Stacy

Children
No data