Commit 12813d86 authored by Erik Faye-Lund 's avatar Erik Faye-Lund

gallium/u_blitter: set a more sane viewpor-transform state

This actually corresponds to a legal GL depth-range, because
rs_state.clip_halfz isn't set.
parent bed6b247
...@@ -786,16 +786,16 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx, ...@@ -786,16 +786,16 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx,
ctx->vertices[3][0][1] = (float)y2 / ctx->dst_height * 2.0f - 1.0f; /*v3.y*/ ctx->vertices[3][0][1] = (float)y2 / ctx->dst_height * 2.0f - 1.0f; /*v3.y*/
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
ctx->vertices[i][0][2] = depth; /*z*/ ctx->vertices[i][0][2] = depth * 2.0f - 1.0f; /*z*/
/* viewport */ /* viewport */
struct pipe_viewport_state viewport; struct pipe_viewport_state viewport;
viewport.scale[0] = 0.5f * ctx->dst_width; viewport.scale[0] = 0.5f * ctx->dst_width;
viewport.scale[1] = 0.5f * ctx->dst_height; viewport.scale[1] = 0.5f * ctx->dst_height;
viewport.scale[2] = 1.0f; viewport.scale[2] = 0.5f;
viewport.translate[0] = 0.5f * ctx->dst_width; viewport.translate[0] = 0.5f * ctx->dst_width;
viewport.translate[1] = 0.5f * ctx->dst_height; viewport.translate[1] = 0.5f * ctx->dst_height;
viewport.translate[2] = 0.0f; viewport.translate[2] = 0.5f;
ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &viewport); ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &viewport);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment