[Mesa-dev] [PATCH] gallium: remove unused pipe_viewport_state::translate[3] and scale[3]
Marek Olšák
maraeo at gmail.com
Sun Nov 9 15:39:36 PST 2014
From: Marek Olšák <marek.olsak at amd.com>
Almost all drivers ignore them.
---
src/gallium/auxiliary/draw/draw_context.c | 4 +---
src/gallium/auxiliary/hud/hud_context.c | 2 --
src/gallium/auxiliary/postprocess/pp_init.c | 2 --
src/gallium/auxiliary/util/u_blit.c | 2 --
src/gallium/auxiliary/util/u_blitter.c | 2 --
src/gallium/auxiliary/util/u_tests.c | 2 --
src/gallium/auxiliary/vl/vl_compositor.c | 2 --
src/gallium/auxiliary/vl/vl_deint_filter.c | 1 -
src/gallium/auxiliary/vl/vl_idct.c | 2 --
src/gallium/auxiliary/vl/vl_matrix_filter.c | 1 -
src/gallium/auxiliary/vl/vl_mc.c | 2 --
src/gallium/auxiliary/vl/vl_median_filter.c | 1 -
src/gallium/auxiliary/vl/vl_zscan.c | 2 --
src/gallium/drivers/ilo/ilo_blitter_rectlist.c | 1 -
src/gallium/drivers/nouveau/nv30/nv30_state_validate.c | 4 ++--
src/gallium/drivers/radeon/r600_pipe_common.c | 2 --
src/gallium/include/pipe/p_state.h | 4 ++--
src/gallium/state_trackers/nine/nine_state.c | 2 --
src/gallium/state_trackers/vega/renderer.c | 2 --
src/gallium/state_trackers/xa/xa_renderer.c | 2 --
src/gallium/tests/graw/fs-test.c | 2 --
src/gallium/tests/graw/graw_util.h | 2 --
src/gallium/tests/graw/gs-test.c | 2 --
src/gallium/tests/graw/quad-sample.c | 2 --
src/gallium/tests/graw/shader-leak.c | 2 --
src/gallium/tests/graw/tri-gs.c | 2 --
src/gallium/tests/graw/tri-instanced.c | 2 --
src/gallium/tests/graw/vs-test.c | 2 --
src/gallium/tests/trivial/quad-tex.c | 2 --
src/gallium/tests/trivial/tri.c | 2 --
src/mesa/state_tracker/st_atom_viewport.c | 2 --
src/mesa/state_tracker/st_cb_bitmap.c | 2 --
src/mesa/state_tracker/st_cb_clear.c | 2 --
src/mesa/state_tracker/st_cb_drawpixels.c | 2 --
src/mesa/state_tracker/st_cb_drawtex.c | 2 --
35 files changed, 5 insertions(+), 67 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 20dea66..92d7a4f 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -373,11 +373,9 @@ void draw_set_viewport_states( struct draw_context *draw,
(viewport->scale[0] == 1.0f &&
viewport->scale[1] == 1.0f &&
viewport->scale[2] == 1.0f &&
- viewport->scale[3] == 1.0f &&
viewport->translate[0] == 0.0f &&
viewport->translate[1] == 0.0f &&
- viewport->translate[2] == 0.0f &&
- viewport->translate[3] == 0.0f);
+ viewport->translate[2] == 0.0f);
draw->driver.bypass_clip_xy = vps[0].scale[3] == 0.0f;
draw->clip_xy = !draw->driver.bypass_clip_xy;
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 18a8781..98678fc 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -444,11 +444,9 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
viewport.scale[0] = 0.5f * hud->fb_width;
viewport.scale[1] = 0.5f * hud->fb_height;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.5f * hud->fb_width;
viewport.translate[1] = 0.5f * hud->fb_height;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
cso_set_framebuffer(cso, &fb);
cso_set_sample_mask(cso, ~0);
diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c
index 05a0830..bdf66e6 100644
--- a/src/gallium/auxiliary/postprocess/pp_init.c
+++ b/src/gallium/auxiliary/postprocess/pp_init.c
@@ -324,8 +324,6 @@ pp_init_fbos(struct pp_queue_t *ppq, unsigned int w,
p->viewport.scale[0] = p->viewport.translate[0] = (float) w / 2.0f;
p->viewport.scale[1] = p->viewport.translate[1] = (float) h / 2.0f;
- p->viewport.scale[3] = 1.0f;
- p->viewport.translate[3] = 0.0f;
ppq->fbos_init = true;
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index 020e5f7..90408ff 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -559,11 +559,9 @@ util_blit_pixels_tex(struct blit_state *ctx,
ctx->viewport.scale[0] = 0.5f * dst->width;
ctx->viewport.scale[1] = 0.5f * dst->height;
ctx->viewport.scale[2] = 0.5f;
- ctx->viewport.scale[3] = 1.0f;
ctx->viewport.translate[0] = 0.5f * dst->width;
ctx->viewport.translate[1] = 0.5f * dst->height;
ctx->viewport.translate[2] = 0.5f;
- ctx->viewport.translate[3] = 0.0f;
cso_set_viewport(ctx->cso, &ctx->viewport);
/* texture */
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index b4598b8..c66cbaa 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -696,11 +696,9 @@ static void blitter_set_rectangle(struct blitter_context_priv *ctx,
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.scale[3] = 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->viewport.translate[3] = 0.0f;
ctx->base.pipe->set_viewport_states(ctx->base.pipe, 0, 1, &ctx->viewport);
}
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 9483f06..c0f6327 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -114,11 +114,9 @@ util_set_max_viewport(struct cso_context *cso, struct pipe_resource *tex)
viewport.scale[0] = 0.5f * tex->width0;
viewport.scale[1] = 0.5f * tex->height0;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.5f * tex->width0;
viewport.translate[1] = 0.5f * tex->height0;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
cso_set_viewport(cso, &viewport);
}
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 6bd1a88..69839e6 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -829,9 +829,7 @@ vl_compositor_clear_layers(struct vl_compositor_state *s)
s->layers[i].blend = NULL;
s->layers[i].fs = NULL;
s->layers[i].viewport.scale[2] = 1;
- s->layers[i].viewport.scale[3] = 1;
s->layers[i].viewport.translate[2] = 0;
- s->layers[i].viewport.translate[3] = 0;
s->layers[i].rotate = VL_COMPOSITOR_ROTATE_0;
for ( j = 0; j < 3; j++)
diff --git a/src/gallium/auxiliary/vl/vl_deint_filter.c b/src/gallium/auxiliary/vl/vl_deint_filter.c
index a455424..8fa70e8 100644
--- a/src/gallium/auxiliary/vl/vl_deint_filter.c
+++ b/src/gallium/auxiliary/vl/vl_deint_filter.c
@@ -443,7 +443,6 @@ vl_deint_filter_render(struct vl_deint_filter *filter,
/* prepare viewport */
memset(&viewport, 0, sizeof(viewport));
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
/* prepare framebuffer */
memset(&fb_state, 0, sizeof(fb_state));
diff --git a/src/gallium/auxiliary/vl/vl_idct.c b/src/gallium/auxiliary/vl/vl_idct.c
index 1212e5b..948a5a4 100644
--- a/src/gallium/auxiliary/vl/vl_idct.c
+++ b/src/gallium/auxiliary/vl/vl_idct.c
@@ -609,7 +609,6 @@ init_source(struct vl_idct *idct, struct vl_idct_buffer *buffer)
buffer->viewport_mismatch.scale[0] = tex->width0;
buffer->viewport_mismatch.scale[1] = tex->height0;
buffer->viewport_mismatch.scale[2] = 1;
- buffer->viewport_mismatch.scale[3] = 1;
return true;
}
@@ -653,7 +652,6 @@ init_intermediate(struct vl_idct *idct, struct vl_idct_buffer *buffer)
buffer->viewport.scale[0] = tex->width0;
buffer->viewport.scale[1] = tex->height0;
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
return true;
diff --git a/src/gallium/auxiliary/vl/vl_matrix_filter.c b/src/gallium/auxiliary/vl/vl_matrix_filter.c
index 6d55116..52ce454 100644
--- a/src/gallium/auxiliary/vl/vl_matrix_filter.c
+++ b/src/gallium/auxiliary/vl/vl_matrix_filter.c
@@ -296,7 +296,6 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter,
viewport.scale[0] = dst->width;
viewport.scale[1] = dst->height;
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
memset(&fb_state, 0, sizeof(fb_state));
fb_state.width = dst->width;
diff --git a/src/gallium/auxiliary/vl/vl_mc.c b/src/gallium/auxiliary/vl/vl_mc.c
index 11f1232..6c317bb 100644
--- a/src/gallium/auxiliary/vl/vl_mc.c
+++ b/src/gallium/auxiliary/vl/vl_mc.c
@@ -554,11 +554,9 @@ vl_mc_init_buffer(struct vl_mc *renderer, struct vl_mc_buffer *buffer)
assert(renderer && buffer);
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
buffer->viewport.translate[0] = 0;
buffer->viewport.translate[1] = 0;
buffer->viewport.translate[2] = 0;
- buffer->viewport.translate[3] = 0;
buffer->fb_state.nr_cbufs = 1;
buffer->fb_state.zsbuf = NULL;
diff --git a/src/gallium/auxiliary/vl/vl_median_filter.c b/src/gallium/auxiliary/vl/vl_median_filter.c
index a79886f..aa9a6b2 100644
--- a/src/gallium/auxiliary/vl/vl_median_filter.c
+++ b/src/gallium/auxiliary/vl/vl_median_filter.c
@@ -375,7 +375,6 @@ vl_median_filter_render(struct vl_median_filter *filter,
viewport.scale[0] = dst->width;
viewport.scale[1] = dst->height;
viewport.scale[2] = 1;
- viewport.scale[3] = 1;
memset(&fb_state, 0, sizeof(fb_state));
fb_state.width = dst->width;
diff --git a/src/gallium/auxiliary/vl/vl_zscan.c b/src/gallium/auxiliary/vl/vl_zscan.c
index 2e09481..1c6cdd4 100644
--- a/src/gallium/auxiliary/vl/vl_zscan.c
+++ b/src/gallium/auxiliary/vl/vl_zscan.c
@@ -470,11 +470,9 @@ vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
buffer->viewport.scale[0] = dst->width;
buffer->viewport.scale[1] = dst->height;
buffer->viewport.scale[2] = 1;
- buffer->viewport.scale[3] = 1;
buffer->viewport.translate[0] = 0;
buffer->viewport.translate[1] = 0;
buffer->viewport.translate[2] = 0;
- buffer->viewport.translate[3] = 0;
buffer->fb_state.width = dst->width;
buffer->fb_state.height = dst->height;
diff --git a/src/gallium/drivers/ilo/ilo_blitter_rectlist.c b/src/gallium/drivers/ilo/ilo_blitter_rectlist.c
index 5ce8b53..7a298af 100644
--- a/src/gallium/drivers/ilo/ilo_blitter_rectlist.c
+++ b/src/gallium/drivers/ilo/ilo_blitter_rectlist.c
@@ -78,7 +78,6 @@ ilo_blitter_set_invariants(struct ilo_blitter *blitter)
vp.scale[0] = 1.0f;
vp.scale[1] = 1.0f;
vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
ilo_gpe_set_viewport_cso(blitter->ilo->dev, &vp, &blitter->viewport);
blitter->initialized = true;
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
index f227559..6df0c47 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_state_validate.c
@@ -254,11 +254,11 @@ nv30_validate_viewport(struct nv30_context *nv30)
PUSH_DATAf(push, vp->translate[0]);
PUSH_DATAf(push, vp->translate[1]);
PUSH_DATAf(push, vp->translate[2]);
- PUSH_DATAf(push, vp->translate[3]);
+ PUSH_DATAf(push, 1.0f);
PUSH_DATAf(push, vp->scale[0]);
PUSH_DATAf(push, vp->scale[1]);
PUSH_DATAf(push, vp->scale[2]);
- PUSH_DATAf(push, vp->scale[3]);
+ PUSH_DATAf(push, 1.0f);
BEGIN_NV04(push, NV30_3D(DEPTH_RANGE_NEAR), 2);
PUSH_DATAf(push, vp->translate[2] - fabsf(vp->scale[2]));
PUSH_DATAf(push, vp->translate[2] + fabsf(vp->scale[2]));
diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c b/src/gallium/drivers/radeon/r600_pipe_common.c
index f9393e6..8aad178 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -65,11 +65,9 @@ void r600_draw_rectangle(struct blitter_context *blitter,
viewport.scale[0] = 1.0f;
viewport.scale[1] = 1.0f;
viewport.scale[2] = 1.0f;
- viewport.scale[3] = 1.0f;
viewport.translate[0] = 0.0f;
viewport.translate[1] = 0.0f;
viewport.translate[2] = 0.0f;
- viewport.translate[3] = 0.0f;
rctx->b.set_viewport_states(&rctx->b, 0, 1, &viewport);
/* Upload vertices. The hw rectangle has only 3 vertices,
diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h
index b7adb99..aff9b55 100644
--- a/src/gallium/include/pipe/p_state.h
+++ b/src/gallium/include/pipe/p_state.h
@@ -167,8 +167,8 @@ struct pipe_poly_stipple
struct pipe_viewport_state
{
- float scale[4];
- float translate[4];
+ float scale[3];
+ float translate[3];
};
diff --git a/src/gallium/state_trackers/nine/nine_state.c b/src/gallium/state_trackers/nine/nine_state.c
index 0215d08..aca879d 100644
--- a/src/gallium/state_trackers/nine/nine_state.c
+++ b/src/gallium/state_trackers/nine/nine_state.c
@@ -141,11 +141,9 @@ update_viewport(struct NineDevice9 *device)
pvport.scale[0] = (float)vport->Width * 0.5f;
pvport.scale[1] = (float)vport->Height * -0.5f;
pvport.scale[2] = vport->MaxZ - vport->MinZ;
- pvport.scale[3] = 1.0f;
pvport.translate[0] = (float)vport->Width * 0.5f + (float)vport->X;
pvport.translate[1] = (float)vport->Height * 0.5f + (float)vport->Y;
pvport.translate[2] = vport->MinZ;
- pvport.translate[3] = 0.0f;
pipe->set_viewport_states(pipe, 0, 1, &pvport);
}
diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c
index 931924c..d369c32 100644
--- a/src/gallium/state_trackers/vega/renderer.c
+++ b/src/gallium/state_trackers/vega/renderer.c
@@ -348,11 +348,9 @@ static void vg_set_viewport(struct renderer *r,
viewport.scale[0] = fb->width / 2.f;
viewport.scale[1] = fb->height / y_scale;
viewport.scale[2] = 1.0;
- viewport.scale[3] = 1.0;
viewport.translate[0] = fb->width / 2.f;
viewport.translate[1] = fb->height / 2.f;
viewport.translate[2] = 0.0;
- viewport.translate[3] = 0.0;
cso_set_viewport(r->cso, &viewport);
}
diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c
index 780b247..7b28afc 100644
--- a/src/gallium/state_trackers/xa/xa_renderer.c
+++ b/src/gallium/state_trackers/xa/xa_renderer.c
@@ -361,11 +361,9 @@ renderer_bind_destination(struct xa_context *r,
viewport.scale[0] = width / 2.f;
viewport.scale[1] = height / 2.f;
viewport.scale[2] = 1.0;
- viewport.scale[3] = 1.0;
viewport.translate[0] = width / 2.f;
viewport.translate[1] = height / 2.f;
viewport.translate[2] = 0.0;
- viewport.translate[3] = 0.0;
/* Constant buffer set up to match viewport dimensions:
*/
diff --git a/src/gallium/tests/graw/fs-test.c b/src/gallium/tests/graw/fs-test.c
index e335bc6..97306c4 100644
--- a/src/gallium/tests/graw/fs-test.c
+++ b/src/gallium/tests/graw/fs-test.c
@@ -143,12 +143,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/graw_util.h b/src/gallium/tests/graw/graw_util.h
index 1856f0d..72b6bc6 100644
--- a/src/gallium/tests/graw/graw_util.h
+++ b/src/gallium/tests/graw/graw_util.h
@@ -196,12 +196,10 @@ graw_util_viewport(struct graw_info *info,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
info->ctx->set_viewport_states(info->ctx, 0, 1, &vp);
}
diff --git a/src/gallium/tests/graw/gs-test.c b/src/gallium/tests/graw/gs-test.c
index c522a8f..9200685 100644
--- a/src/gallium/tests/graw/gs-test.c
+++ b/src/gallium/tests/graw/gs-test.c
@@ -218,12 +218,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/quad-sample.c b/src/gallium/tests/graw/quad-sample.c
index 4d5a597..787d811 100644
--- a/src/gallium/tests/graw/quad-sample.c
+++ b/src/gallium/tests/graw/quad-sample.c
@@ -71,12 +71,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/shader-leak.c b/src/gallium/tests/graw/shader-leak.c
index fce3683..90704a3 100644
--- a/src/gallium/tests/graw/shader-leak.c
+++ b/src/gallium/tests/graw/shader-leak.c
@@ -61,12 +61,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/tri-gs.c b/src/gallium/tests/graw/tri-gs.c
index ab92dd0..7fe340d 100644
--- a/src/gallium/tests/graw/tri-gs.c
+++ b/src/gallium/tests/graw/tri-gs.c
@@ -62,12 +62,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/tri-instanced.c b/src/gallium/tests/graw/tri-instanced.c
index d7cad81..65c5936 100644
--- a/src/gallium/tests/graw/tri-instanced.c
+++ b/src/gallium/tests/graw/tri-instanced.c
@@ -91,12 +91,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/graw/vs-test.c b/src/gallium/tests/graw/vs-test.c
index 187759d..cac432e 100644
--- a/src/gallium/tests/graw/vs-test.c
+++ b/src/gallium/tests/graw/vs-test.c
@@ -129,12 +129,10 @@ static void set_viewport( float x, float y,
vp.scale[0] = half_width;
vp.scale[1] = half_height;
vp.scale[2] = half_depth;
- vp.scale[3] = 1.0f;
vp.translate[0] = half_width + x;
vp.translate[1] = half_height + y;
vp.translate[2] = half_depth + z;
- vp.translate[3] = 0.0f;
ctx->set_viewport_states( ctx, 0, 1, &vp );
}
diff --git a/src/gallium/tests/trivial/quad-tex.c b/src/gallium/tests/trivial/quad-tex.c
index 1d52aff..c09e09a 100644
--- a/src/gallium/tests/trivial/quad-tex.c
+++ b/src/gallium/tests/trivial/quad-tex.c
@@ -243,12 +243,10 @@ static void init_prog(struct program *p)
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
diff --git a/src/gallium/tests/trivial/tri.c b/src/gallium/tests/trivial/tri.c
index 062d45d..dcc5a22 100644
--- a/src/gallium/tests/trivial/tri.c
+++ b/src/gallium/tests/trivial/tri.c
@@ -188,12 +188,10 @@ static void init_prog(struct program *p)
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
diff --git a/src/mesa/state_tracker/st_atom_viewport.c b/src/mesa/state_tracker/st_atom_viewport.c
index ba945f5..5fb4cdc 100644
--- a/src/mesa/state_tracker/st_atom_viewport.c
+++ b/src/mesa/state_tracker/st_atom_viewport.c
@@ -70,12 +70,10 @@ update_viewport( struct st_context *st )
st->state.viewport[i].scale[0] = scale[0];
st->state.viewport[i].scale[1] = scale[1] * yScale;
st->state.viewport[i].scale[2] = scale[2];
- st->state.viewport[i].scale[3] = 1.0;
st->state.viewport[i].translate[0] = translate[0];
st->state.viewport[i].translate[1] = translate[1] * yScale + yBias;
st->state.viewport[i].translate[2] = translate[2];
- st->state.viewport[i].translate[3] = 0.0;
}
cso_set_viewport(st->cso_context, &st->state.viewport[0]);
diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c
index 25975d0..2107ab1 100644
--- a/src/mesa/state_tracker/st_cb_bitmap.c
+++ b/src/mesa/state_tracker/st_cb_bitmap.c
@@ -504,11 +504,9 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
vp.scale[0] = 0.5f * width;
vp.scale[1] = height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width;
vp.translate[1] = 0.5f * height;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c
index bb84fd9..3a359f3 100644
--- a/src/mesa/state_tracker/st_cb_clear.c
+++ b/src/mesa/state_tracker/st_cb_clear.c
@@ -324,11 +324,9 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers)
vp.scale[0] = 0.5f * fb_width;
vp.scale[1] = fb_height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * fb_width;
vp.translate[1] = 0.5f * fb_height;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(st->cso_context, &vp);
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 5ae092b..939fc20 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -776,11 +776,9 @@ draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z,
vp.scale[0] = 0.5f * w;
vp.scale[1] = -0.5f * h;
vp.scale[2] = 0.5f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * w;
vp.translate[1] = 0.5f * h;
vp.translate[2] = 0.5f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
diff --git a/src/mesa/state_tracker/st_cb_drawtex.c b/src/mesa/state_tracker/st_cb_drawtex.c
index 168c276..d057ff6 100644
--- a/src/mesa/state_tracker/st_cb_drawtex.c
+++ b/src/mesa/state_tracker/st_cb_drawtex.c
@@ -258,11 +258,9 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
vp.scale[0] = 0.5f * width;
vp.scale[1] = height * (invert ? -0.5f : 0.5f);
vp.scale[2] = 1.0f;
- vp.scale[3] = 1.0f;
vp.translate[0] = 0.5f * width;
vp.translate[1] = 0.5f * height;
vp.translate[2] = 0.0f;
- vp.translate[3] = 0.0f;
cso_set_viewport(cso, &vp);
}
--
2.1.0
More information about the mesa-dev
mailing list