r300g: the vertex_stream_state atom for SWTCL should be static

plus whitespace and comment fixes.
This commit is contained in:
Marek Olšák
2010-05-15 22:25:25 +02:00
parent 04882a2947
commit cf5dff1f23
3 changed files with 9 additions and 4 deletions

View File

@@ -80,6 +80,9 @@ static void r300_destroy_context(struct pipe_context* context)
FREE(r300->ztop_state.state);
FREE(r300->fs_constants.state);
FREE(r300->vs_constants.state);
if (!r300->screen->caps.has_tcl) {
FREE(r300->vertex_stream_state.state);
}
FREE(r300);
}
@@ -151,6 +154,9 @@ static void r300_setup_atoms(struct r300_context* r300)
r300->ztop_state.state = CALLOC_STRUCT(r300_ztop_state);
r300->fs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
r300->vs_constants.state = CALLOC_STRUCT(r300_constant_buffer);
if (!r300->screen->caps.has_tcl) {
r300->vertex_stream_state.state = CALLOC_STRUCT(r300_vertex_stream_state);
}
/* Some non-CSO atoms don't use the state pointer. */
r300->invariant_state.allow_null_state = TRUE;

View File

@@ -1246,7 +1246,7 @@ static void r300_set_vertex_buffers(struct pipe_context* pipe,
}
}
/* Update the PSC tables. */
/* Initialize the PSC tables. */
static void r300_vertex_psc(struct r300_vertex_element_state *velems)
{
struct r300_vertex_stream_state *vstream = &velems->vertex_stream;
@@ -1385,7 +1385,6 @@ static void* r300_create_vertex_elements_state(struct pipe_context* pipe,
abort();
}
}
}
}
return velems;
@@ -1406,6 +1405,7 @@ static void r300_bind_vertex_elements_state(struct pipe_context *pipe,
if (r300->draw) {
draw_flush(r300->draw);
draw_set_vertex_elements(r300->draw, velems->count, velems->velem);
return;
}
UPDATE_STATE(&velems->vertex_stream, r300->vertex_stream_state);

View File

@@ -116,13 +116,12 @@ static void r300_draw_emit_all_attribs(struct r300_context* r300)
static void r300_swtcl_vertex_psc(struct r300_context *r300)
{
struct r300_vertex_stream_state *vstream = r300->vertex_stream_state.state;
struct vertex_info* vinfo = &r300->vertex_info;
struct vertex_info *vinfo = &r300->vertex_info;
uint16_t type, swizzle;
enum pipe_format format;
unsigned i, attrib_count;
int* vs_output_tab = r300->stream_loc_notcl;
/* XXX hax */
memset(vstream, 0, sizeof(struct r300_vertex_stream_state));
/* For each Draw attribute, route it to the fragment shader according