gallium: propogate draw retval changes into more drivers
This commit is contained in:
parent
09e785ee04
commit
03f212b0d8
|
@ -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,
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
|
||||
|
||||
|
||||
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,18 +116,16 @@ 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,
|
||||
llvmpipe_draw_range_elements( pipe, indexBuffer,
|
||||
indexSize,
|
||||
0, 0xffffffff,
|
||||
mode, start, count );
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
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,
|
||||
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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
@ -318,7 +320,9 @@ nv50_draw_elements(struct pipe_context *pipe,
|
|||
|
||||
pipe_buffer_unmap(pscreen, indexBuffer);
|
||||
|
||||
return ret;
|
||||
/* XXX: what to do if ret != TRUE? Flush and retry?
|
||||
*/
|
||||
assert(ret);
|
||||
}
|
||||
|
||||
static INLINE boolean
|
||||
|
|
|
@ -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,
|
||||
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,
|
||||
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. */
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
uint32_t r300_translate_primitive(unsigned prim);
|
||||
|
||||
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,
|
||||
|
@ -34,20 +34,20 @@ boolean r300_draw_range_elements(struct pipe_context* pipe,
|
|||
unsigned start,
|
||||
unsigned count);
|
||||
|
||||
boolean r300_draw_elements(struct pipe_context* pipe,
|
||||
void 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,
|
||||
void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
|
||||
boolean r300_swtcl_draw_arrays(struct pipe_context* pipe,
|
||||
void r300_swtcl_draw_arrays(struct pipe_context* pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count);
|
||||
|
||||
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,
|
||||
|
|
|
@ -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,18 +168,16 @@ 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,
|
||||
softpipe_draw_range_elements( pipe, indexBuffer,
|
||||
indexSize,
|
||||
0, 0xffffffff,
|
||||
mode, start, count );
|
||||
|
|
|
@ -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,
|
||||
void softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
|
||||
boolean softpipe_draw_elements(struct pipe_context *pipe,
|
||||
void softpipe_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_buffer *indexBuffer,
|
||||
unsigned indexSize,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
boolean
|
||||
void
|
||||
softpipe_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_buffer *indexBuffer,
|
||||
unsigned indexSize,
|
||||
|
|
Loading…
Reference in New Issue