summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/xorg/xorg_renderer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_renderer.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_renderer.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index 9cb65b0aac..cbb84a8c0d 100644
--- a/src/gallium/state_trackers/xorg/xorg_renderer.c
+++ b/src/gallium/state_trackers/xorg/xorg_renderer.c
@@ -313,21 +313,25 @@ setup_vertex_data_yuv(struct xorg_renderer *r,
* these concepts are linked.
*/
void renderer_bind_destination(struct xorg_renderer *r,
- struct pipe_surface *surface )
+ struct pipe_surface *surface,
+ int width,
+ int height )
{
struct pipe_framebuffer_state fb;
struct pipe_viewport_state viewport;
- int width = surface->width;
- int height = surface->height;
+ /* Framebuffer uses actual surface width/height
+ */
memset(&fb, 0, sizeof fb);
- fb.width = width;
- fb.height = height;
+ fb.width = surface->width;
+ fb.height = surface->height;
fb.nr_cbufs = 1;
fb.cbufs[0] = surface;
fb.zsbuf = 0;
+ /* Viewport just touches the bit we're interested in:
+ */
viewport.scale[0] = width / 2.f;
viewport.scale[1] = height / 2.f;
viewport.scale[2] = 1.0;
@@ -337,6 +341,8 @@ void renderer_bind_destination(struct xorg_renderer *r,
viewport.translate[2] = 0.0;
viewport.translate[3] = 0.0;
+ /* Constant buffer set up to match viewport dimensions:
+ */
if (r->fb_width != width ||
r->fb_height != height)
{
@@ -460,7 +466,9 @@ void renderer_copy_prepare(struct xorg_renderer *r,
cso_single_sampler_done(r->cso);
}
- renderer_bind_destination(r, dst_surface);
+ renderer_bind_destination(r, dst_surface,
+ dst_surface->width,
+ dst_surface->height);
/* texture */
cso_set_sampler_textures(r->cso, 1, &src_texture);