I want to use bindless textures and multisampling. But Strange stuff happens.
My Texture that is supposed to be bindless:
glBindTexture(GL_TEXTURE_2D, texResolve);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, 0);
GLuint64 texResolveHandle = glGetTextureHandleARB(texResolve);
GL_CHECK_ERROR("after glGetTextureHandleARB");
//glMakeTextureHandleResidentARB(texResolveHandle);
//glMakeTextureHandleNonResidentARB(texResolveHandle);
GL_CHECK_ERROR("after glMakeTextureHandleResidentARB");
//All good so far!
Now I cerate my multisample Texture and things are getting strange:
glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, texMSAA);
GL_CHECK_ERROR("after glTexImage2DMultisample 1"); //still ok
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
GL_CHECK_ERROR("after glTexImage2DMultisample 2"); //ERROR
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
GL_CHECK_ERROR("after glTexImage2DMultisample 3"); //ERROR
glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA8, width, height, false);
GL_CHECK_ERROR("after glTexImage2DMultisample texMSAA"); //Again OK ????
So, my question: What is happening?
Best Regards