From eb236d88cef3c5c73289c1147466a1cc85657500 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Fri, 5 Apr 2013 10:12:06 +0200
Subject: wined3d: Don't store viewport pointers in the command stream.

---
 dlls/wined3d/cs.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 03e760d..4b1ed18 100644
--- a/dlls/wined3d/cs.c
+++ b/dlls/wined3d/cs.c
@@ -126,7 +126,7 @@ struct wined3d_cs_set_predication
 struct wined3d_cs_set_viewport
 {
     enum wined3d_cs_op opcode;
-    const struct wined3d_viewport *viewport;
+    struct wined3d_viewport viewport;
 };
 
 struct wined3d_cs_set_scissor_rect
@@ -552,9 +552,10 @@ void wined3d_cs_emit_set_predication(struct wined3d_cs *cs, struct wined3d_query
 static UINT wined3d_cs_exec_set_viewport(struct wined3d_cs *cs, const void *data)
 {
     const struct wined3d_cs_set_viewport *op = data;
+    struct wined3d_device *device = cs->device;
 
-    cs->state.viewport = *op->viewport;
-    device_invalidate_state(cs->device, STATE_VIEWPORT);
+    cs->state.viewport = op->viewport;
+    device_invalidate_state(device, STATE_VIEWPORT);
 
     return sizeof(*op);
 }
@@ -565,7 +566,7 @@ void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_vi
 
     op = cs->ops->require_space(cs, sizeof(*op));
     op->opcode = WINED3D_CS_OP_SET_VIEWPORT;
-    op->viewport = viewport;
+    op->viewport = *viewport;
 
     cs->ops->submit(cs);
 }
-- 
2.1.3

