The viewport state was an identity anyway.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/* XXX check whether these are saved and whether they need to be restored
* (depending on the operation) */
pipe->set_stencil_ref(pipe, &ctx->base.saved_stencil_ref);
- pipe->set_viewport_states(pipe, 0, 1, &ctx->base.saved_viewport);
+
+ if (!blitter->skip_viewport_restore)
+ pipe->set_viewport_states(pipe, 0, 1, &ctx->base.saved_viewport);
}
static void blitter_check_saved_fb_state(struct blitter_context_priv *ctx)
struct pipe_stencil_ref saved_stencil_ref; /**< stencil ref */
struct pipe_viewport_state saved_viewport;
struct pipe_scissor_state saved_scissor;
+ bool skip_viewport_restore;
bool is_sample_mask_saved;
unsigned saved_sample_mask;
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]);
}
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;
{
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) |
/* 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,
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;