Module: Mesa
Branch: gallium-no-rhw-position
Commit: b42455c4f48076eec34e383d5b9cc4670f2d048f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b42455c4f48076eec34e383d5b9cc4670f2d048f

Author: Michal Krol <mic...@vmware.com>
Date:   Mon Mar  1 17:07:03 2010 +0100

r300: Save viewport and clip states before invoking blitter.

---

 src/gallium/drivers/r300/r300_blit.c    |    2 ++
 src/gallium/drivers/r300/r300_context.h |    4 ++++
 src/gallium/drivers/r300/r300_state.c   |    4 ++++
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_blit.c 
b/src/gallium/drivers/r300/r300_blit.c
index eb9b0be..ec7414d 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -34,6 +34,8 @@ static void r300_blitter_save_states(struct r300_context* 
r300)
     util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state);
     util_blitter_save_fragment_shader(r300->blitter, r300->fs);
     util_blitter_save_vertex_shader(r300->blitter, r300->vs);
+    util_blitter_save_viewport(r300->blitter, &r300->viewport);
+    util_blitter_save_clip(r300->blitter, &r300->clip);
 }
 
 /* Clear currently bound buffers. */
diff --git a/src/gallium/drivers/r300/r300_context.h 
b/src/gallium/drivers/r300/r300_context.h
index 2f056aa..97100c0 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -333,6 +333,10 @@ struct r300_context {
 
     struct pipe_stencil_ref stencil_ref;
 
+    struct pipe_clip_state clip;
+
+    struct pipe_viewport_state viewport;
+
     /* Bitmask of dirty state objects. */
     uint32_t dirty_state;
     /* Flag indicating whether or not the HW is dirty. */
diff --git a/src/gallium/drivers/r300/r300_state.c 
b/src/gallium/drivers/r300/r300_state.c
index 3550c69..ebb8591 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -376,6 +376,8 @@ static void r300_set_clip_state(struct pipe_context* pipe,
 {
     struct r300_context* r300 = r300_context(pipe);
 
+    r300->clip = *state;
+
     if (r300_screen(pipe->screen)->caps->has_tcl) {
         memcpy(r300->clip_state.state, state, sizeof(struct pipe_clip_state));
         r300->clip_state.size = 29;
@@ -986,6 +988,8 @@ static void r300_set_viewport_state(struct pipe_context* 
pipe,
     struct r300_viewport_state* viewport =
         (struct r300_viewport_state*)r300->viewport_state.state;
 
+    r300->viewport = *state;
+
     /* Do the transform in HW. */
     viewport->vte_control = R300_VTX_W0_FMT;
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to