diff options
author | Ian Romanick <[email protected]> | 2017-06-02 16:21:25 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-14 15:35:43 +0000 |
commit | 5be77851907ef4401596c88916b682a311449b1f (patch) | |
tree | 15f2fb6966659dac79b0308ab1b7308ce96fd53d /src/mesa | |
parent | e5d2fbf3528ed96f6b0afc953232983b8753b03a (diff) |
meta: Use same vertex coordinates for GLSL and FF clears
text data bss dec hex filename
12243446 1344936 1290748 14879130 e3099a before/lib64/dri/i965_dri.so
12243286 1344936 1290748 14878970 e308fa after/lib64/dri/i965_dri.so
Reviewed-by: Jason Ekstrand <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/856>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/common/meta.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index aecc6d10b1c..6d1ad339e57 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1679,7 +1679,6 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl) GLbitfield metaSave; const GLuint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; struct gl_framebuffer *fb = ctx->DrawBuffer; - float x0, y0, x1, y1, z; struct vertex verts[4]; int i; @@ -1715,21 +1714,12 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl) assert(!fb->_IntegerBuffers); if (glsl) { meta_glsl_clear_init(ctx, clear); - - x0 = ((float) fb->_Xmin / fb->Width) * 2.0f - 1.0f; - y0 = ((float) fb->_Ymin / fb->Height) * 2.0f - 1.0f; - x1 = ((float) fb->_Xmax / fb->Width) * 2.0f - 1.0f; - y1 = ((float) fb->_Ymax / fb->Height) * 2.0f - 1.0f; - z = -invert_z(ctx->Depth.Clear); } else { _mesa_meta_setup_vertex_objects(ctx, &clear->VAO, &clear->buf_obj, false, 3, 0, 4); - x0 = (float) fb->_Xmin; - y0 = (float) fb->_Ymin; - x1 = (float) fb->_Xmax; - y1 = (float) fb->_Ymax; - z = invert_z(ctx->Depth.Clear); + /* setup projection matrix */ + _mesa_load_identity_matrix(ctx, &ctx->ProjectionMatrixStack); } if (glsl) { @@ -1776,6 +1766,12 @@ meta_clear(struct gl_context *ctx, GLbitfield buffers, bool glsl) } /* vertex positions */ + const float x0 = ((float) fb->_Xmin / fb->Width) * 2.0f - 1.0f; + const float y0 = ((float) fb->_Ymin / fb->Height) * 2.0f - 1.0f; + const float x1 = ((float) fb->_Xmax / fb->Width) * 2.0f - 1.0f; + const float y1 = ((float) fb->_Ymax / fb->Height) * 2.0f - 1.0f; + const float z = -invert_z(ctx->Depth.Clear); + verts[0].x = x0; verts[0].y = y0; verts[0].z = z; |