From 318c265160ed33a2d9f7d664e1b247cbbc38203f Mon Sep 17 00:00:00 2001 From: Fritz Koenig Date: Mon, 23 Jul 2018 10:10:54 -0700 Subject: mesa: GL_MESA_framebuffer_flip_y extension [v4] Adds an extension to glFramebufferParameteri that will specify if the framebuffer is vertically flipped. Historically system framebuffers are vertically flipped and user framebuffers are not. Checking to see the state was done by looking at the name field. This adds an explicit field. v2: * updated spec language [for chadv] * correctly specifying ES 3.1 [for chadv] * refactor access to rb->Name [for jason] * handle GetFramebufferParameteriv [for chadv] v3: * correct _mesa_GetMultisamplefv [for kusmabite] v4: * update spec language [for chadv] * s/GLboolean/bool/g [for chadv] * s/InvertedY/FlipY/g [for chadv] * s/inverted_y/flip_y/g [for chadv] * assert changes [for chadv] Reviewed-by: Chad Versace --- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_fbo.c') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index c78d4baa124..77e7be1124c 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -133,13 +133,17 @@ nouveau_renderbuffer_map(struct gl_context *ctx, GLuint x, GLuint y, GLuint w, GLuint h, GLbitfield mode, GLubyte **out_map, - GLint *out_stride) + GLint *out_stride, + bool flip_y) { struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface; GLubyte *map; int stride; int flags = 0; + /* driver does not support GL_FRAMEBUFFER_FLIP_Y_MESA */ + assert((rb->Name == 0) == flip_y); + if (mode & GL_MAP_READ_BIT) flags |= NOUVEAU_BO_RD; if (mode & GL_MAP_WRITE_BIT) -- cgit v1.2.3