summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-10-05 21:29:35 +0200
committerMarek Olšák <[email protected]>2017-10-07 18:26:35 +0200
commit5a47abb63e11853bf1f2f72e3c5371a720346b7d (patch)
treeefc8b6a9515e7fd7553bd170cd7de91933c2ad0e /src/gallium/drivers
parent76ef08f6eee6abc9eb9b66b7b183927e4aed8d64 (diff)
radeonsi: don't change viewport for blits, use window-space positions
The viewport state was an identity anyway. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_state_draw.c10
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c1
-rw-r--r--src/gallium/drivers/radeonsi/si_state_viewport.c7
5 files changed, 2 insertions, 18 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index b3f44c3c9a8..40f85505929 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -68,7 +68,6 @@ static void si_blitter_begin(struct pipe_context *ctx, enum si_blitter_op op)
util_blitter_save_stencil_ref(sctx->blitter, &sctx->stencil_ref.state);
util_blitter_save_fragment_shader(sctx->blitter, sctx->ps_shader.cso);
util_blitter_save_sample_mask(sctx->blitter, sctx->sample_mask.sample_mask);
- util_blitter_save_viewport(sctx->blitter, &sctx->viewports.states[0]);
util_blitter_save_scissor(sctx->blitter, &sctx->scissors.states[0]);
}
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 3001a3a8cd9..5cf71bec6a5 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -255,6 +255,7 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
if (sctx->blitter == NULL)
goto fail;
sctx->blitter->draw_rectangle = si_draw_rectangle;
+ sctx->blitter->skip_viewport_restore = true;
sctx->sample_mask.sample_mask = 0xffff;
diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c
index 8e541518ec8..c6c15c1acf7 100644
--- a/src/gallium/drivers/radeonsi/si_state_draw.c
+++ b/src/gallium/drivers/radeonsi/si_state_draw.c
@@ -1515,16 +1515,6 @@ void si_draw_rectangle(struct blitter_context *blitter,
{
struct pipe_context *pipe = util_blitter_get_pipe(blitter);
struct si_context *sctx = (struct si_context*)pipe;
- struct pipe_viewport_state viewport;
-
- /* setup viewport */
- viewport.scale[0] = 1.0f;
- viewport.scale[1] = 1.0f;
- viewport.scale[2] = 1.0f;
- viewport.translate[0] = 0.0f;
- viewport.translate[1] = 0.0f;
- viewport.translate[2] = 0.0f;
- pipe->set_viewport_states(pipe, 0, 1, &viewport);
/* Pack position coordinates as signed int16. */
sctx->vs_blit_sh_data[0] = (uint32_t)(x1 & 0xffff) |
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 90c3cf7e631..40a76c85f3f 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -3442,6 +3442,7 @@ void *si_get_blit_vs(struct si_context *sctx, enum blitter_attrib_type type,
/* Tell the shader to load VS inputs from SGPRs: */
ureg_property(ureg, TGSI_PROPERTY_VS_BLIT_SGPRS, vs_blit_property);
+ ureg_property(ureg, TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION, true);
/* This is just a pass-through shader with 1-3 MOV instructions. */
ureg_MOV(ureg,
diff --git a/src/gallium/drivers/radeonsi/si_state_viewport.c b/src/gallium/drivers/radeonsi/si_state_viewport.c
index 0d6b7a8da82..f4165584754 100644
--- a/src/gallium/drivers/radeonsi/si_state_viewport.c
+++ b/src/gallium/drivers/radeonsi/si_state_viewport.c
@@ -63,13 +63,6 @@ static void si_get_scissor_from_viewport(struct si_context *ctx,
maxx = vp->scale[0] + vp->translate[0];
maxy = vp->scale[1] + vp->translate[1];
- /* r600_draw_rectangle sets this. Disable the scissor. */
- if (minx == -1 && miny == -1 && maxx == 1 && maxy == 1) {
- scissor->minx = scissor->miny = 0;
- scissor->maxx = scissor->maxy = SI_MAX_SCISSOR;
- return;
- }
-
/* Handle inverted viewports. */
if (minx > maxx) {
tmp = minx;