Lines Matching refs:r300
39 void r300_emit_blend_state(struct r300_context* r300,
44 (struct pipe_framebuffer_state*)r300->fb_state.state;
45 CS_LOCALS(r300);
59 void r300_emit_blend_color_state(struct r300_context* r300,
63 CS_LOCALS(r300);
68 void r300_emit_clip_state(struct r300_context* r300,
72 CS_LOCALS(r300);
77 void r300_emit_dsa_state(struct r300_context* r300, unsigned size, void* state)
81 (struct pipe_framebuffer_state*)r300->fb_state.state;
82 CS_LOCALS(r300);
99 struct r300_context * r300,
102 struct r300_textures_state* texstate = r300->textures_state.state;
132 vec[0] = r300->viewport.scale[0];
133 vec[1] = r300->viewport.scale[1];
134 vec[2] = r300->viewport.scale[2];
139 vec[0] = r300->viewport.translate[0];
140 vec[1] = r300->viewport.translate[1];
141 vec[2] = r300->viewport.translate[2];
146 fprintf(stderr, "r300: Implementation error: "
156 * used by the R300 fragment shader.
189 void r300_emit_fs(struct r300_context* r300, unsigned size, void *state)
191 struct r300_fragment_shader *fs = r300_fs(r300);
192 CS_LOCALS(r300);
197 void r300_emit_fs_constants(struct r300_context* r300, unsigned size, void *state)
199 struct r300_fragment_shader *fs = r300_fs(r300);
203 CS_LOCALS(r300);
225 void r300_emit_fs_rc_constant_state(struct r300_context* r300, unsigned size, void *state)
227 struct r300_fragment_shader *fs = r300_fs(r300);
234 CS_LOCALS(r300);
244 get_rc_constant_state(data, r300, &constants->Constants[i]);
254 void r500_emit_fs(struct r300_context* r300, unsigned size, void *state)
256 struct r300_fragment_shader *fs = r300_fs(r300);
257 CS_LOCALS(r300);
262 void r500_emit_fs_constants(struct r300_context* r300, unsigned size, void *state)
264 struct r300_fragment_shader *fs = r300_fs(r300);
267 CS_LOCALS(r300);
286 void r500_emit_fs_rc_constant_state(struct r300_context* r300, unsigned size, void *state)
288 struct r300_fragment_shader *fs = r300_fs(r300);
294 CS_LOCALS(r300);
304 get_rc_constant_state(data, r300, &constants->Constants[i]);
316 void r300_emit_gpu_flush(struct r300_context *r300, unsigned size, void *state)
320 (struct pipe_framebuffer_state*)r300->fb_state.state;
323 CS_LOCALS(r300);
325 if (r300->cbzb_clear) {
332 DBG(r300, DBG_SCISSOR,
333 "r300: Scissor width: %i, height: %i, CBZB clear: %s\n",
334 width, height, r300->cbzb_clear ? "YES" : "NO");
341 if (r300->screen->caps.is_r500) {
357 void r300_emit_aa_state(struct r300_context *r300, unsigned size, void *state)
360 CS_LOCALS(r300);
375 void r300_emit_fb_state(struct r300_context* r300, unsigned size, void* state)
382 CS_LOCALS(r300);
388 if (r300->screen->caps.is_r500) {
391 if (fb->nr_cbufs && r300->fb_multiwrite) {
409 if (r300->cbzb_clear) {
420 DBG(r300, DBG_CBZB,
436 if (r300->hyperz_enabled) {
462 void r300_emit_hyperz_state(struct r300_context *r300,
466 CS_LOCALS(r300);
474 void r300_emit_hyperz_end(struct r300_context *r300)
477 *(struct r300_hyperz_state*)r300->hyperz_state.state;
485 r300_emit_hyperz_state(r300, r300->hyperz_state.size, &z);
488 void r300_emit_fb_state_pipelined(struct r300_context *r300,
492 (struct pipe_framebuffer_state*)r300->fb_state.state;
495 CS_LOCALS(r300);
499 if (r300->fb_multiwrite) {
546 debug_printf("r300: Bad number of multisamples!\n");
556 void r300_emit_query_start(struct r300_context *r300, unsigned size, void*state)
558 struct r300_query *query = r300->query_current;
559 CS_LOCALS(r300);
565 if (r300->screen->caps.family == CHIP_FAMILY_RV530) {
575 static void r300_emit_query_end_frag_pipes(struct r300_context *r300,
578 struct r300_capabilities* caps = &r300->screen->caps;
579 uint32_t gb_pipes = r300->screen->info.r300_num_gb_pipes;
580 CS_LOCALS(r300);
598 OUT_CS_RELOC(r300->query_current);
603 OUT_CS_RELOC(r300->query_current);
610 OUT_CS_RELOC(r300->query_current);
615 OUT_CS_RELOC(r300->query_current);
618 fprintf(stderr, "r300: Implementation error: Chipset reports %d"
628 static void rv530_emit_query_end_single_z(struct r300_context *r300,
631 CS_LOCALS(r300);
636 OUT_CS_RELOC(r300->query_current);
641 static void rv530_emit_query_end_double_z(struct r300_context *r300,
644 CS_LOCALS(r300);
649 OUT_CS_RELOC(r300->query_current);
652 OUT_CS_RELOC(r300->query_current);
657 void r300_emit_query_end(struct r300_context* r300)
659 struct r300_capabilities *caps = &r300->screen->caps;
660 struct r300_query *query = r300->query_current;
669 if (r300->screen->info.r300_num_z_pipes == 2)
670 rv530_emit_query_end_double_z(r300, query);
672 rv530_emit_query_end_single_z(r300, query);
674 r300_emit_query_end_frag_pipes(r300, query);
682 fprintf(stderr, "r300: Rewinding OQBO...\n");
686 void r300_emit_invariant_state(struct r300_context *r300,
689 CS_LOCALS(r300);
693 void r300_emit_rs_state(struct r300_context* r300, unsigned size, void* state)
696 CS_LOCALS(r300);
701 if (r300->zbuffer_bpp == 16) {
710 void r300_emit_rs_block_state(struct r300_context* r300,
717 CS_LOCALS(r300);
719 if (DBG_ON(r300, DBG_RS_BLOCK)) {
722 fprintf(stderr, "r300: RS emit:\n");
744 if (r300->screen->caps.is_r500) {
755 if (r300->screen->caps.is_r500) {
764 void r300_emit_scissor_state(struct r300_context* r300,
768 CS_LOCALS(r300);
772 if (r300->screen->caps.is_r500) {
786 void r300_emit_textures_state(struct r300_context *r300,
793 boolean has_us_format = r300->screen->caps.has_us_format;
794 CS_LOCALS(r300);
825 void r300_emit_vertex_arrays(struct r300_context* r300, int offset,
828 struct pipe_vertex_buffer *vbuf = r300->vertex_buffer;
829 struct pipe_vertex_element *velem = r300->velems->velem;
832 unsigned vertex_array_count = r300->velems->count;
835 unsigned *hw_format_size = r300->velems->format_size;
837 CS_LOCALS(r300);
925 void r300_emit_vertex_arrays_swtcl(struct r300_context *r300, boolean indexed)
927 CS_LOCALS(r300);
929 DBG(r300, DBG_SWTCL, "r300: Preparing vertex buffer %p for render, "
930 "vertex size %d\n", r300->vbo,
931 r300->vertex_info.size);
942 OUT_CS(r300->vertex_info.size |
943 (r300->vertex_info.size << 8));
944 OUT_CS(r300->draw_vbo_offset);
946 OUT_CS_RELOC(r300_resource(r300->vbo));
950 void r300_emit_vertex_stream_state(struct r300_context* r300,
956 CS_LOCALS(r300);
958 if (DBG_ON(r300, DBG_PSC)) {
959 fprintf(stderr, "r300: PSC emit:\n");
980 void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state)
982 CS_LOCALS(r300);
989 void r300_emit_vap_invariant_state(struct r300_context *r300,
992 CS_LOCALS(r300);
996 void r300_emit_vs_state(struct r300_context* r300, unsigned size, void* state)
1000 struct r300_screen* r300screen = r300->screen;
1012 CS_LOCALS(r300);
1043 OUT_CS_TABLE(code->fc_op_addrs.r300, R300_VS_MAX_FC_OPS);
1051 void r300_emit_vs_constants(struct r300_context* r300,
1055 ((struct r300_vertex_shader*)r300->vs_state.state)->externals_count;
1057 struct r300_vertex_shader *vs = (struct r300_vertex_shader*)r300->vs_state.state;
1062 CS_LOCALS(r300);
1070 (r300->screen->caps.is_r500 ?
1086 (r300->screen->caps.is_r500 ?
1098 void r300_emit_viewport_state(struct r300_context* r300,
1102 CS_LOCALS(r300);
1111 void r300_emit_hiz_clear(struct r300_context *r300, unsigned size, void *state)
1114 (struct pipe_framebuffer_state*)r300->fb_state.state;
1116 CS_LOCALS(r300);
1124 OUT_CS(r300->hiz_clear_value);
1128 r300->hiz_in_use = TRUE;
1129 r300->hiz_func = HIZ_FUNC_NONE;
1130 r300_mark_atom_dirty(r300, &r300->hyperz_state);
1133 void r300_emit_zmask_clear(struct r300_context *r300, unsigned size, void *state)
1136 (struct pipe_framebuffer_state*)r300->fb_state.state;
1138 CS_LOCALS(r300);
1150 r300->zmask_in_use = TRUE;
1151 r300_mark_atom_dirty(r300, &r300->hyperz_state);
1154 void r300_emit_ztop_state(struct r300_context* r300,
1158 CS_LOCALS(r300);
1165 void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, void* state)
1167 CS_LOCALS(r300);
1174 boolean r300_emit_buffer_validate(struct r300_context *r300,
1179 (struct pipe_framebuffer_state*)r300->fb_state.state;
1181 (struct r300_textures_state*)r300->textures_state.state;
1187 if (r300->fb_state.dirty) {
1192 r300->rws->cs_add_reloc(r300->cs, tex->cs_buf,
1200 r300->rws->cs_add_reloc(r300->cs, tex->cs_buf,
1205 if (r300->textures_state.dirty) {
1213 r300->rws->cs_add_reloc(r300->cs, tex->cs_buf, RADEON_USAGE_READ,
1218 if (r300->query_current)
1219 r300->rws->cs_add_reloc(r300->cs, r300->query_current->cs_buf,
1222 if (r300->vbo)
1223 r300->rws->cs_add_reloc(r300->cs, r300_resource(r300->vbo)->cs_buf,
1225 r300_resource(r300->vbo)->domain);
1227 if (do_validate_vertex_buffers && r300->vertex_arrays_dirty) {
1228 struct pipe_vertex_buffer *vbuf = r300->vertex_buffer;
1229 struct pipe_vertex_buffer *last = r300->vertex_buffer +
1230 r300->nr_vertex_buffers;
1238 r300->rws->cs_add_reloc(r300->cs, r300_resource(buf)->cs_buf,
1245 r300->rws->cs_add_reloc(r300->cs, r300_resource(index_buffer)->cs_buf,
1250 if (!r300->rws->cs_validate(r300->cs)) {
1262 unsigned r300_get_num_dirty_dwords(struct r300_context *r300)
1267 foreach_dirty_atom(r300, atom) {
1279 unsigned r300_get_num_cs_end_dwords(struct r300_context *r300)
1285 dwords += r300->hyperz_state.size + 2; /* emit_hyperz_end + zcache flush */
1286 if (r300->screen->caps.is_r500)
1293 void r300_emit_dirty_state(struct r300_context* r300)
1297 foreach_dirty_atom(r300, atom) {
1299 atom->emit(r300, atom->size, atom->state);
1304 r300->first_dirty = NULL;
1305 r300->last_dirty = NULL;
1306 r300->dirty_hw++;