When using multisampled textures, do i need to set samplers ( to number which i am using in glTexImage2DMultisample ) ? because i am assuming it needs to be set in MSAA. Please correct me if wrong. I have no idea how internally multisampling works..

When just reading from multisample textures in a shader (what it sounds like you want to do), you can forget anything you might know (or not know) about multisample rasterization -- it doesn't matter. Conceptually you just have a texture where instead of having 1 vector value per pixel you have N vector values per pixel, where N is the number of samples per pixel you allocated for that multisample texture.

To fetch the Nth sample from a particular pixel, just bind the multisample texture handle (what you get from glGenTextures) to a texture unit, and then in the shader, call texelFetch with the integer texcoord ("P") addressing the specific pixel and the "sample" argument being the sample index within that pixel.

When just reading from multisample textures in a shader (what it sounds like you want to do), you can forget anything you might know (or not know) about multisample rasterization -- it doesn't matter. Conceptually you just have a texture where instead of having 1 vector value per pixel you have N vector values per pixel, where N is the number of samples per pixel you allocated for that multisample texture.

To fetch the Nth sample from a particular pixel, just bind the multisample texture handle (what you get from glGenTextures) to a texture unit, and then in the shader, call texelFetch with the integer texcoord ("P") addressing the specific pixel and the "sample" argument being the sample index within that pixel.

Thanks, I mean to say do i need to set number of samples to 4 or 8 (instead of 1) while creating context in my config attributes?