r300-gallium: Update clear() code.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 5 Apr 2009 05:30:14 +0000 (22:30 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 5 Apr 2009 05:30:14 +0000 (22:30 -0700)
We have a huge optimization opportunity, but for now we'll just use the util.

src/gallium/drivers/r300/r300_clear.c
src/gallium/drivers/r300/r300_clear.h

index 8506ed2942420814793e413159ccaf2f3ca41310..8b9cb819ae6d94087fddad8669ea67ce17eb35ed 100644 (file)
 
 #include "r300_clear.h"
 
-/* This gets its own file because Intel's is in its own file.
- * I assume there's a good reason. */
+/* Clears currently bound buffers. */
 void r300_clear(struct pipe_context* pipe,
-                struct pipe_surface* ps,
-                unsigned color)
+                unsigned buffers,
+                const float* rgba,
+                double depth,
+                unsigned stencil)
 {
-    pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color);
+    /* XXX we can and should do one clear if both color and zs are set */
+    util_clear(pipe, &r300_context(pipe)->framebuffer_state,
+            buffers, rgba, depth, stencil);
 }
index e24a0690c9b399c24f4181a733fd073ef742217b..cd5900565e808fa28d07adaf067398e39850c886 100644 (file)
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
-#include "pipe/p_context.h"
+#ifndef R300_CLEAR_H
+#define R300_CLEAR_H
+
+#include "util/u_clear.h"
+
+#include "r300_context.h"
 
 void r300_clear(struct pipe_context* pipe,
-                struct pipe_surface* ps,
-                unsigned color);
+                unsigned buffers,
+                const float* rgba,
+                double depth,
+                unsigned stencil);
+
+#endif /* R300_CLEAR_H */