summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pt_vcache.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-04-02 11:55:03 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-04-02 12:02:32 +0100
commitae3c91e98ce3355bca22738440f8ba313b3b8b23 (patch)
tree11165b5c156a0f35c7ce831841a0d59b4cfa19d7 /src/gallium/auxiliary/draw/draw_pt_vcache.c
parent8e33194837dd206d920889851d9cf22190100c99 (diff)
draw: Set the backend prim in the pt 'prepare' operation
Leaving it until 'run' is bad as the primitive is pretty much state for some drivers and so needs to get set early. In some drivers this is used to determine things like vertex format, etc -- by the time we get to 'run', it's too late to change this.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_vcache.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_vcache.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_vcache.c b/src/gallium/auxiliary/draw/draw_pt_vcache.c
index 16ffedf580..5a068761df 100644
--- a/src/gallium/auxiliary/draw/draw_pt_vcache.c
+++ b/src/gallium/auxiliary/draw/draw_pt_vcache.c
@@ -59,6 +59,8 @@ struct vcache_frontend {
const void *elt_ptr;
struct draw_pt_middle_end *middle;
+
+ unsigned input_prim;
unsigned output_prim;
};
@@ -77,7 +79,6 @@ static void vcache_flush( struct vcache_frontend *vcache )
if (vcache->draw_count) {
vcache->middle->run( vcache->middle,
- vcache->output_prim,
vcache->fetch_elts,
vcache->fetch_count,
vcache->draw_elts,
@@ -173,7 +174,6 @@ static unsigned reduced_prim[PIPE_PRIM_POLYGON + 1] = {
static void vcache_run_pv2( struct draw_pt_front_end *frontend,
- unsigned prim,
pt_elt_func get_elt,
const void *elts,
unsigned count )
@@ -185,9 +185,8 @@ static void vcache_run_pv2( struct draw_pt_front_end *frontend,
*/
vcache->elt_func = get_elt;
vcache->elt_ptr = elts;
- vcache->output_prim = reduced_prim[prim];
- switch (prim) {
+ switch (vcache->input_prim) {
case PIPE_PRIM_POINTS:
for (i = 0; i < count; i ++) {
vcache_point( vcache,
@@ -304,7 +303,6 @@ static void vcache_run_pv2( struct draw_pt_front_end *frontend,
static void vcache_run_pv0( struct draw_pt_front_end *frontend,
- unsigned prim,
pt_elt_func get_elt,
const void *elts,
unsigned count )
@@ -316,9 +314,8 @@ static void vcache_run_pv0( struct draw_pt_front_end *frontend,
*/
vcache->elt_func = get_elt;
vcache->elt_ptr = elts;
- vcache->output_prim = reduced_prim[prim];
- switch (prim) {
+ switch (vcache->input_prim) {
case PIPE_PRIM_POINTS:
for (i = 0; i < count; i ++) {
vcache_point( vcache,
@@ -389,6 +386,7 @@ static void vcache_run_pv0( struct draw_pt_front_end *frontend,
}
static void vcache_prepare( struct draw_pt_front_end *frontend,
+ unsigned prim,
struct draw_pt_middle_end *middle )
{
struct vcache_frontend *vcache = (struct vcache_frontend *)frontend;
@@ -398,8 +396,11 @@ static void vcache_prepare( struct draw_pt_front_end *frontend,
else
vcache->base.run = vcache_run_pv2;
+ vcache->input_prim = prim;
+ vcache->output_prim = reduced_prim[prim];
+
vcache->middle = middle;
- middle->prepare( middle );
+ middle->prepare( middle, vcache->output_prim );
}