summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-07-17 01:10:46 +0800
committerChia-I Wu <[email protected]>2010-07-29 13:45:31 +0800
commita57f84251926045a3358822d0fd92ca95a4f0fde (patch)
treee8266450ebc90739dbee6cef74b498c8f745cb76 /src/gallium/drivers/r300
parentcd3ef7592cc9e2c83b175a8652c0153c578fb46b (diff)
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.
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_render.c69
-rw-r--r--src/gallium/drivers/r300/r300_render_stencilref.c55
2 files changed, 2 insertions, 122 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index da96098cc44..c179b07e86a 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -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;
}
diff --git a/src/gallium/drivers/r300/r300_render_stencilref.c b/src/gallium/drivers/r300/r300_render_stencilref.c
index 6d801cf1594..1f035d64a28 100644
--- a/src/gallium/drivers/r300/r300_render_stencilref.c
+++ b/src/gallium/drivers/r300/r300_render_stencilref.c
@@ -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;
}