summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-03-18 13:37:59 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-03-18 15:44:04 -0700
commit3a648d0cf23c39a139e4638c2194e4ce97c1d983 (patch)
tree1eb8f589dc620f4be74a3b452c9a084dec85af5f /src/gallium
parent5b97ba4eb0b3d5285e93057a7d2b38a3fc6f5056 (diff)
r300-gallium: Viewport state storage.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/r300/r300_context.c2
-rw-r--r--src/gallium/drivers/r300/r300_context.h14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 5797de7dde..b8584702aa 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -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);
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index 96d923d6f1..5431cf2f72 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -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. */