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 ?
Did anyone go in depth with this ?
It's very hard to go in depth when you don't provide any examples of what is actually wrong. Debugging anything from a pile of text partially explaining a problem is impossible.
So basically I can't clear a multisampled texture ?
*EDITED* Based on your post the error for the clear happens after the error for texture storage, so I would guess your frame-buffer is failing a completeness check which makes it invalid for any rendering.
There's some other draw errors when using motion blur that could be investigated.
We're happy to help debug issues which look like Mali bugs, and we're generally happy to help on more generic graphics issues if you can provide a complete and specific example of what you have tried and where it is going wrong. We can't really help on generic application debug, sorry.
Is my app too complex of an example ? You just need to run it and tap the Antialiasing button and the bug will manifest itself (and spam the log)
As a side note, I tried making multisampled textures with GL_RGBA16UI and that works fine, GL_RGBA/GL_RGBA8 doesn't.
Based on the replies above and below we're trying to help you with the multi-sampling issue (as that is a specific problem). I was referring to the "other draw errors when using motion blur that could be investigated" - there are no details in your post about how the blur is supposed to work, what it is supposed to look like, what it is actually rendering, etc.
Most of us donate our spare time to answer questions in the forums - so we really don't want to spend an hour to reverse engineer a specific behavior out of a whole application, and which point we guess the problem it, only to find out later we guessed wrong. Please be specific about any issues you raise - it makes it much more likely we're able to help.
Kind regards, Pete