r300: Hook up clear, set it to fallback.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 24 Jan 2009 13:44:01 +0000 (05:44 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:28 +0000 (23:30 -0800)
src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_surface.c

index 314b2f0a11be406808a86cfc196bc79da9bab485..e63e1278bf7660f54ced4a11b7b92dd43e479dc5 100644 (file)
@@ -47,6 +47,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
 
     r300->context.destroy = r300_destroy_context;
 
+    r300->context.clear = r300_clear;
+
     r300->draw = draw_create();
 
     r300->blend_color_state = CALLOC_STRUCT(r300_blend_color_state);
index 52ddfa1df953a9a4e6f0e8c6831264f95c45b766..f246c57f48fe4da5c6bb068a00588dacaf784518 100644 (file)
@@ -27,6 +27,7 @@
 #include "pipe/p_context.h"
 #include "util/u_memory.h"
 
+#include "r300_clear.h"
 #include "r300_screen.h"
 #include "r300_winsys.h"
 
index 1f6abc2385df7b70db08ce2116aef95debc22b15..907ebe5c751bba874aeca1c0966dd5dd3d81fe00 100644 (file)
@@ -204,6 +204,14 @@ static void r300_set_clip_state(struct pipe_context* pipe,
     draw_set_clip_state(r300->draw, state);
 }
 
+static void
+    r300_set_constant_buffer(struct pipe_context* pipe,
+                             uint shader, uint index,
+                             const struct pipe_constant_buffer* buffer)
+{
+    /* XXX */
+}
+
 static uint32_t translate_depth_stencil_function(int zs_func) {
     switch (zs_func) {
         case PIPE_FUNC_NEVER:
@@ -367,6 +375,12 @@ static void r300_delete_dsa_state(struct pipe_context* pipe,
     FREE(state);
 }
 
+static void r300_set_edgeflags(struct pipe_context* pipe,
+                               const unsigned* bitfield)
+{
+    /* XXX you know it's bad when i915 has this blank too */
+}
+
 static void
     r300_set_framebuffer_state(struct pipe_context* pipe,
                                const struct pipe_framebuffer_state* state)
@@ -762,13 +776,13 @@ void r300_init_state_functions(struct r300_context* r300)
 
     r300->context.set_clip_state = r300_set_clip_state;
 
-    /* XXX r300->context.set_constant_buffer = r300_set_constant_buffer; */
+    r300->context.set_constant_buffer = r300_set_constant_buffer;
 
     r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state;
     r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state;
     r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state;
 
-    /* XXX r300->context.set_edgeflags = r300_set_edgeflags; */
+    r300->context.set_edgeflags = r300_set_edgeflags;
 
     r300->context.set_framebuffer_state = r300_set_framebuffer_state;
 
index dd1c8862a735e1d6cad26abed0d7b390a7876d20..c9957a0af2561021ab23196586d0e1316230578e 100644 (file)
@@ -30,6 +30,12 @@ static void r300_surface_fill(struct pipe_context* pipe,
                               unsigned w, unsigned h,
                               unsigned color)
 {
+
+void *dst_map = pipe->screen->surface_map( pipe->screen, dest,
+PIPE_BUFFER_USAGE_CPU_WRITE );
+pipe_fill_rect(dst_map, &dest->block, dest->stride, x, y, w, h, color);
+pipe->screen->surface_unmap(pipe->screen, dest);
+return;
     struct r300_context* r300 = r300_context(pipe);
     CS_LOCALS(r300);
     struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
@@ -278,7 +284,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
     /* XXX might have to switch to 2D */
 
     OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0, 1);
-    OUT_CS_RELOC(0, dest->buffer, 0, RADEON_GEM_DOMAIN_VRAM, 0);
+    OUT_CS_RELOC(dest->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
     /* XXX this needs more TLC (or TCL, as it were) */
     OUT_CS_REG(R300_RB3D_COLORPITCH0, R300_COLOR_FORMAT_ARGB8888);
 #if 0