gallium: propogate draw retval changes into more drivers
authorKeith Whitwell <keithw@vmware.com>
Mon, 21 Dec 2009 22:47:21 +0000 (22:47 +0000)
committerKeith Whitwell <keithw@vmware.com>
Mon, 21 Dec 2009 22:55:40 +0000 (22:55 +0000)
20 files changed:
src/gallium/drivers/i915/i915_context.c
src/gallium/drivers/llvmpipe/lp_draw_arrays.c
src/gallium/drivers/llvmpipe/lp_state.h
src/gallium/drivers/nv04/nv04_context.h
src/gallium/drivers/nv04/nv04_vbo.c
src/gallium/drivers/nv10/nv10_context.h
src/gallium/drivers/nv10/nv10_vbo.c
src/gallium/drivers/nv20/nv20_context.h
src/gallium/drivers/nv20/nv20_vbo.c
src/gallium/drivers/nv30/nv30_context.h
src/gallium/drivers/nv30/nv30_vbo.c
src/gallium/drivers/nv40/nv40_context.h
src/gallium/drivers/nv40/nv40_draw.c
src/gallium/drivers/nv40/nv40_vbo.c
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_vbo.c
src/gallium/drivers/r300/r300_render.c
src/gallium/drivers/r300/r300_render.h
src/gallium/drivers/softpipe/sp_draw_arrays.c
src/gallium/drivers/softpipe/sp_state.h

index 94c8aee30feeebcc9c2ebdfbfaab7cae45ca8a4e..753f37e0951fcf15edd3cb8302e91d6b429fd905 100644 (file)
@@ -45,7 +45,7 @@
  */
 
 
-static boolean
+static void
 i915_draw_range_elements(struct pipe_context *pipe,
                          struct pipe_buffer *indexBuffer,
                          unsigned indexSize,
@@ -106,27 +106,25 @@ i915_draw_range_elements(struct pipe_context *pipe,
       pipe_buffer_unmap(pipe->screen, indexBuffer);
       draw_set_mapped_element_buffer_range(draw, 0, start, start + count - 1, NULL);
    }
-
-   return TRUE;
 }
 
-static boolean
+static void
 i915_draw_elements(struct pipe_context *pipe,
                    struct pipe_buffer *indexBuffer,
                    unsigned indexSize,
                    unsigned prim, unsigned start, unsigned count)
 {
-   return i915_draw_range_elements(pipe, indexBuffer,
-                                   indexSize,
-                                   0, 0xffffffff,
-                                   prim, start, count);
+   i915_draw_range_elements(pipe, indexBuffer,
+                            indexSize,
+                            0, 0xffffffff,
+                            prim, start, count);
 }
 
-static boolean
+static void
 i915_draw_arrays(struct pipe_context *pipe,
                  unsigned prim, unsigned start, unsigned count)
 {
-   return i915_draw_elements(pipe, NULL, 0, prim, start, count);
+   i915_draw_elements(pipe, NULL, 0, prim, start, count);
 }
 
 
index 0aa13a1fc679d282e7606a42007d36855a7cf005..57ce5b17a23280ac48a5e7f69cfac27bc0c41512 100644 (file)
 
 
 
-boolean
+void
 llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                      unsigned start, unsigned count)
 {
-   return llvmpipe_draw_elements(pipe, NULL, 0, mode, start, count);
+   llvmpipe_draw_elements(pipe, NULL, 0, mode, start, count);
 }
 
 
@@ -58,7 +58,7 @@ llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
  * Basically, map the vertex buffers (and drawing surfaces), then hand off
  * the drawing to the 'draw' module.
  */
-boolean
+void
 llvmpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_buffer *indexBuffer,
                              unsigned indexSize,
@@ -116,21 +116,19 @@ llvmpipe_draw_range_elements(struct pipe_context *pipe,
    /* Note: leave drawing surfaces mapped */
 
    lp->dirty_render_cache = TRUE;
-   
-   return TRUE;
 }
 
 
-boolean
+void
 llvmpipe_draw_elements(struct pipe_context *pipe,
                        struct pipe_buffer *indexBuffer,
                        unsigned indexSize,
                        unsigned mode, unsigned start, unsigned count)
 {
-   return llvmpipe_draw_range_elements( pipe, indexBuffer,
-                                        indexSize,
-                                        0, 0xffffffff,
-                                        mode, start, count );
+   llvmpipe_draw_range_elements( pipe, indexBuffer,
+                                 indexSize,
+                                 0, 0xffffffff,
+                                 mode, start, count );
 }
 
 
index d1c74ab07b510cd8b3f48adc98b4ee101185672e..28578535866db4f22ba446be48c88a2d4f0d571e 100644 (file)
@@ -197,14 +197,14 @@ void llvmpipe_update_fs(struct llvmpipe_context *lp);
 void llvmpipe_update_derived( struct llvmpipe_context *llvmpipe );
 
 
-boolean llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
+void llvmpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                             unsigned start, unsigned count);
 
-boolean llvmpipe_draw_elements(struct pipe_context *pipe,
+void llvmpipe_draw_elements(struct pipe_context *pipe,
                               struct pipe_buffer *indexBuffer,
                               unsigned indexSize,
                               unsigned mode, unsigned start, unsigned count);
-boolean
+void
 llvmpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_buffer *indexBuffer,
                              unsigned indexSize,
index 55326c787a801512060ea43a3a7bbc69bb5a78c9..595111529383d5d966005896176673a4b2cc4c22 100644 (file)
@@ -141,9 +141,9 @@ extern void nv04_emit_hw_state(struct nv04_context *nv04);
 extern void nv04_state_tex_update(struct nv04_context *nv04);
 
 /* nv04_vbo.c */
-extern boolean nv04_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv04_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv04_draw_elements( struct pipe_context *pipe,
+extern void nv04_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count);
index e3167814f2bcb39d5ec92280c3391f8b1fea9c40..704fae8c6c9b6c3ecf33c4130bb7a91a73a0d33f 100644 (file)
@@ -9,7 +9,7 @@
 #include "nouveau/nouveau_channel.h"
 #include "nouveau/nouveau_pushbuf.h"
 
-boolean nv04_draw_elements( struct pipe_context *pipe,
+void nv04_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count)
@@ -65,15 +65,13 @@ boolean nv04_draw_elements( struct pipe_context *pipe,
                pipe_buffer_unmap(pscreen, indexBuffer);
                draw_set_mapped_element_buffer(draw, 0, NULL);
        }
-
-       return TRUE;
 }
 
-boolean nv04_draw_arrays( struct pipe_context *pipe,
-                                unsigned prim, unsigned start, unsigned count)
+void nv04_draw_arrays( struct pipe_context *pipe,
+                       unsigned prim, unsigned start, unsigned count)
 {
        printf("coucou in draw arrays\n");
-       return nv04_draw_elements(pipe, NULL, 0, prim, start, count);
+       nv04_draw_elements(pipe, NULL, 0, prim, start, count);
 }
 
 
index 36a6aa7a74e230213e3d07d9fe3a8da1fb3eab58..3f829fd1063f1365aa8f1c2ccef483d355aeccca 100644 (file)
@@ -144,9 +144,9 @@ extern void nv10_emit_hw_state(struct nv10_context *nv10);
 extern void nv10_state_tex_update(struct nv10_context *nv10);
 
 /* nv10_vbo.c */
-extern boolean nv10_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv10_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv10_draw_elements( struct pipe_context *pipe,
+extern void nv10_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count);
index 441a4f75f3f84ddfde01116b4ed01d44e1b16b0a..230f2e6d39eb7bca13c4e95ba068240e3741894f 100644 (file)
@@ -9,7 +9,7 @@
 #include "nouveau/nouveau_channel.h"
 #include "nouveau/nouveau_pushbuf.h"
 
-boolean nv10_draw_elements( struct pipe_context *pipe,
+void nv10_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count)
@@ -64,14 +64,12 @@ boolean nv10_draw_elements( struct pipe_context *pipe,
                pipe_buffer_unmap(pscreen, indexBuffer);
                draw_set_mapped_element_buffer(draw, 0, NULL);
        }
-
-       return TRUE;
 }
 
-boolean nv10_draw_arrays( struct pipe_context *pipe,
-                                unsigned prim, unsigned start, unsigned count)
+void nv10_draw_arrays( struct pipe_context *pipe,
+                       unsigned prim, unsigned start, unsigned count)
 {
-       return nv10_draw_elements(pipe, NULL, 0, prim, start, count);
+       nv10_draw_elements(pipe, NULL, 0, prim, start, count);
 }
 
 
index a4eaa9566089e4fb3ac15e66366ae53aa2a92c74..c88a1bd9bd400dfbdbee855ca7820b37c795f9cd 100644 (file)
@@ -143,9 +143,9 @@ extern void nv20_emit_hw_state(struct nv20_context *nv20);
 extern void nv20_state_tex_update(struct nv20_context *nv20);
 
 /* nv20_vbo.c */
-extern boolean nv20_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv20_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv20_draw_elements( struct pipe_context *pipe,
+extern void nv20_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count);
index 84d7db6c5e27c3274eea2f40340e06311db8a04e..2f5e12233f9e3d6bd82978f5dac56c1063b17b6e 100644 (file)
@@ -9,7 +9,7 @@
 #include "nouveau/nouveau_channel.h"
 #include "nouveau/nouveau_pushbuf.h"
 
-boolean nv20_draw_elements( struct pipe_context *pipe,
+void nv20_draw_elements( struct pipe_context *pipe,
                     struct pipe_buffer *indexBuffer,
                     unsigned indexSize,
                     unsigned prim, unsigned start, unsigned count)
@@ -67,13 +67,12 @@ boolean nv20_draw_elements( struct pipe_context *pipe,
        }
 
        draw_flush(nv20->draw);
-       return TRUE;
 }
 
-boolean nv20_draw_arrays( struct pipe_context *pipe,
+void nv20_draw_arrays( struct pipe_context *pipe,
                                 unsigned prim, unsigned start, unsigned count)
 {
-       return nv20_draw_elements(pipe, NULL, 0, prim, start, count);
+       nv20_draw_elements(pipe, NULL, 0, prim, start, count);
 }
 
 
index 6f44b1c7fe1a42cc07c73c459411f58325c0cfff..17f86605906f846196deb6149df3a772b20f5163 100644 (file)
@@ -199,9 +199,9 @@ extern struct nv30_state_entry nv30_state_fragtex;
 extern struct nv30_state_entry nv30_state_vbo;
 
 /* nv30_vbo.c */
-extern boolean nv30_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv30_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv30_draw_elements(struct pipe_context *pipe,
+extern void nv30_draw_elements(struct pipe_context *pipe,
                                  struct pipe_buffer *indexBuffer,
                                  unsigned indexSize,
                                  unsigned mode, unsigned start,
index 189656ec817aadb637c83b47fe31614400ab3d45..d359f71f4342282607576dbfa191fedc31306c64 100644 (file)
@@ -163,7 +163,7 @@ nv30_vbo_static_attrib(struct nv30_context *nv30, struct nouveau_stateobj *so,
        return TRUE;
 }
 
-boolean
+void
 nv30_draw_arrays(struct pipe_context *pipe,
                 unsigned mode, unsigned start, unsigned count)
 {
@@ -175,7 +175,7 @@ nv30_draw_arrays(struct pipe_context *pipe,
        if (FORCE_SWTNL || !nv30_state_validate(nv30)) {
                /*return nv30_draw_elements_swtnl(pipe, NULL, 0,
                                                mode, start, count);*/
-               return FALSE;
+               return;
        }
 
        while (count) {
@@ -362,7 +362,7 @@ nv30_draw_elements_u32(struct nv30_context *nv30, void *ib,
        }
 }
 
-static boolean
+static void
 nv30_draw_elements_inline(struct pipe_context *pipe,
                          struct pipe_buffer *ib, unsigned ib_size,
                          unsigned mode, unsigned start, unsigned count)
@@ -393,10 +393,9 @@ nv30_draw_elements_inline(struct pipe_context *pipe,
        }
 
        pipe_buffer_unmap(pscreen, ib);
-       return TRUE;
 }
 
-static boolean
+static void
 nv30_draw_elements_vbo(struct pipe_context *pipe,
                       unsigned mode, unsigned start, unsigned count)
 {
@@ -445,11 +444,9 @@ nv30_draw_elements_vbo(struct pipe_context *pipe,
                count -= vc;
                start = restart;
        }
-
-       return TRUE;
 }
 
-boolean
+void
 nv30_draw_elements(struct pipe_context *pipe,
                   struct pipe_buffer *indexBuffer, unsigned indexSize,
                   unsigned mode, unsigned start, unsigned count)
@@ -461,7 +458,7 @@ nv30_draw_elements(struct pipe_context *pipe,
        if (FORCE_SWTNL || !nv30_state_validate(nv30)) {
                /*return nv30_draw_elements_swtnl(pipe, NULL, 0,
                                                mode, start, count);*/
-               return FALSE;   
+               return; 
        }
 
        if (idxbuf) {
@@ -472,7 +469,6 @@ nv30_draw_elements(struct pipe_context *pipe,
        }
 
        pipe->flush(pipe, 0, NULL);
-       return TRUE;
 }
 
 static boolean
index cf33b64a86dbb91b058bafce61522e0ffcbbbe54..d12b9d88cbbf3987e7c1b97577394cc113f03da1 100644 (file)
@@ -184,7 +184,7 @@ extern void nv40_screen_init_miptree_functions(struct pipe_screen *pscreen);
 
 /* nv40_draw.c */
 extern struct draw_stage *nv40_draw_render_stage(struct nv40_context *nv40);
-extern boolean nv40_draw_elements_swtnl(struct pipe_context *pipe,
+extern void nv40_draw_elements_swtnl(struct pipe_context *pipe,
                                        struct pipe_buffer *idxbuf,
                                        unsigned ib_size, unsigned mode,
                                        unsigned start, unsigned count);
@@ -220,9 +220,9 @@ extern struct nv40_state_entry nv40_state_vbo;
 extern struct nv40_state_entry nv40_state_vtxfmt;
 
 /* nv40_vbo.c */
-extern boolean nv40_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv40_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv40_draw_elements(struct pipe_context *pipe,
+extern void nv40_draw_elements(struct pipe_context *pipe,
                                  struct pipe_buffer *indexBuffer,
                                  unsigned indexSize,
                                  unsigned mode, unsigned start,
index b2f19ecb699826bccd729640a6834b7dca64cf6e..38aba92a14bac1dcd1b09aed77beeb13a0c7d211 100644 (file)
@@ -226,7 +226,7 @@ nv40_draw_render_stage(struct nv40_context *nv40)
        return &render->stage;
 }
 
-boolean
+void
 nv40_draw_elements_swtnl(struct pipe_context *pipe,
                         struct pipe_buffer *idxbuf, unsigned idxbuf_size,
                         unsigned mode, unsigned start, unsigned count)
@@ -237,7 +237,7 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
        void *map;
 
        if (!nv40_state_validate_swtnl(nv40))
-               return FALSE;
+               return;
        nv40->state.dirty &= ~(1ULL << NV40_STATE_VTXBUF);
        nv40_state_emit(nv40);
 
@@ -277,8 +277,6 @@ nv40_draw_elements_swtnl(struct pipe_context *pipe,
 
        draw_flush(nv40->draw);
        pipe->flush(pipe, 0, NULL);
-
-       return TRUE;
 }
 
 static INLINE void
index b2753b8e2e052a655a7f89c28e5d3243ec5c84ed..eecdf01915fb049bdfb90f352679036c7f7872ba 100644 (file)
@@ -164,7 +164,7 @@ nv40_vbo_static_attrib(struct nv40_context *nv40, struct nouveau_stateobj *so,
        return TRUE;
 }
 
-boolean
+void
 nv40_draw_arrays(struct pipe_context *pipe,
                 unsigned mode, unsigned start, unsigned count)
 {
@@ -174,8 +174,9 @@ nv40_draw_arrays(struct pipe_context *pipe,
 
        nv40_vbo_set_idxbuf(nv40, NULL, 0);
        if (FORCE_SWTNL || !nv40_state_validate(nv40)) {
-               return nv40_draw_elements_swtnl(pipe, NULL, 0,
-                                               mode, start, count);
+               nv40_draw_elements_swtnl(pipe, NULL, 0,
+                                         mode, start, count);
+                return;
        }
 
        while (count) {
@@ -221,7 +222,6 @@ nv40_draw_arrays(struct pipe_context *pipe,
        }
 
        pipe->flush(pipe, 0, NULL);
-       return TRUE;
 }
 
 static INLINE void
@@ -362,7 +362,7 @@ nv40_draw_elements_u32(struct nv40_context *nv40, void *ib,
        }
 }
 
-static boolean
+static void
 nv40_draw_elements_inline(struct pipe_context *pipe,
                          struct pipe_buffer *ib, unsigned ib_size,
                          unsigned mode, unsigned start, unsigned count)
@@ -393,10 +393,9 @@ nv40_draw_elements_inline(struct pipe_context *pipe,
        }
 
        pipe_buffer_unmap(pscreen, ib);
-       return TRUE;
 }
 
-static boolean
+static void
 nv40_draw_elements_vbo(struct pipe_context *pipe,
                       unsigned mode, unsigned start, unsigned count)
 {
@@ -445,11 +444,9 @@ nv40_draw_elements_vbo(struct pipe_context *pipe,
                count -= vc;
                start = restart;
        }
-
-       return TRUE;
 }
 
-boolean
+void
 nv40_draw_elements(struct pipe_context *pipe,
                   struct pipe_buffer *indexBuffer, unsigned indexSize,
                   unsigned mode, unsigned start, unsigned count)
@@ -459,8 +456,9 @@ nv40_draw_elements(struct pipe_context *pipe,
 
        idxbuf = nv40_vbo_set_idxbuf(nv40, indexBuffer, indexSize);
        if (FORCE_SWTNL || !nv40_state_validate(nv40)) {
-               return nv40_draw_elements_swtnl(pipe, NULL, 0,
-                                               mode, start, count);
+               nv40_draw_elements_swtnl(pipe, NULL, 0,
+                                         mode, start, count);
+                return;
        }
 
        if (idxbuf) {
@@ -471,7 +469,6 @@ nv40_draw_elements(struct pipe_context *pipe,
        }
 
        pipe->flush(pipe, 0, NULL);
-       return TRUE;
 }
 
 static boolean
index 5578a5838fb4e32254129907b7550c6c44112c71..cbd4c3ff86d6b6234514a26ec9e6d4a7466c72ed 100644 (file)
@@ -191,9 +191,9 @@ nv50_surface_do_copy(struct nv50_screen *screen, struct pipe_surface *dst,
 extern struct draw_stage *nv50_draw_render_stage(struct nv50_context *nv50);
 
 /* nv50_vbo.c */
-extern boolean nv50_draw_arrays(struct pipe_context *, unsigned mode,
+extern void nv50_draw_arrays(struct pipe_context *, unsigned mode,
                                unsigned start, unsigned count);
-extern boolean nv50_draw_elements(struct pipe_context *pipe,
+extern void nv50_draw_elements(struct pipe_context *pipe,
                                  struct pipe_buffer *indexBuffer,
                                  unsigned indexSize,
                                  unsigned mode, unsigned start,
index f7fa0659e8c68490bc2ed74e7ceac46fccd095ee..ca8608e9871c0c59a39326db7f306586249fd217 100644 (file)
@@ -152,7 +152,7 @@ nv50_vbo_vtxelt_to_hw(struct pipe_vertex_element *ve)
        return (hw_type | hw_size);
 }
 
-boolean
+void
 nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
                 unsigned count)
 {
@@ -182,7 +182,9 @@ nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
        BEGIN_RING(chan, tesla, NV50TCL_VERTEX_END, 1);
        OUT_RING  (chan, 0);
 
-       return ret;
+        /* XXX: not sure what to do if ret != TRUE: flush and retry?
+         */
+        assert(ret);
 }
 
 static INLINE boolean
@@ -275,7 +277,7 @@ nv50_draw_elements_inline_u32(struct nv50_context *nv50, uint32_t *map,
        return TRUE;
 }
 
-boolean
+void
 nv50_draw_elements(struct pipe_context *pipe,
                   struct pipe_buffer *indexBuffer, unsigned indexSize,
                   unsigned mode, unsigned start, unsigned count)
@@ -317,8 +319,10 @@ nv50_draw_elements(struct pipe_context *pipe,
        OUT_RING  (chan, 0);
 
        pipe_buffer_unmap(pscreen, indexBuffer);
-
-       return ret;
+        
+        /* XXX: what to do if ret != TRUE?  Flush and retry?
+         */
+       assert(ret);
 }
 
 static INLINE boolean
index 2d70ec2ac94560e82ba8137f43750f7c1810c0a9..87ad30ac30bff775ae8f21f76b817c62bbe96869 100644 (file)
@@ -213,7 +213,7 @@ validate:
 }
 
 /* This is the fast-path drawing & emission for HW TCL. */
-boolean r300_draw_range_elements(struct pipe_context* pipe,
+void r300_draw_range_elements(struct pipe_context* pipe,
                                  struct pipe_buffer* indexBuffer,
                                  unsigned indexSize,
                                  unsigned minIndex,
@@ -225,30 +225,33 @@ boolean r300_draw_range_elements(struct pipe_context* pipe,
     struct r300_context* r300 = r300_context(pipe);
 
     if (!u_trim_pipe_prim(mode, &count)) {
-        return FALSE;
+        return;
     }
 
     if (count > 65535) {
-        return FALSE;
+       /* XXX: use aux/indices functions to split this into smaller
+        * primitives.
+        */
+        return;
     }
 
     if (r300_nothing_to_draw(r300)) {
-        return TRUE;
+        return;
     }
 
     r300_update_derived_state(r300);
 
     if (!r300_setup_vertex_buffers(r300)) {
-        return FALSE;
+        return;
     }
 
     if (!r300->winsys->add_buffer(r300->winsys, indexBuffer,
                                   RADEON_GEM_DOMAIN_GTT, 0)) {
-        return FALSE;
+        return;
     }
 
     if (!r300->winsys->validate(r300->winsys)) {
-        return FALSE;
+        return;
     }
 
     r300_emit_dirty_state(r300);
@@ -257,41 +260,42 @@ boolean r300_draw_range_elements(struct pipe_context* pipe,
 
     r300_emit_draw_elements(r300, indexBuffer, indexSize, minIndex, maxIndex,
                             mode, start, count);
-
-    return TRUE;
 }
 
 /* Simple helpers for context setup. Should probably be moved to util. */
-boolean r300_draw_elements(struct pipe_context* pipe,
-                           struct pipe_buffer* indexBuffer,
-                           unsigned indexSize, unsigned mode,
-                           unsigned start, unsigned count)
+void r300_draw_elements(struct pipe_context* pipe,
+                        struct pipe_buffer* indexBuffer,
+                        unsigned indexSize, unsigned mode,
+                        unsigned start, unsigned count)
 {
-    return pipe->draw_range_elements(pipe, indexBuffer, indexSize, 0, ~0,
-                                     mode, start, count);
+   pipe->draw_range_elements(pipe, indexBuffer, indexSize, 0, ~0,
+                             mode, start, count);
 }
 
-boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
+void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
                          unsigned start, unsigned count)
 {
     struct r300_context* r300 = r300_context(pipe);
 
     if (!u_trim_pipe_prim(mode, &count)) {
-        return FALSE;
+        return;
     }
 
     if (count > 65535) {
-        return FALSE;
+        /* XXX: driver needs to handle this -- use the functions in
+         * aux/indices to split this into several smaller primitives.
+         */
+        return;
     }
 
     if (r300_nothing_to_draw(r300)) {
-        return TRUE;
+        return;
     }
 
     r300_update_derived_state(r300);
 
     if (!r300_setup_vertex_buffers(r300)) {
-        return FALSE;
+        return;
     }
 
     r300_emit_dirty_state(r300);
@@ -299,8 +303,6 @@ boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
     r300_emit_aos(r300, start);
 
     r300_emit_draw_arrays(r300, mode, count);
-
-    return TRUE;
 }
 
 /****************************************************************************
@@ -309,7 +311,7 @@ boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
  ***************************************************************************/
 
 /* SW TCL arrays, using Draw. */
-boolean r300_swtcl_draw_arrays(struct pipe_context* pipe,
+void r300_swtcl_draw_arrays(struct pipe_context* pipe,
                                unsigned mode,
                                unsigned start,
                                unsigned count)
@@ -318,11 +320,11 @@ boolean r300_swtcl_draw_arrays(struct pipe_context* pipe,
     int i;
 
     if (!u_trim_pipe_prim(mode, &count)) {
-        return FALSE;
+        return;
     }
 
     if (r300_nothing_to_draw(r300)) {
-        return TRUE;
+        return;
     }
 
     for (i = 0; i < r300->vertex_buffer_count; i++) {
@@ -345,12 +347,10 @@ boolean r300_swtcl_draw_arrays(struct pipe_context* pipe,
         pipe_buffer_unmap(pipe->screen, r300->vertex_buffer[i].buffer);
         draw_set_mapped_vertex_buffer(r300->draw, i, NULL);
     }
-
-    return TRUE;
 }
 
 /* SW TCL elements, using Draw. */
-boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe,
+void r300_swtcl_draw_range_elements(struct pipe_context* pipe,
                                        struct pipe_buffer* indexBuffer,
                                        unsigned indexSize,
                                        unsigned minIndex,
@@ -363,11 +363,11 @@ boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe,
     int i;
 
     if (!u_trim_pipe_prim(mode, &count)) {
-        return FALSE;
+        return;
     }
 
     if (r300_nothing_to_draw(r300)) {
-        return TRUE;
+        return;
     }
 
     for (i = 0; i < r300->vertex_buffer_count; i++) {
@@ -397,8 +397,6 @@ boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe,
     pipe_buffer_unmap(pipe->screen, indexBuffer);
     draw_set_mapped_element_buffer_range(r300->draw, 0, start,
                                          start + count - 1, NULL);
-
-    return TRUE;
 }
 
 /* Object for rendering using Draw. */
index da83069083dec4f2b67efd300109ac45e3a0454e..27b5e6a9630b0a79b2cc92376134e4b408a84c20 100644 (file)
 
 uint32_t r300_translate_primitive(unsigned prim);
 
-boolean r300_draw_range_elements(struct pipe_context* pipe,
-                                 struct pipe_buffer* indexBuffer,
-                                 unsigned indexSize,
-                                 unsigned minIndex,
-                                 unsigned maxIndex,
-                                 unsigned mode,
-                                 unsigned start,
-                                 unsigned count);
-
-boolean r300_draw_elements(struct pipe_context* pipe,
-                           struct pipe_buffer* indexBuffer,
-                           unsigned indexSize, unsigned mode,
-                           unsigned start, unsigned count);
-
-boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
-                         unsigned start, unsigned count);
-
-boolean r300_swtcl_draw_arrays(struct pipe_context* pipe,
-                               unsigned mode,
-                               unsigned start,
-                               unsigned count);
-
-boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe,
-                                       struct pipe_buffer* indexBuffer,
-                                       unsigned indexSize,
-                                       unsigned minIndex,
-                                       unsigned maxIndex,
-                                       unsigned mode,
-                                       unsigned start,
-                                       unsigned count);
+void r300_draw_range_elements(struct pipe_context* pipe,
+                              struct pipe_buffer* indexBuffer,
+                              unsigned indexSize,
+                              unsigned minIndex,
+                              unsigned maxIndex,
+                              unsigned mode,
+                              unsigned start,
+                              unsigned count);
+
+void r300_draw_elements(struct pipe_context* pipe,
+                        struct pipe_buffer* indexBuffer,
+                        unsigned indexSize, unsigned mode,
+                        unsigned start, unsigned count);
+
+void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
+                      unsigned start, unsigned count);
+
+void r300_swtcl_draw_arrays(struct pipe_context* pipe,
+                            unsigned mode,
+                            unsigned start,
+                            unsigned count);
+
+void r300_swtcl_draw_range_elements(struct pipe_context* pipe,
+                                    struct pipe_buffer* indexBuffer,
+                                    unsigned indexSize,
+                                    unsigned minIndex,
+                                    unsigned maxIndex,
+                                    unsigned mode,
+                                    unsigned start,
+                                    unsigned count);
 
 #endif /* R300_RENDER_H */
index d4045816d03ed7a428d8ea6849d057ad84c3b956..70a92fd4c6bfd053471f951b1c018f8d159ad6f3 100644 (file)
@@ -88,11 +88,11 @@ softpipe_unmap_constant_buffers(struct softpipe_context *sp)
 }
 
 
-boolean
+void
 softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
                      unsigned start, unsigned count)
 {
-   return softpipe_draw_elements(pipe, NULL, 0, mode, start, count);
+   softpipe_draw_elements(pipe, NULL, 0, mode, start, count);
 }
 
 
@@ -101,7 +101,7 @@ softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
  * Basically, map the vertex buffers (and drawing surfaces), then hand off
  * the drawing to the 'draw' module.
  */
-boolean
+void
 softpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_buffer *indexBuffer,
                              unsigned indexSize,
@@ -168,21 +168,19 @@ softpipe_draw_range_elements(struct pipe_context *pipe,
    softpipe_unmap_constant_buffers(sp);
 
    sp->dirty_render_cache = TRUE;
-   
-   return TRUE;
 }
 
 
-boolean
+void
 softpipe_draw_elements(struct pipe_context *pipe,
                        struct pipe_buffer *indexBuffer,
                        unsigned indexSize,
                        unsigned mode, unsigned start, unsigned count)
 {
-   return softpipe_draw_range_elements( pipe, indexBuffer,
-                                        indexSize,
-                                        0, 0xffffffff,
-                                        mode, start, count );
+   softpipe_draw_range_elements( pipe, indexBuffer,
+                                 indexSize,
+                                 0, 0xffffffff,
+                                 mode, start, count );
 }
 
 
index d488fb8710bd3bae17b8f7652e4bbcd8eb1a2d7f..7a614223871ef98a690ee72e9189cb7511d2421f 100644 (file)
@@ -174,14 +174,14 @@ void softpipe_set_vertex_buffers(struct pipe_context *,
 void softpipe_update_derived( struct softpipe_context *softpipe );
 
 
-boolean softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
-                            unsigned start, unsigned count);
-
-boolean softpipe_draw_elements(struct pipe_context *pipe,
-                              struct pipe_buffer *indexBuffer,
-                              unsigned indexSize,
-                              unsigned mode, unsigned start, unsigned count);
-boolean
+void softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
+                          unsigned start, unsigned count);
+
+void softpipe_draw_elements(struct pipe_context *pipe,
+                            struct pipe_buffer *indexBuffer,
+                            unsigned indexSize,
+                            unsigned mode, unsigned start, unsigned count);
+void
 softpipe_draw_range_elements(struct pipe_context *pipe,
                              struct pipe_buffer *indexBuffer,
                              unsigned indexSize,