mirror of
https://github.com/brl/mutter.git
synced 2025-08-12 11:24:40 +00:00
offscreen: Adds support for offscreen multisampling
This adds support for multisample rendering to offscreen framebuffers. After an offscreen framebuffer is first instantiated using cogl_offscreen_new_to_texture() it is then possible to use cogl_framebuffer_set_samples_per_pixel() to request multisampling before the framebuffer is allocated. This also adds cogl_framebuffer_resolve_samples() for explicitly resolving point samples into pixels. Even though we currently only support the IMG_multisampled_render_to_texture extension which doesn't require an explicit resolve, the plan is to also support the EXT_framebuffer_multisample extension which uses the framebuffer_blit extension to issue an explicit resolve. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
@@ -333,18 +333,6 @@ COGL_EXT_FUNCTION (void, glBlitFramebuffer,
|
||||
GLenum filter))
|
||||
COGL_EXT_END ()
|
||||
|
||||
COGL_EXT_BEGIN (offscreen_multisample, 255, 255,
|
||||
0, /* not in either GLES */
|
||||
"EXT\0",
|
||||
"framebuffer_multisample\0")
|
||||
COGL_EXT_FUNCTION (void, glRenderbufferStorageMultisample,
|
||||
(GLenum target,
|
||||
GLsizei samples,
|
||||
GLenum internalformat,
|
||||
GLsizei width,
|
||||
GLsizei height))
|
||||
COGL_EXT_END ()
|
||||
|
||||
/* ARB_fragment_program */
|
||||
COGL_EXT_BEGIN (arbfp, 255, 255,
|
||||
0, /* not in either GLES */
|
||||
@@ -660,3 +648,21 @@ COGL_EXT_FUNCTION (void, glDiscardFramebuffer,
|
||||
const GLenum *attachments))
|
||||
COGL_EXT_END ()
|
||||
|
||||
COGL_EXT_BEGIN (IMG_multisampled_render_to_texture, 255, 255,
|
||||
0, /* not in either GLES */
|
||||
"\0",
|
||||
"IMG_multisampled_render_to_texture\0")
|
||||
COGL_EXT_FUNCTION (void, glRenderbufferStorageMultisampleIMG,
|
||||
(GLenum target,
|
||||
GLsizei samples,
|
||||
GLenum internal_format,
|
||||
GLsizei width,
|
||||
GLsizei height))
|
||||
COGL_EXT_FUNCTION (void, glFramebufferTexture2DMultisampleIMG,
|
||||
(GLenum target,
|
||||
GLenum attachment,
|
||||
GLenum textarget,
|
||||
GLuint texture,
|
||||
GLint level,
|
||||
GLsizei samples))
|
||||
COGL_EXT_END ()
|
||||
|
Reference in New Issue
Block a user