r300: Add fragment shader stubs.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 23 Jan 2009 23:08:27 +0000 (15:08 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:26 +0000 (23:30 -0800)
Not looking forward to filling these out at all.

src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_state.c

index f162aa4b640ae29d5148ea09b271491bca6acffa..0d7ba581cc9d8adbc4cdeda23eefb6940ea51c88 100644 (file)
@@ -55,6 +55,9 @@ struct r300_dsa_state {
     uint32_t stencil_ref_bf;    /* R500_ZB_STENCILREFMASK_BF: 0x4fd4 */
 };
 
+struct r300_fs_state {
+};
+
 struct r300_rs_state {
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t depth_scale_front;     /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
@@ -76,13 +79,15 @@ struct r300_scissor_state {
     uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */
 };
 
-#define R300_NEW_BLEND          0x0001
-#define R300_NEW_BLEND_COLOR    0x0002
-#define R300_NEW_DSA            0x0004
-#define R300_NEW_RS             0x0008
-#define R300_NEW_SAMPLER        0x0010
-#define R300_NEW_SCISSOR        0x1000
-#define R300_NEW_KITCHEN_SINK   0x1fff
+#define R300_NEW_BLEND           0x0001
+#define R300_NEW_BLEND_COLOR     0x0002
+#define R300_NEW_DSA             0x0004
+#define R300_NEW_FRAGMENT_SHADER 0x0008
+#define R300_NEW_RASTERIZER      0x0010
+#define R300_NEW_SAMPLER         0x0020
+#define R300_NEW_SCISSOR         0x2000
+#define R300_NEW_VERTEX_SHADER   0x4000
+#define R300_NEW_KITCHEN_SINK    0x7fff
 
 struct r300_texture {
     /* Parent class */
@@ -114,6 +119,8 @@ struct r300_context {
     struct r300_blend_color_state* blend_color_state;
     /* Depth, stencil, and alpha state. */
     struct r300_dsa_state* dsa_state;
+    /* Fragment shader state. */
+    struct r300_fs_state* fs_state;
     /* Rasterizer state. */
     struct r300_rs_state* rs_state;
     /* Sampler states. */
index bf6fd3224eb5edc7bbd0007017b7b325ef9f2248..19bfcbdd5ba272cd9abd3e7f80b0a45dba96104d 100644 (file)
@@ -74,7 +74,7 @@ static void r300_emit_dirty_state(struct r300_context* r300)
         }
     }
 
-    if (r300->dirty_state & R300_NEW_RS) {
+    if (r300->dirty_state & R300_NEW_RASTERIZER) {
         struct r300_rs_state* rs = r300->rs_state;
         OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
         /* XXX next six are contiguous regs */
index 8e15a429fbe87d5e09fe9d081d369e3848a51873..9d9a4ec2020af6b80ce1789be520157b4e2100be 100644 (file)
@@ -357,6 +357,32 @@ static void r300_delete_dsa_state(struct pipe_context* pipe,
 {
     FREE(state);
 }
+
+/* Create fragment shader state. */
+static void* r300_create_fs_state(struct pipe_context* pipe,
+                                  const struct pipe_shader_state* state)
+{
+    struct r300_fs_state* fs = CALLOC_STRUCT(r300_fs_state);
+
+    return (void*)fs;
+}
+
+/* Bind fragment shader state. */
+static void r300_bind_fs_state(struct pipe_context* pipe, void* state)
+{
+    struct r300_context* r300 = r300_context(pipe);
+
+    r300->fs_state = (struct r300_fs_state*)state;
+
+    r300->dirty_state |= R300_NEW_FRAGMENT_SHADER;
+}
+
+/* Delect fragment shader state. */
+static void r300_delete_fs_state(struct pipe_context* pipe, void* state)
+{
+    FREE(state);
+}
+
 #if 0
 struct pipe_rasterizer_state
 {
@@ -449,7 +475,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
     struct r300_context* r300 = r300_context(pipe);
 
     r300->rs_state = (struct r300_rs_state*)state;
-    r300->dirty_state |= R300_NEW_RS;
+    r300->dirty_state |= R300_NEW_RASTERIZER;
 }
 
 /* Free rasterizer state. */
@@ -652,6 +678,10 @@ void r300_init_state_functions(struct r300_context* r300) {
     r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state;
     r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state;
 
+    r300->context.create_fs_state = r300_create_fs_state;
+    r300->context.bind_fs_state = r300_bind_fs_state;
+    r300->context.delete_fs_state = r300_delete_fs_state;
+
     r300->context.create_rasterizer_state = r300_create_rs_state;
     r300->context.bind_rasterizer_state = r300_bind_rs_state;
     r300->context.delete_rasterizer_state = r300_delete_rs_state;