OpenGL: how to get number of samples of a Texture -
given opengl name of texture, how query whether texture multisample texture , how many samples allocated with?
you cannot query texture object find out what texture target is. that's have remember. if have been given texture, , don't know if gl_texture_2d_multisample
or not, only way find out try bind every single texture target. after each bind, check see if got opengl error. if didn't, that's right target.
once know target is, can query number of samples glgettexlevelparameter
mipmap level 0, using enum of gl_texture_samples
.
all of above true if don't have access arb_direct_state_access/opengl 4.5. newer apis, don't have know texture's target anymore. can call glgettexturelevelparameter
on texture object itself; if gl_texture_samples
parameter zero, not multisample image.
Comments
Post a Comment