Lines Matching refs:r300

55         r300_mark_atom_dirty(r300, &(atom));   \
441 struct r300_context* r300 = r300_context(pipe); in r300_bind_blend_state() local
443 UPDATE_STATE(state, r300->blend_state); in r300_bind_blend_state()
464 struct r300_context* r300 = r300_context(pipe); in r300_set_blend_color() local
465 struct pipe_framebuffer_state *fb = r300->fb_state.state; in r300_set_blend_color()
467 (struct r300_blend_color_state*)r300->blend_color_state.state; in r300_set_blend_color()
508 if (r300->screen->caps.is_r500) { in r300_set_blend_color()
537 r300_mark_atom_dirty(r300, &r300->blend_color_state); in r300_set_blend_color()
543 struct r300_context* r300 = r300_context(pipe); in r300_set_clip_state() local
545 (struct r300_clip_state*)r300->clip_state.state; in r300_set_clip_state()
548 if (r300->screen->caps.has_tcl) { in r300_set_clip_state()
549 BEGIN_CB(clip->cb, r300->clip_state.size); in r300_set_clip_state()
551 (r300->screen->caps.is_r500 ? in r300_set_clip_state()
557 r300_mark_atom_dirty(r300, &r300->clip_state); in r300_set_clip_state()
559 draw_set_clip_state(r300->draw, state); in r300_set_clip_state()
708 static void r300_dsa_inject_stencilref(struct r300_context *r300) in r300_dsa_inject_stencilref() argument
711 (struct r300_dsa_state*)r300->dsa_state.state; in r300_dsa_inject_stencilref()
718 r300->stencil_ref.ref_value[0]; in r300_dsa_inject_stencilref()
721 r300->stencil_ref.ref_value[1]; in r300_dsa_inject_stencilref()
728 struct r300_context* r300 = r300_context(pipe); in r300_bind_dsa_state() local
734 UPDATE_STATE(state, r300->dsa_state); in r300_bind_dsa_state()
736 r300_mark_atom_dirty(r300, &r300->hyperz_state); /* Will be updated before the emission. */ in r300_bind_dsa_state()
737 r300_dsa_inject_stencilref(r300); in r300_bind_dsa_state()
750 struct r300_context* r300 = r300_context(pipe); in r300_set_stencil_ref() local
752 r300->stencil_ref = *sr; in r300_set_stencil_ref()
754 r300_dsa_inject_stencilref(r300); in r300_set_stencil_ref()
755 r300_mark_atom_dirty(r300, &r300->dsa_state); in r300_set_stencil_ref()
758 static void r300_tex_set_tiling_flags(struct r300_context *r300, in r300_tex_set_tiling_flags() argument
766 r300->rws->buffer_set_tiling(tex->buf, r300->cs, in r300_tex_set_tiling_flags()
776 static void r300_fb_set_tiling_flags(struct r300_context *r300, in r300_fb_set_tiling_flags() argument
783 r300_tex_set_tiling_flags(r300, in r300_fb_set_tiling_flags()
788 r300_tex_set_tiling_flags(r300, in r300_fb_set_tiling_flags()
817 void r300_mark_fb_state_dirty(struct r300_context *r300, in r300_mark_fb_state_dirty() argument
820 struct pipe_framebuffer_state *state = r300->fb_state.state; in r300_mark_fb_state_dirty()
822 r300_mark_atom_dirty(r300, &r300->gpu_flush); in r300_mark_fb_state_dirty()
823 r300_mark_atom_dirty(r300, &r300->fb_state); in r300_mark_fb_state_dirty()
827 r300_mark_atom_dirty(r300, &r300->aa_state); in r300_mark_fb_state_dirty()
828 r300_mark_atom_dirty(r300, &r300->dsa_state); /* for AlphaRef */ in r300_mark_fb_state_dirty()
829 r300_set_blend_color(&r300->context, r300->blend_color_state.state); in r300_mark_fb_state_dirty()
834 r300_mark_atom_dirty(r300, &r300->hyperz_state); in r300_mark_fb_state_dirty()
839 r300_mark_atom_dirty(r300, &r300->fb_state_pipelined); in r300_mark_fb_state_dirty()
843 r300->fb_state.size = 2 + (8 * state->nr_cbufs); in r300_mark_fb_state_dirty()
845 if (r300->cbzb_clear) { in r300_mark_fb_state_dirty()
846 r300->fb_state.size += 10; in r300_mark_fb_state_dirty()
848 r300->fb_state.size += 10; in r300_mark_fb_state_dirty()
849 if (r300->hyperz_enabled) in r300_mark_fb_state_dirty()
850 r300->fb_state.size += 8; in r300_mark_fb_state_dirty()
852 r300->fb_state.size += 10; in r300_mark_fb_state_dirty()
862 struct r300_context* r300 = r300_context(pipe); in r300_set_framebuffer_state() local
863 struct r300_aa_state *aa = (struct r300_aa_state*)r300->aa_state.state; in r300_set_framebuffer_state()
864 struct pipe_framebuffer_state *old_state = r300->fb_state.state; in r300_set_framebuffer_state()
869 if (r300->screen->caps.is_r500) { in r300_set_framebuffer_state()
871 } else if (r300->screen->caps.is_r400) { in r300_set_framebuffer_state()
883 if (old_state->zsbuf && r300->zmask_in_use && !r300->locked_zbuffer) { in r300_set_framebuffer_state()
888 r300_decompress_zmask(r300); in r300_set_framebuffer_state()
889 r300->hiz_in_use = FALSE; in r300_set_framebuffer_state()
893 pipe_surface_reference(&r300->locked_zbuffer, old_state->zsbuf); in r300_set_framebuffer_state()
895 } else if (r300->locked_zbuffer) { in r300_set_framebuffer_state()
898 if (!pipe_surface_equal(r300->locked_zbuffer, state->zsbuf)) { in r300_set_framebuffer_state()
901 r300_decompress_zmask_locked_unsafe(r300); in r300_set_framebuffer_state()
902 r300->hiz_in_use = FALSE; in r300_set_framebuffer_state()
909 assert(state->zsbuf || (r300->locked_zbuffer && !unlock_zbuffer) || !r300->zmask_in_use); in r300_set_framebuffer_state()
912 r300_mark_atom_dirty(r300, &r300->blend_state); in r300_set_framebuffer_state()
915 …r300_set_blend_color(pipe, &((struct r300_blend_color_state*)r300->blend_color_state.state)->state… in r300_set_framebuffer_state()
919 r300_mark_atom_dirty(r300, &r300->dsa_state); in r300_set_framebuffer_state()
922 if (r300->screen->info.drm_minor < 12) { in r300_set_framebuffer_state()
926 r300_fb_set_tiling_flags(r300, state); in r300_set_framebuffer_state()
929 util_copy_framebuffer_state(r300->fb_state.state, state); in r300_set_framebuffer_state()
932 pipe_surface_reference(&r300->locked_zbuffer, NULL); in r300_set_framebuffer_state()
935 r300_mark_fb_state_dirty(r300, R300_CHANGED_FB_STATE); in r300_set_framebuffer_state()
948 if (r300->zbuffer_bpp != zbuffer_bpp) { in r300_set_framebuffer_state()
949 r300->zbuffer_bpp = zbuffer_bpp; in r300_set_framebuffer_state()
951 if (r300->polygon_offset_enabled) in r300_set_framebuffer_state()
952 r300_mark_atom_dirty(r300, &r300->rs_state); in r300_set_framebuffer_state()
978 if (DBG_ON(r300, DBG_FB)) { in r300_set_framebuffer_state()
1004 void r300_mark_fs_code_dirty(struct r300_context *r300) in r300_mark_fs_code_dirty() argument
1006 struct r300_fragment_shader* fs = r300_fs(r300); in r300_mark_fs_code_dirty()
1008 r300_mark_atom_dirty(r300, &r300->fs); in r300_mark_fs_code_dirty()
1009 r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state); in r300_mark_fs_code_dirty()
1010 r300_mark_atom_dirty(r300, &r300->fs_constants); in r300_mark_fs_code_dirty()
1011 r300->fs.size = fs->shader->cb_code_size; in r300_mark_fs_code_dirty()
1013 if (r300->screen->caps.is_r500) { in r300_mark_fs_code_dirty()
1014 r300->fs_rc_constant_state.size = fs->shader->rc_state_count * 7; in r300_mark_fs_code_dirty()
1015 r300->fs_constants.size = fs->shader->externals_count * 4 + 3; in r300_mark_fs_code_dirty()
1017 r300->fs_rc_constant_state.size = fs->shader->rc_state_count * 5; in r300_mark_fs_code_dirty()
1018 r300->fs_constants.size = fs->shader->externals_count * 4 + 1; in r300_mark_fs_code_dirty()
1021 ((struct r300_constant_buffer*)r300->fs_constants.state)->remap_table = in r300_mark_fs_code_dirty()
1028 struct r300_context* r300 = r300_context(pipe); in r300_bind_fs_state() local
1032 r300->fs.state = NULL; in r300_bind_fs_state()
1036 r300->fs.state = fs; in r300_bind_fs_state()
1037 r300->fs_status = FRAGMENT_SHADER_DIRTY; in r300_bind_fs_state()
1039 r300_mark_atom_dirty(r300, &r300->rs_block_state); /* Will be updated before the emission. */ in r300_bind_fs_state()
1291 struct r300_context* r300 = r300_context(pipe); in r300_bind_rs_state() local
1293 int last_sprite_coord_enable = r300->sprite_coord_enable; in r300_bind_rs_state()
1294 boolean last_two_sided_color = r300->two_sided_color; in r300_bind_rs_state()
1296 if (r300->draw && rs) { in r300_bind_rs_state()
1297 draw_set_rasterizer_state(r300->draw, &rs->rs_draw, state); in r300_bind_rs_state()
1301 r300->polygon_offset_enabled = rs->polygon_offset_enable; in r300_bind_rs_state()
1302 r300->sprite_coord_enable = rs->rs.sprite_coord_enable; in r300_bind_rs_state()
1303 r300->two_sided_color = rs->rs.light_twoside; in r300_bind_rs_state()
1305 r300->polygon_offset_enabled = FALSE; in r300_bind_rs_state()
1306 r300->sprite_coord_enable = 0; in r300_bind_rs_state()
1307 r300->two_sided_color = FALSE; in r300_bind_rs_state()
1310 UPDATE_STATE(state, r300->rs_state); in r300_bind_rs_state()
1311 r300->rs_state.size = RS_STATE_MAIN_SIZE + (r300->polygon_offset_enabled ? 5 : 0); in r300_bind_rs_state()
1313 if (last_sprite_coord_enable != r300->sprite_coord_enable || in r300_bind_rs_state()
1314 last_two_sided_color != r300->two_sided_color) { in r300_bind_rs_state()
1315 r300_mark_atom_dirty(r300, &r300->rs_block_state); in r300_bind_rs_state()
1329 struct r300_context* r300 = r300_context(pipe); in r300_create_sampler_state() local
1331 boolean is_r500 = r300->screen->caps.is_r500; in r300_create_sampler_state()
1385 if (DBG_ON(r300, DBG_ANISOHQ) && is_r500) { in r300_create_sampler_state()
1390 if (r300->screen->caps.is_r500) { in r300_create_sampler_state()
1401 struct r300_context* r300 = r300_context(pipe); in r300_bind_sampler_states() local
1403 (struct r300_textures_state*)r300->textures_state.state; in r300_bind_sampler_states()
1404 unsigned tex_units = r300->screen->caps.num_tex_units; in r300_bind_sampler_states()
1413 r300_mark_atom_dirty(r300, &r300->textures_state); in r300_bind_sampler_states()
1456 struct r300_context* r300 = r300_context(pipe); in r300_set_fragment_sampler_views() local
1458 (struct r300_textures_state*)r300->textures_state.state; in r300_set_fragment_sampler_views()
1461 unsigned tex_units = r300->screen->caps.num_tex_units; in r300_set_fragment_sampler_views()
1490 r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state); in r300_set_fragment_sampler_views()
1508 r300_mark_atom_dirty(r300, &r300->textures_state); in r300_set_fragment_sampler_views()
1511 r300_mark_atom_dirty(r300, &r300->texture_cache_inval); in r300_set_fragment_sampler_views()
1589 struct r300_context* r300 = r300_context(pipe); in r300_set_scissor_state() local
1591 memcpy(r300->scissor_state.state, state, in r300_set_scissor_state()
1594 r300_mark_atom_dirty(r300, &r300->scissor_state); in r300_set_scissor_state()
1600 struct r300_context* r300 = r300_context(pipe); in r300_set_viewport_state() local
1602 (struct r300_viewport_state*)r300->viewport_state.state; in r300_set_viewport_state()
1604 r300->viewport = *state; in r300_set_viewport_state()
1606 if (r300->draw) { in r300_set_viewport_state()
1607 draw_set_viewport_state(r300->draw, state); in r300_set_viewport_state()
1640 r300_mark_atom_dirty(r300, &r300->viewport_state); in r300_set_viewport_state()
1641 if (r300->fs.state && r300_fs(r300)->shader && in r300_set_viewport_state()
1642 r300_fs(r300)->shader->inputs.wpos != ATTR_UNUSED) { in r300_set_viewport_state()
1643 r300_mark_atom_dirty(r300, &r300->fs_rc_constant_state); in r300_set_viewport_state()
1651 struct r300_context* r300 = r300_context(pipe); in r300_set_vertex_buffers_hwtcl() local
1655 buffers = &r300->dummy_vb; in r300_set_vertex_buffers_hwtcl()
1659 util_copy_vertex_buffers(r300->vertex_buffer, in r300_set_vertex_buffers_hwtcl()
1660 &r300->nr_vertex_buffers, in r300_set_vertex_buffers_hwtcl()
1663 r300->vertex_arrays_dirty = TRUE; in r300_set_vertex_buffers_hwtcl()
1670 struct r300_context* r300 = r300_context(pipe); in r300_set_vertex_buffers_swtcl() local
1673 util_copy_vertex_buffers(r300->vertex_buffer, in r300_set_vertex_buffers_swtcl()
1674 &r300->nr_vertex_buffers, in r300_set_vertex_buffers_swtcl()
1676 draw_set_vertex_buffers(r300->draw, count, buffers); in r300_set_vertex_buffers_swtcl()
1680 draw_set_mapped_vertex_buffer(r300->draw, i, in r300_set_vertex_buffers_swtcl()
1683 draw_set_mapped_vertex_buffer(r300->draw, i, in r300_set_vertex_buffers_swtcl()
1692 struct r300_context* r300 = r300_context(pipe); in r300_set_index_buffer_hwtcl() local
1695 pipe_resource_reference(&r300->index_buffer.buffer, ib->buffer); in r300_set_index_buffer_hwtcl()
1696 memcpy(&r300->index_buffer, ib, sizeof(*ib)); in r300_set_index_buffer_hwtcl()
1698 pipe_resource_reference(&r300->index_buffer.buffer, NULL); in r300_set_index_buffer_hwtcl()
1705 struct r300_context* r300 = r300_context(pipe); in r300_set_index_buffer_swtcl() local
1714 draw_set_indexes(r300->draw, in r300_set_index_buffer_swtcl()
1808 struct r300_context *r300 = r300_context(pipe); in r300_bind_vertex_elements_state() local
1815 r300->velems = velems; in r300_bind_vertex_elements_state()
1817 if (r300->draw) { in r300_bind_vertex_elements_state()
1818 draw_set_vertex_elements(r300->draw, velems->count, velems->velem); in r300_bind_vertex_elements_state()
1822 UPDATE_STATE(&velems->vertex_stream, r300->vertex_stream_state); in r300_bind_vertex_elements_state()
1823 r300->vertex_stream_state.size = (1 + velems->vertex_stream.count) * 2; in r300_bind_vertex_elements_state()
1824 r300->vertex_arrays_dirty = TRUE; in r300_bind_vertex_elements_state()
1835 struct r300_context* r300 = r300_context(pipe); in r300_create_vs_state() local
1842 if (r300->screen->caps.has_tcl) { in r300_create_vs_state()
1843 r300_init_vs_outputs(r300, vs); in r300_create_vs_state()
1844 r300_translate_vertex_shader(r300, vs); in r300_create_vs_state()
1846 r300_draw_init_vertex_shader(r300, vs); in r300_create_vs_state()
1854 struct r300_context* r300 = r300_context(pipe); in r300_bind_vs_state() local
1858 r300->vs_state.state = NULL; in r300_bind_vs_state()
1861 if (vs == r300->vs_state.state) { in r300_bind_vs_state()
1864 r300->vs_state.state = vs; in r300_bind_vs_state()
1867 r300_mark_atom_dirty(r300, &r300->rs_block_state); /* Will be updated before the emission. */ in r300_bind_vs_state()
1869 if (r300->screen->caps.has_tcl) { in r300_bind_vs_state()
1870 unsigned fc_op_dwords = r300->screen->caps.is_r500 ? 3 : 2; in r300_bind_vs_state()
1871 r300_mark_atom_dirty(r300, &r300->vs_state); in r300_bind_vs_state()
1872 r300->vs_state.size = vs->code.length + 9 + in r300_bind_vs_state()
1875 r300_mark_atom_dirty(r300, &r300->vs_constants); in r300_bind_vs_state()
1876 r300->vs_constants.size = in r300_bind_vs_state()
1881 ((struct r300_constant_buffer*)r300->vs_constants.state)->remap_table = in r300_bind_vs_state()
1884 r300_mark_atom_dirty(r300, &r300->pvs_flush); in r300_bind_vs_state()
1886 draw_bind_vertex_shader(r300->draw, in r300_bind_vs_state()
1893 struct r300_context* r300 = r300_context(pipe); in r300_delete_vs_state() local
1896 if (r300->screen->caps.has_tcl) { in r300_delete_vs_state()
1901 draw_delete_vertex_shader(r300->draw, in r300_delete_vs_state()
1913 struct r300_context* r300 = r300_context(pipe); in r300_set_constant_buffer() local
1922 cbuf = (struct r300_constant_buffer*)r300->vs_constants.state; in r300_set_constant_buffer()
1925 cbuf = (struct r300_constant_buffer*)r300->fs_constants.state; in r300_set_constant_buffer()
1944 (shader == PIPE_SHADER_VERTEX && r300->screen->caps.has_tcl)) { in r300_set_constant_buffer()
1949 if (r300->screen->caps.has_tcl) { in r300_set_constant_buffer()
1951 (struct r300_vertex_shader*)r300->vs_state.state; in r300_set_constant_buffer()
1958 cbuf->buffer_base = r300->vs_const_base; in r300_set_constant_buffer()
1959 r300->vs_const_base += vs->code.constants.Count; in r300_set_constant_buffer()
1960 if (r300->vs_const_base > R500_MAX_PVS_CONST_VECS) { in r300_set_constant_buffer()
1961 r300->vs_const_base = vs->code.constants.Count; in r300_set_constant_buffer()
1963 r300_mark_atom_dirty(r300, &r300->pvs_flush); in r300_set_constant_buffer()
1965 r300_mark_atom_dirty(r300, &r300->vs_constants); in r300_set_constant_buffer()
1966 } else if (r300->draw) { in r300_set_constant_buffer()
1967 draw_set_mapped_constant_buffer(r300->draw, PIPE_SHADER_VERTEX, in r300_set_constant_buffer()
1971 r300_mark_atom_dirty(r300, &r300->fs_constants); in r300_set_constant_buffer()
1977 struct r300_context *r300 = r300_context(pipe); in r300_texture_barrier() local
1979 r300_mark_atom_dirty(r300, &r300->gpu_flush); in r300_texture_barrier()
1980 r300_mark_atom_dirty(r300, &r300->texture_cache_inval); in r300_texture_barrier()
1983 void r300_init_state_functions(struct r300_context* r300) in r300_init_state_functions() argument
1985 r300->context.create_blend_state = r300_create_blend_state; in r300_init_state_functions()
1986 r300->context.bind_blend_state = r300_bind_blend_state; in r300_init_state_functions()
1987 r300->context.delete_blend_state = r300_delete_blend_state; in r300_init_state_functions()
1989 r300->context.set_blend_color = r300_set_blend_color; in r300_init_state_functions()
1991 r300->context.set_clip_state = r300_set_clip_state; in r300_init_state_functions()
1992 r300->context.set_sample_mask = r300_set_sample_mask; in r300_init_state_functions()
1994 r300->context.set_constant_buffer = r300_set_constant_buffer; in r300_init_state_functions()
1996 r300->context.create_depth_stencil_alpha_state = r300_create_dsa_state; in r300_init_state_functions()
1997 r300->context.bind_depth_stencil_alpha_state = r300_bind_dsa_state; in r300_init_state_functions()
1998 r300->context.delete_depth_stencil_alpha_state = r300_delete_dsa_state; in r300_init_state_functions()
2000 r300->context.set_stencil_ref = r300_set_stencil_ref; in r300_init_state_functions()
2002 r300->context.set_framebuffer_state = r300_set_framebuffer_state; in r300_init_state_functions()
2004 r300->context.create_fs_state = r300_create_fs_state; in r300_init_state_functions()
2005 r300->context.bind_fs_state = r300_bind_fs_state; in r300_init_state_functions()
2006 r300->context.delete_fs_state = r300_delete_fs_state; in r300_init_state_functions()
2008 r300->context.set_polygon_stipple = r300_set_polygon_stipple; in r300_init_state_functions()
2010 r300->context.create_rasterizer_state = r300_create_rs_state; in r300_init_state_functions()
2011 r300->context.bind_rasterizer_state = r300_bind_rs_state; in r300_init_state_functions()
2012 r300->context.delete_rasterizer_state = r300_delete_rs_state; in r300_init_state_functions()
2014 r300->context.create_sampler_state = r300_create_sampler_state; in r300_init_state_functions()
2015 r300->context.bind_fragment_sampler_states = r300_bind_sampler_states; in r300_init_state_functions()
2016 r300->context.bind_vertex_sampler_states = r300_lacks_vertex_textures; in r300_init_state_functions()
2017 r300->context.delete_sampler_state = r300_delete_sampler_state; in r300_init_state_functions()
2019 r300->context.set_fragment_sampler_views = r300_set_fragment_sampler_views; in r300_init_state_functions()
2020 r300->context.create_sampler_view = r300_create_sampler_view; in r300_init_state_functions()
2021 r300->context.sampler_view_destroy = r300_sampler_view_destroy; in r300_init_state_functions()
2023 r300->context.set_scissor_state = r300_set_scissor_state; in r300_init_state_functions()
2025 r300->context.set_viewport_state = r300_set_viewport_state; in r300_init_state_functions()
2027 if (r300->screen->caps.has_tcl) { in r300_init_state_functions()
2028 r300->context.set_vertex_buffers = r300_set_vertex_buffers_hwtcl; in r300_init_state_functions()
2029 r300->context.set_index_buffer = r300_set_index_buffer_hwtcl; in r300_init_state_functions()
2031 r300->context.set_vertex_buffers = r300_set_vertex_buffers_swtcl; in r300_init_state_functions()
2032 r300->context.set_index_buffer = r300_set_index_buffer_swtcl; in r300_init_state_functions()
2035 r300->context.create_vertex_elements_state = r300_create_vertex_elements_state; in r300_init_state_functions()
2036 r300->context.bind_vertex_elements_state = r300_bind_vertex_elements_state; in r300_init_state_functions()
2037 r300->context.delete_vertex_elements_state = r300_delete_vertex_elements_state; in r300_init_state_functions()
2039 r300->context.create_vs_state = r300_create_vs_state; in r300_init_state_functions()
2040 r300->context.bind_vs_state = r300_bind_vs_state; in r300_init_state_functions()
2041 r300->context.delete_vs_state = r300_delete_vs_state; in r300_init_state_functions()
2043 r300->context.texture_barrier = r300_texture_barrier; in r300_init_state_functions()