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/accum.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/accum.c')
-rw-r--r-- | src/mesa/main/accum.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index f5ac8a10270..a0a206bea67 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -82,7 +82,8 @@ _mesa_clear_accum_buffer(struct gl_context *ctx) height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; ctx->Driver.MapRenderbuffer(ctx, accRb, x, y, width, height, - GL_MAP_WRITE_BIT, &accMap, &accRowStride); + GL_MAP_WRITE_BIT, &accMap, &accRowStride, + ctx->DrawBuffer->FlipY); if (!accMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); @@ -137,7 +138,8 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value, ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height, GL_MAP_READ_BIT | GL_MAP_WRITE_BIT, - &accMap, &accRowStride); + &accMap, &accRowStride, + ctx->DrawBuffer->FlipY); if (!accMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); @@ -206,7 +208,8 @@ accum_or_load(struct gl_context *ctx, GLfloat value, /* Map accum buffer */ ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height, - mappingFlags, &accMap, &accRowStride); + mappingFlags, &accMap, &accRowStride, + ctx->DrawBuffer->FlipY); if (!accMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); return; @@ -215,7 +218,8 @@ accum_or_load(struct gl_context *ctx, GLfloat value, /* Map color buffer */ ctx->Driver.MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height, GL_MAP_READ_BIT, - &colorMap, &colorRowStride); + &colorMap, &colorRowStride, + ctx->DrawBuffer->FlipY); if (!colorMap) { ctx->Driver.UnmapRenderbuffer(ctx, accRb); _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); @@ -288,7 +292,7 @@ accum_return(struct gl_context *ctx, GLfloat value, /* Map accum buffer */ ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height, GL_MAP_READ_BIT, - &accMap, &accRowStride); + &accMap, &accRowStride, fb->FlipY); if (!accMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); return; @@ -308,7 +312,8 @@ accum_return(struct gl_context *ctx, GLfloat value, /* Map color buffer */ ctx->Driver.MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height, - mappingFlags, &colorMap, &colorRowStride); + mappingFlags, &colorMap, &colorRowStride, + fb->FlipY); if (!colorMap) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum"); continue; |