gallium: Keep only pipe_context::draw_vbo.
That is, remove pipe_context::draw_arrays, pipe_context::draw_elements, pipe_context::draw_arrays_instanced, pipe_context::draw_elements_instanced, pipe_context::draw_range_elements.
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_context.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
||||
#include "cell_context.h"
|
||||
#include "cell_draw_arrays.h"
|
||||
@@ -113,71 +112,9 @@ cell_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cell_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned min_index,
|
||||
unsigned max_index,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
struct cell_context *cell = cell_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = mode;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.index_bias = indexBias;
|
||||
info.min_index = min_index;
|
||||
info.max_index = max_index;
|
||||
|
||||
if (indexBuffer) {
|
||||
info.indexed = TRUE;
|
||||
saved_ib = cell->index_buffer;
|
||||
|
||||
ib.buffer = indexBuffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
cell_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexBuffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cell_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
cell_draw_range_elements( pipe, indexBuffer,
|
||||
indexSize, indexBias,
|
||||
0, 0xffffffff,
|
||||
mode, start, count );
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cell_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
cell_draw_elements(pipe, NULL, 0, 0, mode, start, count);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cell_init_draw_functions(struct cell_context *cell)
|
||||
{
|
||||
cell->pipe.draw_arrays = cell_draw_arrays;
|
||||
cell->pipe.draw_elements = cell_draw_elements;
|
||||
cell->pipe.draw_range_elements = cell_draw_range_elements;
|
||||
cell->pipe.draw_vbo = cell_draw_vbo;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
#include "pipe/p_context.h"
|
||||
|
||||
#include "fo_context.h"
|
||||
@@ -88,47 +87,6 @@ static void failover_draw_vbo( struct pipe_context *pipe,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void failover_draw_elements( struct pipe_context *pipe,
|
||||
struct pipe_resource *indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct failover_context *failover = failover_context( pipe );
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = prim;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
|
||||
if (indexResource) {
|
||||
info.indexed = TRUE;
|
||||
saved_ib = failover->index_buffer;
|
||||
|
||||
ib.buffer = indexResource;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
failover_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexResource)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
|
||||
static void failover_draw_arrays( struct pipe_context *pipe,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
failover_draw_elements(pipe, NULL, 0, 0, prim, start, count);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
failover_is_resource_referenced( struct pipe_context *_pipe,
|
||||
struct pipe_resource *resource,
|
||||
@@ -161,8 +119,6 @@ struct pipe_context *failover_create( struct pipe_context *hw,
|
||||
failover->pipe.get_paramf = hw->get_paramf;
|
||||
#endif
|
||||
|
||||
failover->pipe.draw_arrays = failover_draw_arrays;
|
||||
failover->pipe.draw_elements = failover_draw_elements;
|
||||
failover->pipe.draw_vbo = failover_draw_vbo;
|
||||
failover->pipe.clear = hw->clear;
|
||||
failover->pipe.clear_render_target = hw->clear_render_target;
|
||||
|
||||
@@ -47,71 +47,6 @@ galahad_destroy(struct pipe_context *_pipe)
|
||||
FREE(glhd_pipe);
|
||||
}
|
||||
|
||||
static void
|
||||
galahad_draw_arrays(struct pipe_context *_pipe,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct galahad_context *glhd_pipe = galahad_context(_pipe);
|
||||
struct pipe_context *pipe = glhd_pipe->pipe;
|
||||
|
||||
pipe->draw_arrays(pipe,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
galahad_draw_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct galahad_context *glhd_pipe = galahad_context(_pipe);
|
||||
struct galahad_resource *glhd_resource = galahad_resource(_indexResource);
|
||||
struct pipe_context *pipe = glhd_pipe->pipe;
|
||||
struct pipe_resource *indexResource = glhd_resource->resource;
|
||||
|
||||
pipe->draw_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
galahad_draw_range_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct galahad_context *glhd_pipe = galahad_context(_pipe);
|
||||
struct galahad_resource *glhd_resource = galahad_resource(_indexResource);
|
||||
struct pipe_context *pipe = glhd_pipe->pipe;
|
||||
struct pipe_resource *indexResource = glhd_resource->resource;
|
||||
|
||||
pipe->draw_range_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
minIndex,
|
||||
maxIndex,
|
||||
mode,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
galahad_draw_vbo(struct pipe_context *_pipe,
|
||||
const struct pipe_draw_info *info)
|
||||
@@ -979,9 +914,6 @@ galahad_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
|
||||
glhd_pipe->base.draw = NULL;
|
||||
|
||||
glhd_pipe->base.destroy = galahad_destroy;
|
||||
glhd_pipe->base.draw_arrays = galahad_draw_arrays;
|
||||
glhd_pipe->base.draw_elements = galahad_draw_elements;
|
||||
glhd_pipe->base.draw_range_elements = galahad_draw_range_elements;
|
||||
glhd_pipe->base.draw_vbo = galahad_draw_vbo;
|
||||
glhd_pipe->base.create_query = galahad_create_query;
|
||||
glhd_pipe->base.destroy_query = galahad_destroy_query;
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "pipe/p_defines.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
#include "pipe/p_screen.h"
|
||||
|
||||
|
||||
@@ -102,64 +101,6 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
i915_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned min_index,
|
||||
unsigned max_index,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
struct i915_context *i915 = i915_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = prim;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.index_bias = indexBias;
|
||||
info.min_index = min_index;
|
||||
info.max_index = max_index;
|
||||
|
||||
if (indexBuffer) {
|
||||
info.indexed = TRUE;
|
||||
saved_ib = i915->index_buffer;
|
||||
|
||||
ib.buffer = indexBuffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
i915_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexBuffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
static void
|
||||
i915_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
i915_draw_range_elements(pipe, indexBuffer,
|
||||
indexSize, indexBias,
|
||||
0, 0xffffffff,
|
||||
prim, start, count);
|
||||
}
|
||||
|
||||
static void
|
||||
i915_draw_arrays(struct pipe_context *pipe,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
i915_draw_elements(pipe, NULL, 0, 0, prim, start, count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Generic context functions
|
||||
@@ -203,9 +144,6 @@ i915_create_context(struct pipe_screen *screen, void *priv)
|
||||
|
||||
i915->base.clear = i915_clear;
|
||||
|
||||
i915->base.draw_arrays = i915_draw_arrays;
|
||||
i915->base.draw_elements = i915_draw_elements;
|
||||
i915->base.draw_range_elements = i915_draw_range_elements;
|
||||
i915->base.draw_vbo = i915_draw_vbo;
|
||||
|
||||
/*
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_prim.h"
|
||||
#include "util/u_upload_mgr.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
||||
#include "brw_draw.h"
|
||||
#include "brw_defines.h"
|
||||
@@ -220,74 +219,11 @@ brw_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
brw_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 mode, unsigned start, unsigned count)
|
||||
{
|
||||
struct brw_context *brw = brw_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = mode;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.index_bias = index_bias;
|
||||
info.min_index = min_index;
|
||||
info.max_index = max_index;
|
||||
|
||||
if (index_buffer) {
|
||||
info.indexed = TRUE;
|
||||
saved_ib.buffer = brw->curr.index_buffer;
|
||||
saved_ib.offset = brw->curr.index_offset;
|
||||
saved_ib.index_size = brw->curr.index_size;
|
||||
|
||||
ib.buffer = index_buffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = index_size;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
brw_draw_vbo(pipe, &info);
|
||||
|
||||
if (index_buffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
static void
|
||||
brw_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias,
|
||||
unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
brw_draw_range_elements( pipe, index_buffer,
|
||||
index_size, index_bias,
|
||||
0, 0xffffffff,
|
||||
mode,
|
||||
start, count );
|
||||
}
|
||||
|
||||
static void
|
||||
brw_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
brw_draw_elements(pipe, NULL, 0, 0, mode, start, count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
boolean brw_draw_init( struct brw_context *brw )
|
||||
{
|
||||
/* Register our drawing function:
|
||||
*/
|
||||
brw->base.draw_arrays = brw_draw_arrays;
|
||||
brw->base.draw_elements = brw_draw_elements;
|
||||
brw->base.draw_range_elements = brw_draw_range_elements;
|
||||
brw->base.draw_vbo = brw_draw_vbo;
|
||||
|
||||
/* Create helpers for uploading data in user buffers:
|
||||
|
||||
@@ -45,71 +45,6 @@ identity_destroy(struct pipe_context *_pipe)
|
||||
FREE(id_pipe);
|
||||
}
|
||||
|
||||
static void
|
||||
identity_draw_arrays(struct pipe_context *_pipe,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct identity_context *id_pipe = identity_context(_pipe);
|
||||
struct pipe_context *pipe = id_pipe->pipe;
|
||||
|
||||
pipe->draw_arrays(pipe,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
identity_draw_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct identity_context *id_pipe = identity_context(_pipe);
|
||||
struct identity_resource *id_resource = identity_resource(_indexResource);
|
||||
struct pipe_context *pipe = id_pipe->pipe;
|
||||
struct pipe_resource *indexResource = id_resource->resource;
|
||||
|
||||
pipe->draw_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
identity_draw_range_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct identity_context *id_pipe = identity_context(_pipe);
|
||||
struct identity_resource *id_resource = identity_resource(_indexResource);
|
||||
struct pipe_context *pipe = id_pipe->pipe;
|
||||
struct pipe_resource *indexResource = id_resource->resource;
|
||||
|
||||
pipe->draw_range_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
minIndex,
|
||||
maxIndex,
|
||||
mode,
|
||||
start,
|
||||
count);
|
||||
}
|
||||
|
||||
static void
|
||||
identity_draw_vbo(struct pipe_context *_pipe,
|
||||
const struct pipe_draw_info *info)
|
||||
@@ -917,9 +852,6 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
|
||||
id_pipe->base.draw = NULL;
|
||||
|
||||
id_pipe->base.destroy = identity_destroy;
|
||||
id_pipe->base.draw_arrays = identity_draw_arrays;
|
||||
id_pipe->base.draw_elements = identity_draw_elements;
|
||||
id_pipe->base.draw_range_elements = identity_draw_range_elements;
|
||||
id_pipe->base.draw_vbo = identity_draw_vbo;
|
||||
id_pipe->base.create_query = identity_create_query;
|
||||
id_pipe->base.destroy_query = identity_destroy_query;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "pipe/p_defines.h"
|
||||
#include "pipe/p_context.h"
|
||||
#include "util/u_prim.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
||||
#include "lp_context.h"
|
||||
#include "lp_state.h"
|
||||
@@ -109,158 +108,8 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llvmpipe_draw_range_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
struct llvmpipe_context *lp = llvmpipe_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = mode;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.start_instance = startInstance;
|
||||
info.instance_count = instanceCount;
|
||||
|
||||
info.index_bias = indexBias;
|
||||
info.min_index = minIndex;
|
||||
info.max_index = maxIndex;
|
||||
|
||||
if (indexBuffer) {
|
||||
info.indexed = TRUE;
|
||||
saved_ib = lp->index_buffer;
|
||||
|
||||
ib.buffer = indexBuffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
llvmpipe_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexBuffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
static void
|
||||
llvmpipe_draw_arrays_instanced(struct pipe_context *pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
llvmpipe_draw_range_elements_instanced(pipe,
|
||||
NULL, /* no indexBuffer */
|
||||
0, 0, /* indexSize, indexBias */
|
||||
0, ~0, /* minIndex, maxIndex */
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
startInstance,
|
||||
instanceCount);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llvmpipe_draw_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
llvmpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize, indexBias,
|
||||
0, ~0, /* minIndex, maxIndex */
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
startInstance,
|
||||
instanceCount);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llvmpipe_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
llvmpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize, indexBias,
|
||||
0, 0xffffffff, /* min, maxIndex */
|
||||
mode, start, count,
|
||||
0, /* startInstance */
|
||||
1); /* instanceCount */
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llvmpipe_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned min_index,
|
||||
unsigned max_index,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
llvmpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize, indexBias,
|
||||
min_index, max_index,
|
||||
mode, start, count,
|
||||
0, /* startInstance */
|
||||
1); /* instanceCount */
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
llvmpipe_draw_arrays(struct pipe_context *pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
llvmpipe_draw_range_elements_instanced(pipe,
|
||||
NULL, /* indexBuffer */
|
||||
0, /* indexSize */
|
||||
0, /* indexBias */
|
||||
0, ~0, /* min, maxIndex */
|
||||
mode, start, count,
|
||||
0, /* startInstance */
|
||||
1); /* instanceCount */
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
llvmpipe_init_draw_funcs(struct llvmpipe_context *llvmpipe)
|
||||
{
|
||||
llvmpipe->pipe.draw_arrays = llvmpipe_draw_arrays;
|
||||
llvmpipe->pipe.draw_elements = llvmpipe_draw_elements;
|
||||
llvmpipe->pipe.draw_range_elements = llvmpipe_draw_range_elements;
|
||||
llvmpipe->pipe.draw_arrays_instanced = llvmpipe_draw_arrays_instanced;
|
||||
llvmpipe->pipe.draw_elements_instanced = llvmpipe_draw_elements_instanced;
|
||||
|
||||
llvmpipe->pipe.draw_vbo = llvmpipe_draw_vbo;
|
||||
}
|
||||
|
||||
@@ -82,10 +82,6 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
|
||||
|
||||
nv50->pipe.destroy = nv50_destroy;
|
||||
|
||||
nv50->pipe.draw_arrays = nv50_draw_arrays;
|
||||
nv50->pipe.draw_arrays_instanced = nv50_draw_arrays_instanced;
|
||||
nv50->pipe.draw_elements = nv50_draw_elements;
|
||||
nv50->pipe.draw_elements_instanced = nv50_draw_elements_instanced;
|
||||
nv50->pipe.draw_vbo = nv50_draw_vbo;
|
||||
nv50->pipe.clear = nv50_clear;
|
||||
|
||||
|
||||
@@ -180,24 +180,6 @@ 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 void nv50_draw_arrays(struct pipe_context *, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
extern void nv50_draw_arrays_instanced(struct pipe_context *, unsigned mode,
|
||||
unsigned start, unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
extern void nv50_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start,
|
||||
unsigned count);
|
||||
extern void nv50_draw_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
extern void nv50_draw_vbo(struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info);
|
||||
extern void nv50_vtxelt_construct(struct nv50_vtxelt_stateobj *cso);
|
||||
|
||||
@@ -173,7 +173,7 @@ instance_step(struct nv50_context *nv50, struct instance *a)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nv50_draw_arrays_instanced(struct pipe_context *pipe,
|
||||
unsigned mode, unsigned start, unsigned count,
|
||||
unsigned startInstance, unsigned instanceCount)
|
||||
@@ -220,13 +220,6 @@ nv50_draw_arrays_instanced(struct pipe_context *pipe,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nv50_draw_arrays(struct pipe_context *pipe, unsigned mode, unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
nv50_draw_arrays_instanced(pipe, mode, start, count, 0, 1);
|
||||
}
|
||||
|
||||
struct inline_ctx {
|
||||
struct nv50_context *nv50;
|
||||
void *map;
|
||||
@@ -384,7 +377,7 @@ nv50_draw_elements_inline(struct pipe_context *pipe,
|
||||
pipe_buffer_unmap(pipe, indexBuffer, transfer);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nv50_draw_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
@@ -463,16 +456,6 @@ nv50_draw_elements_instanced(struct pipe_context *pipe,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nv50_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
nv50_draw_elements_instanced(pipe, indexBuffer, indexSize, indexBias,
|
||||
mode, start, count, 0, 1);
|
||||
}
|
||||
|
||||
void
|
||||
nv50_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
{
|
||||
|
||||
@@ -55,8 +55,6 @@ nvfx_create(struct pipe_screen *pscreen, void *priv)
|
||||
nvfx->pipe.screen = pscreen;
|
||||
nvfx->pipe.priv = priv;
|
||||
nvfx->pipe.destroy = nvfx_destroy;
|
||||
nvfx->pipe.draw_arrays = nvfx_draw_arrays;
|
||||
nvfx->pipe.draw_elements = nvfx_draw_elements;
|
||||
nvfx->pipe.draw_vbo = nvfx_draw_vbo;
|
||||
nvfx->pipe.clear = nvfx_clear;
|
||||
nvfx->pipe.flush = nvfx_flush;
|
||||
|
||||
@@ -236,13 +236,6 @@ extern void nvfx_init_transfer_functions(struct nvfx_context *nvfx);
|
||||
/* nvfx_vbo.c */
|
||||
extern boolean nvfx_vbo_validate(struct nvfx_context *nvfx);
|
||||
extern void nvfx_vbo_relocate(struct nvfx_context *nvfx);
|
||||
extern void nvfx_draw_arrays(struct pipe_context *, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
extern void nvfx_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start,
|
||||
unsigned count);
|
||||
extern void nvfx_draw_vbo(struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ nvfx_vbo_static_attrib(struct nvfx_context *nvfx,
|
||||
pipe_buffer_unmap(&nvfx->pipe, vb->buffer, transfer);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nvfx_draw_arrays(struct pipe_context *pipe,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
@@ -463,7 +463,7 @@ nvfx_draw_elements_vbo(struct pipe_context *pipe,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
nvfx_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_upload_mgr.h"
|
||||
#include "util/u_prim.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
||||
#include "r300_cs.h"
|
||||
#include "r300_context.h"
|
||||
@@ -567,19 +566,6 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
|
||||
}
|
||||
}
|
||||
|
||||
/* Simple helpers for context setup. Should probably be moved to util. */
|
||||
static void r300_draw_elements(struct pipe_context* pipe,
|
||||
struct pipe_resource* indexBuffer,
|
||||
unsigned indexSize, int indexBias, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
struct r300_context *r300 = r300_context(pipe);
|
||||
|
||||
pipe->draw_range_elements(pipe, indexBuffer, indexSize, indexBias,
|
||||
0, r300->vertex_buffer_max_index,
|
||||
mode, start, count);
|
||||
}
|
||||
|
||||
static void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
@@ -735,54 +721,6 @@ static void r300_swtcl_draw_vbo(struct pipe_context* pipe,
|
||||
}
|
||||
}
|
||||
|
||||
/* SW TCL elements, using Draw. */
|
||||
static void r300_swtcl_draw_range_elements(struct pipe_context* pipe,
|
||||
struct pipe_resource* indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct r300_context* r300 = r300_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = mode;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.index_bias = indexBias;
|
||||
info.min_index = minIndex;
|
||||
info.max_index = maxIndex;
|
||||
|
||||
if (indexBuffer) {
|
||||
info.indexed = TRUE;
|
||||
|
||||
saved_ib = r300->index_buffer;
|
||||
ib.buffer = indexBuffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
r300_swtcl_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexBuffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
static void r300_swtcl_draw_arrays(struct pipe_context* pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
r300_swtcl_draw_range_elements(pipe, NULL, 0, 0,
|
||||
start, start + count -1, mode, start, count);
|
||||
}
|
||||
|
||||
/* Object for rendering using Draw. */
|
||||
struct r300_render {
|
||||
/* Parent class */
|
||||
@@ -1179,17 +1117,10 @@ static void r300_resource_resolve(struct pipe_context* pipe,
|
||||
|
||||
void r300_init_render_functions(struct r300_context *r300)
|
||||
{
|
||||
/* Set generic functions. */
|
||||
r300->context.draw_elements = r300_draw_elements;
|
||||
|
||||
/* Set draw functions based on presence of HW TCL. */
|
||||
if (r300->screen->caps.has_tcl) {
|
||||
r300->context.draw_arrays = r300_draw_arrays;
|
||||
r300->context.draw_range_elements = r300_draw_range_elements;
|
||||
r300->context.draw_vbo = r300_draw_vbo;
|
||||
} else {
|
||||
r300->context.draw_arrays = r300_swtcl_draw_arrays;
|
||||
r300->context.draw_range_elements = r300_swtcl_draw_range_elements;
|
||||
r300->context.draw_vbo = r300_swtcl_draw_vbo;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,6 @@
|
||||
#include "r300_reg.h"
|
||||
|
||||
struct r300_stencilref_context {
|
||||
void (*draw_arrays)(struct pipe_context *pipe,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
|
||||
void (*draw_range_elements)(
|
||||
struct pipe_context *pipe, struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias, unsigned minIndex, unsigned maxIndex,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
|
||||
void (*draw_vbo)(struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
@@ -108,45 +100,6 @@ static void r300_stencilref_end(struct r300_context *r300)
|
||||
r300->dsa_state.dirty = TRUE;
|
||||
}
|
||||
|
||||
static void r300_stencilref_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
struct r300_context *r300 = r300_context(pipe);
|
||||
struct r300_stencilref_context *sr = r300->stencilref_fallback;
|
||||
|
||||
if (!r300_stencilref_needed(r300)) {
|
||||
sr->draw_arrays(pipe, mode, start, count);
|
||||
} else {
|
||||
r300_stencilref_begin(r300);
|
||||
sr->draw_arrays(pipe, mode, start, count);
|
||||
r300_stencilref_switch_side(r300);
|
||||
sr->draw_arrays(pipe, mode, start, count);
|
||||
r300_stencilref_end(r300);
|
||||
}
|
||||
}
|
||||
|
||||
static void r300_stencilref_draw_range_elements(
|
||||
struct pipe_context *pipe, struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias, unsigned minIndex, unsigned maxIndex,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
struct r300_context *r300 = r300_context(pipe);
|
||||
struct r300_stencilref_context *sr = r300->stencilref_fallback;
|
||||
|
||||
if (!r300_stencilref_needed(r300)) {
|
||||
sr->draw_range_elements(pipe, indexBuffer, indexSize, indexBias,
|
||||
minIndex, maxIndex, mode, start, count);
|
||||
} else {
|
||||
r300_stencilref_begin(r300);
|
||||
sr->draw_range_elements(pipe, indexBuffer, indexSize, indexBias,
|
||||
minIndex, maxIndex, mode, start, count);
|
||||
r300_stencilref_switch_side(r300);
|
||||
sr->draw_range_elements(pipe, indexBuffer, indexSize, indexBias,
|
||||
minIndex, maxIndex, mode, start, count);
|
||||
r300_stencilref_end(r300);
|
||||
}
|
||||
}
|
||||
|
||||
static void r300_stencilref_draw_vbo(struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info)
|
||||
{
|
||||
@@ -168,13 +121,9 @@ void r300_plug_in_stencil_ref_fallback(struct r300_context *r300)
|
||||
{
|
||||
r300->stencilref_fallback = CALLOC_STRUCT(r300_stencilref_context);
|
||||
|
||||
/* Save original draw functions. */
|
||||
r300->stencilref_fallback->draw_arrays = r300->context.draw_arrays;
|
||||
r300->stencilref_fallback->draw_range_elements = r300->context.draw_range_elements;
|
||||
/* Save original draw function. */
|
||||
r300->stencilref_fallback->draw_vbo = r300->context.draw_vbo;
|
||||
|
||||
/* Override the draw functions. */
|
||||
r300->context.draw_arrays = r300_stencilref_draw_arrays;
|
||||
r300->context.draw_range_elements = r300_stencilref_draw_range_elements;
|
||||
/* Override the draw function. */
|
||||
r300->context.draw_vbo = r300_stencilref_draw_vbo;
|
||||
}
|
||||
|
||||
@@ -313,9 +313,6 @@ struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv)
|
||||
rctx->context.screen = screen;
|
||||
rctx->context.priv = priv;
|
||||
rctx->context.destroy = r600_destroy_context;
|
||||
rctx->context.draw_arrays = r600_draw_arrays;
|
||||
rctx->context.draw_elements = r600_draw_elements;
|
||||
rctx->context.draw_range_elements = r600_draw_range_elements;
|
||||
rctx->context.draw_vbo = r600_draw_vbo;
|
||||
rctx->context.flush = r600_flush;
|
||||
|
||||
|
||||
@@ -191,17 +191,6 @@ struct r600_context_state *r600_context_state_decref(struct r600_context_state *
|
||||
|
||||
int r600_context_hw_states(struct r600_context *rctx);
|
||||
|
||||
void r600_draw_arrays(struct pipe_context *ctx, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
void r600_draw_elements(struct pipe_context *ctx,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
void r600_draw_range_elements(struct pipe_context *ctx,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias, unsigned min_index,
|
||||
unsigned max_index, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
void r600_draw_vbo(struct pipe_context *ctx,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
|
||||
@@ -176,56 +176,6 @@ static int r600_draw_common(struct r600_draw *draw)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void r600_draw_range_elements(struct pipe_context *ctx,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias, unsigned min_index,
|
||||
unsigned max_index, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
struct r600_draw draw;
|
||||
assert(index_bias == 0);
|
||||
|
||||
draw.ctx = ctx;
|
||||
draw.mode = mode;
|
||||
draw.start = start;
|
||||
draw.count = count;
|
||||
draw.index_size = index_size;
|
||||
draw.index_buffer = index_buffer;
|
||||
printf("index_size %d min %d max %d start %d count %d\n", index_size, min_index, max_index, start, count);
|
||||
r600_draw_common(&draw);
|
||||
}
|
||||
|
||||
void r600_draw_elements(struct pipe_context *ctx,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
struct r600_draw draw;
|
||||
assert(index_bias == 0);
|
||||
|
||||
draw.ctx = ctx;
|
||||
draw.mode = mode;
|
||||
draw.start = start;
|
||||
draw.count = count;
|
||||
draw.index_size = index_size;
|
||||
draw.index_buffer = index_buffer;
|
||||
r600_draw_common(&draw);
|
||||
}
|
||||
|
||||
void r600_draw_arrays(struct pipe_context *ctx, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
struct r600_draw draw;
|
||||
|
||||
draw.ctx = ctx;
|
||||
draw.mode = mode;
|
||||
draw.start = start;
|
||||
draw.count = count;
|
||||
draw.index_size = 0;
|
||||
draw.index_buffer = NULL;
|
||||
r600_draw_common(&draw);
|
||||
}
|
||||
|
||||
void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
|
||||
{
|
||||
struct r600_context *rctx = r600_context(ctx);
|
||||
|
||||
@@ -102,89 +102,6 @@ rbug_draw_block_locked(struct rbug_context *rb_pipe, int flag)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
rbug_draw_arrays(struct pipe_context *_pipe,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||
struct pipe_context *pipe = rb_pipe->pipe;
|
||||
|
||||
pipe_mutex_lock(rb_pipe->draw_mutex);
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
|
||||
|
||||
pipe->draw_arrays(pipe,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
|
||||
pipe_mutex_unlock(rb_pipe->draw_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
rbug_draw_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned prim,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||
struct rbug_resource *rb_resource = rbug_resource(_indexResource);
|
||||
struct pipe_context *pipe = rb_pipe->pipe;
|
||||
struct pipe_resource *indexResource = rb_resource->resource;
|
||||
|
||||
pipe_mutex_lock(rb_pipe->draw_mutex);
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
|
||||
|
||||
pipe->draw_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
prim,
|
||||
start,
|
||||
count);
|
||||
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
|
||||
pipe_mutex_unlock(rb_pipe->draw_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
rbug_draw_range_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexResource,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct rbug_context *rb_pipe = rbug_context(_pipe);
|
||||
struct rbug_resource *rb_resource = rbug_resource(_indexResource);
|
||||
struct pipe_context *pipe = rb_pipe->pipe;
|
||||
struct pipe_resource *indexResource = rb_resource->resource;
|
||||
|
||||
pipe_mutex_lock(rb_pipe->draw_mutex);
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
|
||||
|
||||
pipe->draw_range_elements(pipe,
|
||||
indexResource,
|
||||
indexSize,
|
||||
indexBias,
|
||||
minIndex,
|
||||
maxIndex,
|
||||
mode,
|
||||
start,
|
||||
count);
|
||||
|
||||
rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
|
||||
pipe_mutex_unlock(rb_pipe->draw_mutex);
|
||||
}
|
||||
|
||||
static void
|
||||
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
|
||||
{
|
||||
@@ -1072,9 +989,6 @@ rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
|
||||
rb_pipe->base.draw = NULL;
|
||||
|
||||
rb_pipe->base.destroy = rbug_destroy;
|
||||
rb_pipe->base.draw_arrays = rbug_draw_arrays;
|
||||
rb_pipe->base.draw_elements = rbug_draw_elements;
|
||||
rb_pipe->base.draw_range_elements = rbug_draw_range_elements;
|
||||
rb_pipe->base.draw_vbo = rbug_draw_vbo;
|
||||
rb_pipe->base.create_query = rbug_create_query;
|
||||
rb_pipe->base.destroy_query = rbug_destroy_query;
|
||||
|
||||
@@ -284,11 +284,6 @@ softpipe_create_context( struct pipe_screen *screen,
|
||||
softpipe->pipe.set_vertex_buffers = softpipe_set_vertex_buffers;
|
||||
softpipe->pipe.set_index_buffer = softpipe_set_index_buffer;
|
||||
|
||||
softpipe->pipe.draw_arrays = softpipe_draw_arrays;
|
||||
softpipe->pipe.draw_elements = softpipe_draw_elements;
|
||||
softpipe->pipe.draw_range_elements = softpipe_draw_range_elements;
|
||||
softpipe->pipe.draw_arrays_instanced = softpipe_draw_arrays_instanced;
|
||||
softpipe->pipe.draw_elements_instanced = softpipe_draw_elements_instanced;
|
||||
softpipe->pipe.draw_vbo = softpipe_draw_vbo;
|
||||
softpipe->pipe.draw_stream_output = softpipe_draw_stream_output;
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "pipe/p_context.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_prim.h"
|
||||
#include "util/u_draw_quad.h"
|
||||
|
||||
#include "sp_context.h"
|
||||
#include "sp_query.h"
|
||||
@@ -173,152 +172,3 @@ softpipe_draw_vbo(struct pipe_context *pipe,
|
||||
/* Note: leave drawing surfaces mapped */
|
||||
sp->dirty_render_cache = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
softpipe_draw_range_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
struct softpipe_context *sp = softpipe_context(pipe);
|
||||
struct pipe_draw_info info;
|
||||
struct pipe_index_buffer saved_ib, ib;
|
||||
|
||||
util_draw_init_info(&info);
|
||||
info.mode = mode;
|
||||
info.start = start;
|
||||
info.count = count;
|
||||
info.start_instance = startInstance;
|
||||
info.instance_count = instanceCount;
|
||||
info.index_bias = indexBias;
|
||||
info.min_index = minIndex;
|
||||
info.max_index = maxIndex;
|
||||
|
||||
if (indexBuffer) {
|
||||
info.indexed = TRUE;
|
||||
|
||||
saved_ib = sp->index_buffer;
|
||||
ib.buffer = indexBuffer;
|
||||
ib.offset = 0;
|
||||
ib.index_size = indexSize;
|
||||
pipe->set_index_buffer(pipe, &ib);
|
||||
}
|
||||
|
||||
softpipe_draw_vbo(pipe, &info);
|
||||
|
||||
if (indexBuffer)
|
||||
pipe->set_index_buffer(pipe, &saved_ib);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
softpipe_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned min_index,
|
||||
unsigned max_index,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
softpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize,
|
||||
indexBias,
|
||||
min_index,
|
||||
max_index,
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
0,
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
softpipe_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
softpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize,
|
||||
indexBias,
|
||||
0,
|
||||
0xffffffff,
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
0,
|
||||
1);
|
||||
}
|
||||
|
||||
void
|
||||
softpipe_draw_arrays_instanced(struct pipe_context *pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
softpipe_draw_range_elements_instanced(pipe,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0xffffffff,
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
startInstance,
|
||||
instanceCount);
|
||||
}
|
||||
|
||||
void
|
||||
softpipe_draw_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount)
|
||||
{
|
||||
softpipe_draw_range_elements_instanced(pipe,
|
||||
indexBuffer,
|
||||
indexSize,
|
||||
indexBias,
|
||||
0,
|
||||
0xffffffff,
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
startInstance,
|
||||
instanceCount);
|
||||
}
|
||||
|
||||
void
|
||||
softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count)
|
||||
{
|
||||
softpipe_draw_range_elements_instanced(pipe,
|
||||
NULL,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0xffffffff,
|
||||
mode,
|
||||
start,
|
||||
count,
|
||||
0,
|
||||
1);
|
||||
}
|
||||
|
||||
|
||||
@@ -228,41 +228,6 @@ void softpipe_set_index_buffer(struct pipe_context *,
|
||||
void softpipe_update_derived( struct softpipe_context *softpipe );
|
||||
|
||||
|
||||
void softpipe_draw_arrays(struct pipe_context *pipe, unsigned mode,
|
||||
unsigned start, unsigned count);
|
||||
|
||||
void softpipe_draw_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
void
|
||||
softpipe_draw_range_elements(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned min_index,
|
||||
unsigned max_index,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
|
||||
void
|
||||
softpipe_draw_arrays_instanced(struct pipe_context *pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
|
||||
void
|
||||
softpipe_draw_elements_instanced(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
|
||||
void
|
||||
softpipe_draw_vbo(struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info);
|
||||
|
||||
@@ -226,28 +226,6 @@ svga_draw_range_elements( struct pipe_context *pipe,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
svga_draw_elements( struct pipe_context *pipe,
|
||||
struct pipe_resource *index_buffer,
|
||||
unsigned index_size, int index_bias,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
svga_draw_range_elements( pipe, index_buffer,
|
||||
index_size, index_bias,
|
||||
0, 0xffffffff,
|
||||
prim, start, count );
|
||||
}
|
||||
|
||||
static void
|
||||
svga_draw_arrays( struct pipe_context *pipe,
|
||||
unsigned prim, unsigned start, unsigned count)
|
||||
{
|
||||
svga_draw_range_elements(pipe, NULL, 0, 0,
|
||||
start, start + count - 1,
|
||||
prim,
|
||||
start, count);
|
||||
}
|
||||
|
||||
static void
|
||||
svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
{
|
||||
@@ -274,8 +252,5 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
|
||||
void svga_init_draw_functions( struct svga_context *svga )
|
||||
{
|
||||
svga->pipe.draw_arrays = svga_draw_arrays;
|
||||
svga->pipe.draw_elements = svga_draw_elements;
|
||||
svga->pipe.draw_range_elements = svga_draw_range_elements;
|
||||
svga->pipe.draw_vbo = svga_draw_vbo;
|
||||
}
|
||||
|
||||
@@ -82,91 +82,6 @@ trace_surface_unwrap(struct trace_context *tr_ctx,
|
||||
}
|
||||
|
||||
|
||||
static INLINE void
|
||||
trace_context_draw_arrays(struct pipe_context *_pipe,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
struct trace_context *tr_ctx = trace_context(_pipe);
|
||||
struct pipe_context *pipe = tr_ctx->pipe;
|
||||
|
||||
trace_dump_call_begin("pipe_context", "draw_arrays");
|
||||
|
||||
trace_dump_arg(ptr, pipe);
|
||||
trace_dump_arg(uint, mode);
|
||||
trace_dump_arg(uint, start);
|
||||
trace_dump_arg(uint, count);
|
||||
|
||||
pipe->draw_arrays(pipe, mode, start, count);
|
||||
|
||||
trace_dump_call_end();
|
||||
}
|
||||
|
||||
|
||||
static INLINE void
|
||||
trace_context_draw_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexBuffer,
|
||||
unsigned indexSize, int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count)
|
||||
{
|
||||
struct trace_context *tr_ctx = trace_context(_pipe);
|
||||
struct trace_resource *tr_buf = trace_resource(_indexBuffer);
|
||||
struct pipe_context *pipe = tr_ctx->pipe;
|
||||
struct pipe_resource *indexBuffer = tr_buf->resource;
|
||||
|
||||
trace_dump_call_begin("pipe_context", "draw_elements");
|
||||
|
||||
trace_dump_arg(ptr, pipe);
|
||||
trace_dump_arg(ptr, indexBuffer);
|
||||
trace_dump_arg(uint, indexSize);
|
||||
trace_dump_arg(int, indexBias);
|
||||
trace_dump_arg(uint, mode);
|
||||
trace_dump_arg(uint, start);
|
||||
trace_dump_arg(uint, count);
|
||||
|
||||
pipe->draw_elements(pipe, indexBuffer, indexSize, indexBias,
|
||||
mode, start, count);
|
||||
|
||||
trace_dump_call_end();
|
||||
}
|
||||
|
||||
|
||||
static INLINE void
|
||||
trace_context_draw_range_elements(struct pipe_context *_pipe,
|
||||
struct pipe_resource *_indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count)
|
||||
{
|
||||
struct trace_context *tr_ctx = trace_context(_pipe);
|
||||
struct trace_resource *tr_buf = trace_resource(_indexBuffer);
|
||||
struct pipe_context *pipe = tr_ctx->pipe;
|
||||
struct pipe_resource *indexBuffer = tr_buf->resource;
|
||||
|
||||
trace_dump_call_begin("pipe_context", "draw_range_elements");
|
||||
|
||||
trace_dump_arg(ptr, pipe);
|
||||
trace_dump_arg(ptr, indexBuffer);
|
||||
trace_dump_arg(uint, indexSize);
|
||||
trace_dump_arg(int, indexBias);
|
||||
trace_dump_arg(uint, minIndex);
|
||||
trace_dump_arg(uint, maxIndex);
|
||||
trace_dump_arg(uint, mode);
|
||||
trace_dump_arg(uint, start);
|
||||
trace_dump_arg(uint, count);
|
||||
|
||||
pipe->draw_range_elements(pipe,
|
||||
indexBuffer, indexSize, indexBias,
|
||||
minIndex, maxIndex,
|
||||
mode, start, count);
|
||||
|
||||
trace_dump_call_end();
|
||||
}
|
||||
|
||||
|
||||
static INLINE void
|
||||
trace_context_draw_vbo(struct pipe_context *_pipe,
|
||||
const struct pipe_draw_info *info)
|
||||
@@ -1483,9 +1398,6 @@ trace_context_create(struct trace_screen *tr_scr,
|
||||
tr_ctx->base.screen = &tr_scr->base;
|
||||
|
||||
tr_ctx->base.destroy = trace_context_destroy;
|
||||
tr_ctx->base.draw_arrays = trace_context_draw_arrays;
|
||||
tr_ctx->base.draw_elements = trace_context_draw_elements;
|
||||
tr_ctx->base.draw_range_elements = trace_context_draw_range_elements;
|
||||
tr_ctx->base.draw_vbo = trace_context_draw_vbo;
|
||||
tr_ctx->base.create_query = trace_context_create_query;
|
||||
tr_ctx->base.destroy_query = trace_context_destroy_query;
|
||||
|
||||
@@ -61,47 +61,6 @@ struct pipe_context {
|
||||
* VBO drawing
|
||||
*/
|
||||
/*@{*/
|
||||
void (*draw_arrays)( struct pipe_context *pipe,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
|
||||
void (*draw_elements)( struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode, unsigned start, unsigned count);
|
||||
|
||||
void (*draw_arrays_instanced)(struct pipe_context *pipe,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
|
||||
void (*draw_elements_instanced)(struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count,
|
||||
unsigned startInstance,
|
||||
unsigned instanceCount);
|
||||
|
||||
/* XXX: this is (probably) a temporary entrypoint, as the range
|
||||
* information should be available from the vertex_buffer state.
|
||||
* Using this to quickly evaluate a specialized path in the draw
|
||||
* module.
|
||||
*/
|
||||
void (*draw_range_elements)( struct pipe_context *pipe,
|
||||
struct pipe_resource *indexBuffer,
|
||||
unsigned indexSize,
|
||||
int indexBias,
|
||||
unsigned minIndex,
|
||||
unsigned maxIndex,
|
||||
unsigned mode,
|
||||
unsigned start,
|
||||
unsigned count);
|
||||
|
||||
void (*draw_vbo)( struct pipe_context *pipe,
|
||||
const struct pipe_draw_info *info );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user