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 ?
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