From the SW TCL fixups.
/* Open up the OQ BO. */
r300->oqbo = screen->buffer_create(screen, 4096,
PIPE_BUFFER_USAGE_VERTEX, 4096);
+ make_empty_list(&r300->query_list);
r300_init_flush_functions(r300);
r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300);
r300->dirty_state = R300_NEW_KITCHEN_SINK;
r300->dirty_hw++;
- make_empty_list(&r300->query_list);
return &r300->context;
}
/* Vertex buffers for Gallium. */
struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
- int vbuf_count;
+ int vertex_buffer_count;
/* Vertex elements for Gallium. */
struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
- int aos_count;
+ int vertex_element_count;
/* Bitmask of dirty state objects. */
uint32_t dirty_state;
END_CS;
}
+/* XXX I can't read this and that's not good */
void r300_emit_aos(struct r300_context* r300, unsigned offset)
{
struct pipe_vertex_buffer *vbuf = r300->vertex_buffer;
struct pipe_vertex_element *velem = r300->vertex_element;
CS_LOCALS(r300);
int i;
- unsigned packet_size = (r300->aos_count * 3 + 1) / 2;
- BEGIN_CS(2 + packet_size + r300->aos_count * 2);
+ unsigned aos_count = r300->vertex_element_count;
+
+ unsigned packet_size = (aos_count * 3 + 1) / 2;
+ BEGIN_CS(2 + packet_size + aos_count * 2);
OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, packet_size);
- OUT_CS(r300->aos_count);
- for (i = 0; i < r300->aos_count - 1; i += 2) {
+ OUT_CS(aos_count);
+ for (i = 0; i < aos_count - 1; i += 2) {
int buf_num1 = velem[i].vertex_buffer_index;
int buf_num2 = velem[i+1].vertex_buffer_index;
assert(vbuf[buf_num1].stride % 4 == 0 && pf_get_size(velem[i].src_format) % 4 == 0);
OUT_CS(vbuf[buf_num2].buffer_offset + velem[i+1].src_offset +
offset * vbuf[buf_num2].stride);
}
- if (r300->aos_count & 1) {
+ if (aos_count & 1) {
int buf_num = velem[i].vertex_buffer_index;
assert(vbuf[buf_num].stride % 4 == 0 && pf_get_size(velem[i].src_format) % 4 == 0);
OUT_CS((pf_get_size(velem[i].src_format) >> 2) | (vbuf[buf_num].stride << 6));
offset * vbuf[buf_num].stride);
}
- for (i = 0; i < r300->aos_count; i++) {
+ /* XXX bare CS reloc */
+ for (i = 0; i < aos_count; i++) {
cs_winsys->write_cs_reloc(cs_winsys,
vbuf[velem[i].vertex_buffer_index].buffer,
RADEON_GEM_DOMAIN_GTT,
struct pipe_vertex_element *velem = r300->vertex_element;
validate:
- for (int i = 0; i < r300->aos_count; i++) {
+ for (int i = 0; i < r300->vertex_element_count; i++) {
if (!r300->winsys->add_buffer(r300->winsys,
vbuf[velem[i].vertex_buffer_index].buffer,
RADEON_GEM_DOMAIN_GTT, 0)) {
memcpy(r300->vertex_buffer, buffers,
sizeof(struct pipe_vertex_buffer) * count);
- r300->vbuf_count = count;
+ r300->vertex_buffer_count = count;
if (r300->draw) {
draw_flush(r300->draw);
memcpy(r300->vertex_element,
elements,
sizeof(struct pipe_vertex_element) * count);
- r300->aos_count = count;
+ r300->vertex_element_count = count;
if (r300->draw) {
draw_flush(r300->draw);
struct pipe_vertex_element *vert_elem;
int i;
- for (i = 0; i < r300->aos_count; i++) {
+ for (i = 0; i < r300->vertex_element_count; i++) {
vert_elem = &r300->vertex_element[i];
setup_vertex_attribute(r300->vertex_info, vert_elem, i);
}
- finish_vertex_attribs_setup(r300->vertex_info, r300->aos_count);
+ finish_vertex_attribs_setup(r300->vertex_info,
+ r300->vertex_element_count);
}
static INLINE int get_buffer_offset(struct r300_context *r300,