[Mesa-dev] [PATCH 03/12] gallium/u_blitter: remove blitter_context_priv::viewport

Marek Olšák maraeo at gmail.com
Fri Oct 6 14:10:06 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/gallium/auxiliary/util/u_blitter.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index 65938c5..9153ae1 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -118,23 +118,20 @@ struct blitter_context_priv
 
    /* Sampler state. */
    void *sampler_state;
    void *sampler_state_linear;
    void *sampler_state_rect;
    void *sampler_state_rect_linear;
 
    /* Rasterizer state. */
    void *rs_state, *rs_state_scissor, *rs_discard_state;
 
-   /* Viewport state. */
-   struct pipe_viewport_state viewport;
-
    /* Destination surface dimensions. */
    unsigned dst_width;
    unsigned dst_height;
 
    bool has_geometry_shader;
    bool has_tessellation;
    bool has_layered;
    bool has_stream_out;
    bool has_stencil_export;
    bool has_texture_multisample;
@@ -744,27 +741,28 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx,
    ctx->vertices[2][0][0] = (float)x2 / ctx->dst_width * 2.0f - 1.0f; /*v2.x*/
    ctx->vertices[2][0][1] = (float)y2 / ctx->dst_height * 2.0f - 1.0f; /*v2.y*/
 
    ctx->vertices[3][0][0] = (float)x1 / ctx->dst_width * 2.0f - 1.0f; /*v3.x*/
    ctx->vertices[3][0][1] = (float)y2 / ctx->dst_height * 2.0f - 1.0f; /*v3.y*/
 
    for (i = 0; i < 4; i++)
       ctx->vertices[i][0][2] = depth; /*z*/
 
    /* viewport */
-   ctx->viewport.scale[0] = 0.5f * ctx->dst_width;
-   ctx->viewport.scale[1] = 0.5f * ctx->dst_height;
-   ctx->viewport.scale[2] = 1.0f;
-   ctx->viewport.translate[0] = 0.5f * ctx->dst_width;
-   ctx->viewport.translate[1] = 0.5f * ctx->dst_height;
-   ctx->viewport.translate[2] = 0.0f;
-   ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &ctx->viewport);
+   struct pipe_viewport_state viewport;
+   viewport.scale[0] = 0.5f * ctx->dst_width;
+   viewport.scale[1] = 0.5f * ctx->dst_height;
+   viewport.scale[2] = 1.0f;
+   viewport.translate[0] = 0.5f * ctx->dst_width;
+   viewport.translate[1] = 0.5f * ctx->dst_height;
+   viewport.translate[2] = 0.0f;
+   ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &viewport);
 }
 
 static void blitter_set_clear_color(struct blitter_context_priv *ctx,
                                     const float color[4])
 {
    int i;
 
    if (color) {
       for (i = 0; i < 4; i++)
          memcpy(&ctx->vertices[i][1][0], color, sizeof(uint32_t) * 4);
-- 
2.7.4



More information about the mesa-dev mailing list