mesa/main: allow readpix/teximage to read from implicitly multisampled fbos
authorItalo Nicola <italonicola@collabora.com>
Tue, 21 Feb 2023 16:32:03 +0000 (16:32 +0000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 1 Aug 2023 21:22:28 +0000 (21:22 +0000)
commitd7b9da2673a8aef49f83dc043aae6ff4fcb212a3
tree257e25fdc2fe355e844084c2e5a898cf0a54ee6f
parent4d1a07c1a0ba6d308bed3ebbf77f24bb2ed03afc
mesa/main: allow readpix/teximage to read from implicitly multisampled fbos

The GL_EXT_multisampled_render_to_texture spec explicitly allow reading
from these FBOs.

"Similarly, for ReadPixels:
 'An INVALID_OPERATION error is generated if the value of READ_-
FRAMEBUFFER_BINDING (see section 9) is non-zero, the read framebuffer is
framebuffer complete, and the value of SAMPLE_BUFFERS for the read
framebuffer is one.'

 These errors do not apply to textures and renderbuffers that have
associated multisample data specified by the mechanisms described in
this extension, i.e., the above operations are allowed even when
SAMPLE_BUFFERS is non-zero for renderbuffers created via Renderbuffer-
StorageMultisampleEXT or textures attached via FramebufferTexture2D-
MultisampleEXT."

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10747>
src/mesa/main/framebuffer.c
src/mesa/main/framebuffer.h
src/mesa/main/readpix.c
src/mesa/main/teximage.c