Mesa (master): r300g/swtcl: fix point sprite texgen (do it in HW)

Marek Olšák mareko at kemper.freedesktop.org
Sat May 15 22:23:05 UTC 2010


Module: Mesa
Branch: master
Commit: 87547ac70ce0f8696d16336177003f881c9ee836
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=87547ac70ce0f8696d16336177003f881c9ee836

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sun May 16 00:21:53 2010 +0200

r300g/swtcl: fix point sprite texgen (do it in HW)

---

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

diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 69c0956..e44906d 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -90,8 +90,10 @@ struct r300_dsa_state {
 };
 
 struct r300_rs_state {
-    /* Draw-specific rasterizer state */
+    /* Original rasterizer state. */
     struct pipe_rasterizer_state rs;
+    /* Draw-specific rasterizer state. */
+    struct pipe_rasterizer_state rs_draw;
 
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t antialiasing_config;   /* R300_GB_AA_CONFIG: 0x4020 */
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 73713ea..ac4e87a 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -756,8 +756,12 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
     int i;
     float psiz;
 
-    /* Copy rasterizer state for Draw. */
+    /* Copy rasterizer state. */
     rs->rs = *state;
+    rs->rs_draw = *state;
+
+    /* Override some states for Draw. */
+    rs->rs_draw.sprite_coord_enable = 0; /* We can do this in HW. */
 
 #ifdef PIPE_ARCH_LITTLE_ENDIAN
     rs->vap_control_status = R300_VC_NO_SWAP;
@@ -904,9 +908,9 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
     int last_sprite_coord_enable = r300->sprite_coord_enable;
     boolean last_two_sided_color = r300->two_sided_color;
 
-    if (r300->draw) {
+    if (r300->draw && rs) {
         draw_flush(r300->draw);
-        draw_set_rasterizer_state(r300->draw, &rs->rs, state);
+        draw_set_rasterizer_state(r300->draw, &rs->rs_draw, state);
     }
 
     if (rs) {




More information about the mesa-commit mailing list