r300g: add size parameter to the atom emit functions
Maintaining a closer relationship between the atom size and what's passed in BEGIN_CS.
This commit is contained in:
@@ -45,7 +45,7 @@ struct r300_atom {
|
||||
/* Opaque state. */
|
||||
void* state;
|
||||
/* Emit the state to the context. */
|
||||
void (*emit)(struct r300_context*, void*);
|
||||
void (*emit)(struct r300_context*, unsigned, void*);
|
||||
/* Upper bound on number of dwords to emit. */
|
||||
unsigned size;
|
||||
/* Whether this atom should be emitted. */
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
#include "r300_screen.h"
|
||||
#include "r300_vs.h"
|
||||
|
||||
void r300_emit_blend_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_blend_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_blend_state* blend = (struct r300_blend_state*)state;
|
||||
struct pipe_framebuffer_state* fb =
|
||||
@@ -58,7 +59,8 @@ void r300_emit_blend_state(struct r300_context* r300, void* state)
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_blend_color_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_blend_color_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_blend_color_state* bc = (struct r300_blend_color_state*)state;
|
||||
struct r300_screen* r300screen = r300_screen(r300->context.screen);
|
||||
@@ -77,7 +79,8 @@ void r300_emit_blend_color_state(struct r300_context* r300, void* state)
|
||||
}
|
||||
}
|
||||
|
||||
void r300_emit_clip_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_clip_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct pipe_clip_state* clip = (struct pipe_clip_state*)state;
|
||||
int i;
|
||||
@@ -107,7 +110,7 @@ void r300_emit_clip_state(struct r300_context* r300, void* state)
|
||||
|
||||
}
|
||||
|
||||
void r300_emit_dsa_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_dsa_state(struct r300_context* r300, unsigned size, void* state)
|
||||
{
|
||||
struct r300_dsa_state* dsa = (struct r300_dsa_state*)state;
|
||||
struct r300_screen* r300screen = r300_screen(r300->context.screen);
|
||||
@@ -378,7 +381,7 @@ void r500_emit_fs_constant_buffer(struct r300_context* r300,
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_fb_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
|
||||
{
|
||||
struct pipe_framebuffer_state* fb = (struct pipe_framebuffer_state*)state;
|
||||
struct r300_screen* r300screen = r300_screen(r300->context.screen);
|
||||
@@ -578,7 +581,7 @@ void r300_emit_query_end(struct r300_context* r300)
|
||||
r300_emit_query_finish(r300, query);
|
||||
}
|
||||
|
||||
void r300_emit_rs_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state)
|
||||
{
|
||||
struct r300_rs_state* rs = (struct r300_rs_state*)state;
|
||||
float scale, offset;
|
||||
@@ -621,7 +624,8 @@ void r300_emit_rs_state(struct r300_context* r300, void* state)
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_rs_block_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_rs_block_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_rs_block* rs = (struct r300_rs_block*)state;
|
||||
unsigned i;
|
||||
@@ -663,7 +667,8 @@ void r300_emit_rs_block_state(struct r300_context* r300, void* state)
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_scissor_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_scissor_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
unsigned minx, miny, maxx, maxy;
|
||||
uint32_t top_left, bottom_right;
|
||||
@@ -810,7 +815,8 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset)
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_vertex_format_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_vertex_format_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_vertex_info* vertex_info = (struct r300_vertex_info*)state;
|
||||
unsigned i;
|
||||
@@ -856,7 +862,7 @@ static void r300_flush_pvs(struct r300_context* r300)
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_vs_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state)
|
||||
{
|
||||
struct r300_vertex_shader* vs = (struct r300_vertex_shader*)state;
|
||||
struct r300_vertex_program_code* code = &vs->code;
|
||||
@@ -942,7 +948,8 @@ void r300_emit_vs_constant_buffer(struct r300_context* r300,
|
||||
END_CS;
|
||||
}
|
||||
|
||||
void r300_emit_viewport_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_viewport_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_viewport_state* viewport = (struct r300_viewport_state*)state;
|
||||
CS_LOCALS(r300);
|
||||
@@ -986,7 +993,8 @@ void r300_emit_texture_count(struct r300_context* r300)
|
||||
|
||||
}
|
||||
|
||||
void r300_emit_ztop_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_ztop_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_ztop_state* ztop = (struct r300_ztop_state*)state;
|
||||
CS_LOCALS(r300);
|
||||
@@ -1110,7 +1118,7 @@ void r300_emit_dirty_state(struct r300_context* r300)
|
||||
|
||||
foreach(atom, &r300->atom_list) {
|
||||
if (atom->dirty || atom->always_dirty) {
|
||||
atom->emit(r300, atom->state);
|
||||
atom->emit(r300, atom->size, atom->state);
|
||||
atom->dirty = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,13 +31,17 @@ struct r300_vertex_program_code;
|
||||
|
||||
void r300_emit_aos(struct r300_context* r300, unsigned offset);
|
||||
|
||||
void r300_emit_blend_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_blend_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_blend_color_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_blend_color_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_clip_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_clip_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_dsa_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_dsa_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_fragment_program_code(struct r300_context* r300,
|
||||
struct rX00_fragment_program_code* generic_code);
|
||||
@@ -51,18 +55,20 @@ void r500_emit_fragment_program_code(struct r300_context* r300,
|
||||
void r500_emit_fs_constant_buffer(struct r300_context* r300,
|
||||
struct rc_constant_list* constants);
|
||||
|
||||
void r300_emit_fb_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state);
|
||||
|
||||
void r300_emit_query_begin(struct r300_context* r300,
|
||||
struct r300_query* query);
|
||||
|
||||
void r300_emit_query_end(struct r300_context* r300);
|
||||
|
||||
void r300_emit_rs_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state);
|
||||
|
||||
void r300_emit_rs_block_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_rs_block_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_scissor_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_scissor_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_texture(struct r300_context* r300,
|
||||
struct r300_sampler_state* sampler,
|
||||
@@ -71,7 +77,8 @@ void r300_emit_texture(struct r300_context* r300,
|
||||
|
||||
void r300_emit_vertex_buffer(struct r300_context* r300);
|
||||
|
||||
void r300_emit_vertex_format_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_vertex_format_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_vertex_program_code(struct r300_context* r300,
|
||||
struct r300_vertex_program_code* code);
|
||||
@@ -79,13 +86,15 @@ void r300_emit_vertex_program_code(struct r300_context* r300,
|
||||
void r300_emit_vs_constant_buffer(struct r300_context* r300,
|
||||
struct rc_constant_list* constants);
|
||||
|
||||
void r300_emit_vs_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state);
|
||||
|
||||
void r300_emit_viewport_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_viewport_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_emit_texture_count(struct r300_context* r300);
|
||||
|
||||
void r300_emit_ztop_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_ztop_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
void r300_flush_textures(struct r300_context* r300);
|
||||
|
||||
|
||||
@@ -38,7 +38,8 @@ struct pipe_viewport_state r300_viewport_identity = {
|
||||
*
|
||||
* Note that eventually this should be empty, but it's useful for development
|
||||
* and general unduplication of code. */
|
||||
void r300_emit_invariant_state(struct r300_context* r300, void* state)
|
||||
void r300_emit_invariant_state(struct r300_context* r300,
|
||||
unsigned size, void* state)
|
||||
{
|
||||
struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
|
||||
CS_LOCALS(r300);
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
struct r300_context;
|
||||
|
||||
void r300_emit_invariant_state(struct r300_context* r300, void* state);
|
||||
void r300_emit_invariant_state(struct r300_context* r300,
|
||||
unsigned size, void* state);
|
||||
|
||||
#endif /* R300_STATE_INVARIANT_H */
|
||||
|
||||
Reference in New Issue
Block a user