diff options
author | Fritz Koenig <[email protected]> | 2018-07-23 10:10:54 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2018-07-27 12:32:25 -0700 |
commit | 318c265160ed33a2d9f7d664e1b247cbbc38203f (patch) | |
tree | 161a55c710b3e7764602afe676a58d75e5f44a8c /src/mesa/main/readpix.c | |
parent | 7953399e599862769bc29f5f98322adbcf6c3951 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r-- | src/mesa/main/readpix.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index c5fc66988b7..e8c28d86162 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -234,7 +234,7 @@ readpixels_memcpy(struct gl_context *ctx, format, type, 0, 0); ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &stride); + &map, &stride, ctx->ReadBuffer->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return GL_TRUE; /* don't bother trying the slow path */ @@ -285,7 +285,7 @@ read_uint_depth_pixels( struct gl_context *ctx, return GL_FALSE; ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &stride); + &map, &stride, fb->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); @@ -343,7 +343,7 @@ read_depth_pixels( struct gl_context *ctx, GL_DEPTH_COMPONENT, type, 0, 0); ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &stride); + &map, &stride, fb->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; @@ -391,7 +391,7 @@ read_stencil_pixels( struct gl_context *ctx, return; ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &stride); + &map, &stride, fb->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; @@ -462,7 +462,7 @@ read_rgba_pixels( struct gl_context *ctx, /* Map the source render buffer */ ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &rb_stride); + &map, &rb_stride, fb->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; @@ -652,7 +652,7 @@ fast_read_depth_stencil_pixels(struct gl_context *ctx, return GL_FALSE; ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, - &map, &stride); + &map, &stride, fb->FlipY); if (!map) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return GL_TRUE; /* don't bother trying the slow path */ @@ -692,14 +692,14 @@ fast_read_depth_stencil_pixels_separate(struct gl_context *ctx, return GL_FALSE; ctx->Driver.MapRenderbuffer(ctx, depthRb, x, y, width, height, - GL_MAP_READ_BIT, &depthMap, &depthStride); + GL_MAP_READ_BIT, &depthMap, &depthStride, fb->FlipY); if (!depthMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return GL_TRUE; /* don't bother trying the slow path */ } ctx->Driver.MapRenderbuffer(ctx, stencilRb, x, y, width, height, - GL_MAP_READ_BIT, &stencilMap, &stencilStride); + GL_MAP_READ_BIT, &stencilMap, &stencilStride, fb->FlipY); if (!stencilMap) { ctx->Driver.UnmapRenderbuffer(ctx, depthRb); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); @@ -756,7 +756,7 @@ slow_read_depth_stencil_pixels_separate(struct gl_context *ctx, * If one buffer, only map it once. */ ctx->Driver.MapRenderbuffer(ctx, depthRb, x, y, width, height, - GL_MAP_READ_BIT, &depthMap, &depthStride); + GL_MAP_READ_BIT, &depthMap, &depthStride, fb->FlipY); if (!depthMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); return; @@ -765,7 +765,7 @@ slow_read_depth_stencil_pixels_separate(struct gl_context *ctx, if (stencilRb != depthRb) { ctx->Driver.MapRenderbuffer(ctx, stencilRb, x, y, width, height, GL_MAP_READ_BIT, &stencilMap, - &stencilStride); + &stencilStride, fb->FlipY); if (!stencilMap) { ctx->Driver.UnmapRenderbuffer(ctx, depthRb); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glReadPixels"); |