Untested.
svga_hwtnl_draw_range_elements( struct svga_hwtnl *hwtnl,
struct pipe_resource *indexBuffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
unsigned prim,
unsigned start,
- unsigned count,
- unsigned bias );
+ unsigned count );
enum pipe_error
svga_hwtnl_flush( struct svga_hwtnl *hwtnl );
svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl,
struct pipe_resource *index_buffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
unsigned prim,
unsigned start,
- unsigned count,
- unsigned bias )
+ unsigned count )
{
struct pipe_resource *upload_buffer = NULL;
SVGA3dPrimitiveRange range;
range.indexArray.offset = index_offset;
range.indexArray.stride = index_size;
range.indexWidth = index_size;
- range.indexBias = bias;
+ range.indexBias = index_bias;
ret = svga_hwtnl_prim( hwtnl, &range, min_index, max_index, index_buffer );
if (ret)
svga_hwtnl_draw_range_elements( struct svga_hwtnl *hwtnl,
struct pipe_resource *index_buffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
- unsigned prim, unsigned start, unsigned count,
- unsigned bias)
+ unsigned prim, unsigned start, unsigned count)
{
unsigned gen_prim, gen_size, gen_nr, gen_type;
u_translate_func gen_func;
*/
return svga_hwtnl_simple_draw_range_elements( hwtnl, index_buffer,
index_size,
+ index_bias,
min_index,
max_index,
- gen_prim, start, count, bias );
+ gen_prim, start, count );
}
else {
struct pipe_resource *gen_buf = NULL;
ret = svga_hwtnl_simple_draw_range_elements( hwtnl,
gen_buf,
gen_size,
+ index_bias,
min_index,
max_index,
gen_prim,
0,
- gen_nr,
- bias );
+ gen_nr );
if (ret)
goto done;
svga_hwtnl_simple_draw_range_elements( struct svga_hwtnl *hwtnl,
struct pipe_resource *indexBuffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
unsigned prim,
unsigned start,
- unsigned count,
- unsigned bias );
+ unsigned count );
#endif
retry_draw_range_elements( struct svga_context *svga,
struct pipe_resource *index_buffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
unsigned prim,
goto retry;
ret = svga_hwtnl_draw_range_elements( svga->hwtnl,
- index_buffer, index_size,
+ index_buffer, index_size, index_bias,
min_index, max_index,
- prim, start, count, 0 );
+ prim, start, count );
if (ret)
goto retry;
if (do_retry)
{
return retry_draw_range_elements( svga,
- index_buffer, index_size,
+ index_buffer, index_size, index_bias,
min_index, max_index,
prim, start, count,
FALSE );
svga_draw_range_elements( struct pipe_context *pipe,
struct pipe_resource *index_buffer,
unsigned index_size,
+ int index_bias,
unsigned min_index,
unsigned max_index,
unsigned prim, unsigned start, unsigned count)
ret = svga_swtnl_draw_range_elements( svga,
index_buffer,
index_size,
+ index_bias,
min_index, max_index,
prim,
start, count );
ret = retry_draw_range_elements( svga,
index_buffer,
index_size,
+ index_bias,
min_index,
max_index,
prim,
static void
svga_draw_elements( struct pipe_context *pipe,
struct pipe_resource *index_buffer,
- unsigned index_size,
+ unsigned index_size, int index_bias,
unsigned prim, unsigned start, unsigned count)
{
svga_draw_range_elements( pipe, index_buffer,
- index_size,
+ index_size, index_bias,
0, 0xffffffff,
prim, start, count );
}
svga_draw_arrays( struct pipe_context *pipe,
unsigned prim, unsigned start, unsigned count)
{
- svga_draw_range_elements(pipe, NULL, 0,
+ svga_draw_range_elements(pipe, NULL, 0, 0,
start, start + count - 1,
prim,
start, count);
svga_swtnl_draw_range_elements(struct svga_context *svga,
struct pipe_resource *indexBuffer,
unsigned indexSize,
+ int indexBias,
unsigned min_index,
unsigned max_index,
unsigned prim,
struct svga_vbuf_render *svga_render = svga_vbuf_render(render);
struct svga_context *svga = svga_render->svga;
struct pipe_screen *screen = svga->pipe.screen;
- unsigned bias = (svga_render->vbuf_offset - svga_render->vdecl_offset) / svga_render->vertex_size;
+ int bias = (svga_render->vbuf_offset - svga_render->vdecl_offset) / svga_render->vertex_size;
boolean ret;
size_t size = 2 * nr_indices;
ret = svga_hwtnl_draw_range_elements(svga->hwtnl,
svga_render->ibuf,
2,
+ bias,
svga_render->min_index,
svga_render->max_index,
svga_render->prim,
- svga_render->ibuf_offset / 2, nr_indices, bias);
+ svga_render->ibuf_offset / 2, nr_indices);
if(ret != PIPE_OK) {
svga_context_flush(svga, NULL);
ret = svga_hwtnl_draw_range_elements(svga->hwtnl,
svga_render->ibuf,
2,
+ bias,
svga_render->min_index,
svga_render->max_index,
svga_render->prim,
- svga_render->ibuf_offset / 2, nr_indices, bias);
+ svga_render->ibuf_offset / 2, nr_indices);
svga->swtnl.new_vbuf = TRUE;
assert(ret == PIPE_OK);
}
svga_swtnl_draw_range_elements(struct svga_context *svga,
struct pipe_resource *indexBuffer,
unsigned indexSize,
+ int indexBias,
unsigned min_index,
unsigned max_index,
unsigned prim, unsigned start, unsigned count)
&ib_transfer);
draw_set_mapped_element_buffer_range(draw,
- indexSize,
+ indexSize, indexBias,
min_index,
max_index,
map);
if (indexBuffer) {
pipe_buffer_unmap(&svga->pipe, indexBuffer, ib_transfer);
- draw_set_mapped_element_buffer(draw, 0, NULL);
+ draw_set_mapped_element_buffer(draw, 0, 0, NULL);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {