aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg/xorg_renderer.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-11-27 13:59:00 +0000
committerKeith Whitwell <[email protected]>2009-11-27 13:59:22 +0000
commit124ae596806f1a77af46f1f0e446d448da6e953a (patch)
tree1ebb8f691a444b2656e85071e9bc06a7418a1403 /src/gallium/state_trackers/xorg/xorg_renderer.c
parentdc86f4a20b6ffe0340ca178dc303271a8a112bb9 (diff)
st/xorg: fix composite after texture size changes
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_renderer.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_renderer.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c
index 9cb65b0aac9..4f8985a75eb 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 sets us up to just touch 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)
{