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