r300-gallium: Viewport state storage.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 18 Mar 2009 20:37:59 +0000 (13:37 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Wed, 18 Mar 2009 22:44:04 +0000 (15:44 -0700)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h

index 5797de7dde791d5d061624bbdea43554c782f32d..b8584702aad173e2423962f9d2abc78a8f99411f 100644 (file)
@@ -98,6 +98,7 @@ static void r300_destroy_context(struct pipe_context* context) {
     FREE(r300->blend_color_state);
     FREE(r300->rs_block);
     FREE(r300->scissor_state);
+    FREE(r300->viewport_state);
     FREE(r300);
 }
 
@@ -129,6 +130,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
     r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
     r300->rs_block = CALLOC_STRUCT(r300_rs_block);
     r300->scissor_state = CALLOC_STRUCT(r300_scissor_state);
+    r300->viewport_state = CALLOC_STRUCT(r300_viewport_state);
 
     r300_init_flush_functions(r300);
 
index 96d923d6f1cdfe9f386ffa4c6f4aac094ac0d52b..5431cf2f72a19466bee6e33d9f9c45c162efa31e 100644 (file)
@@ -102,6 +102,15 @@ struct r300_texture_state {
     uint32_t format2; /* R300_TX_FORMAT2: 0x4500 */
 };
 
+struct r300_viewport_state {
+    float xscale;  /* R300_VAP_VPORT_XSCALE:  0x2098 */
+    float xoffset; /* R300_VAP_VPORT_XOFFSET: 0x209c */
+    float yscale;  /* R300_VAP_VPORT_YSCALE:  0x20a0 */
+    float yoffset; /* R300_VAP_VPORT_YOFFSET: 0x20a4 */
+    float zscale;  /* R300_VAP_VPORT_ZSCALE:  0x20a8 */
+    float zoffset; /* R300_VAP_VPORT_ZOFFSET: 0x20ac */
+};
+
 #define R300_NEW_BLEND           0x0000001
 #define R300_NEW_BLEND_COLOR     0x0000002
 #define R300_NEW_CONSTANTS       0x0000004
@@ -117,7 +126,8 @@ struct r300_texture_state {
 #define R300_ANY_NEW_TEXTURES    0x1fe0000
 #define R300_NEW_VERTEX_FORMAT   0x2000000
 #define R300_NEW_VERTEX_SHADER   0x4000000
-#define R300_NEW_KITCHEN_SINK    0x7ffffff
+#define R300_NEW_VIEWPORT        0x8000000
+#define R300_NEW_KITCHEN_SINK    0xfffffff
 
 /* The next several objects are not pure Radeon state; they inherit from
  * various Gallium classes. */
@@ -262,6 +272,8 @@ struct r300_context {
     int vertex_buffer_count;
     /* Vertex information. */
     struct r300_vertex_format vertex_info;
+    /* Viewport state. */
+    struct r300_viewport_state* viewport_state;
     /* Bitmask of dirty state objects. */
     uint32_t dirty_state;
     /* Flag indicating whether or not the HW is dirty. */