Lines Matching refs:rctx
686 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_create_blend_state_mode() local
780 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_create_dsa_state() local
837 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_create_rs_state() local
911 if (rctx->chip_class == CAYMAN) { in evergreen_create_rs_state()
1134 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_set_clip_state() local
1141 rctx->clip = *state; in evergreen_set_clip_state()
1158 free(rctx->states[R600_PIPE_STATE_CLIP]); in evergreen_set_clip_state()
1159 rctx->states[R600_PIPE_STATE_CLIP] = rstate; in evergreen_set_clip_state()
1160 r600_context_pipe_state_set(rctx, rstate); in evergreen_set_clip_state()
1175 static void evergreen_get_scissor_rect(struct r600_context *rctx, in evergreen_get_scissor_rect() argument
1186 if (rctx->chip_class == CAYMAN) { in evergreen_get_scissor_rect()
1198 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_set_scissor_state() local
1205 evergreen_get_scissor_rect(rctx, state->minx, state->miny, state->maxx, state->maxy, &tl, &br); in evergreen_set_scissor_state()
1211 free(rctx->states[R600_PIPE_STATE_SCISSOR]); in evergreen_set_scissor_state()
1212 rctx->states[R600_PIPE_STATE_SCISSOR] = rstate; in evergreen_set_scissor_state()
1213 r600_context_pipe_state_set(rctx, rstate); in evergreen_set_scissor_state()
1219 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_set_viewport_state() local
1225 rctx->viewport = *state; in evergreen_set_viewport_state()
1234 free(rctx->states[R600_PIPE_STATE_VIEWPORT]); in evergreen_set_viewport_state()
1235 rctx->states[R600_PIPE_STATE_VIEWPORT] = rstate; in evergreen_set_viewport_state()
1236 r600_context_pipe_state_set(rctx, rstate); in evergreen_set_viewport_state()
1239 void evergreen_init_color_surface(struct r600_context *rctx, in evergreen_init_color_surface() argument
1242 struct r600_screen *rscreen = rctx->screen; in evergreen_init_color_surface()
1256 r600_init_flushed_depth_texture(&rctx->context, pipe_tex, NULL); in evergreen_init_color_surface()
1323 if (rctx->chip_class == CAYMAN && rtex->resource.b.b.nr_samples > 1) { in evergreen_init_color_surface()
1405 base_offset = r600_resource_va(rctx->context.screen, pipe_tex); in evergreen_init_color_surface()
1433 static void evergreen_init_depth_surface(struct r600_context *rctx, in evergreen_init_depth_surface() argument
1436 struct r600_screen *rscreen = rctx->screen; in evergreen_init_depth_surface()
1560 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_set_ms_pos() local
1640 struct r600_context *rctx = (struct r600_context *)ctx; in cayman_set_ms_pos() local
1695 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_set_framebuffer_state() local
1705 r600_flush_framebuffer(rctx, false); in evergreen_set_framebuffer_state()
1710 util_copy_framebuffer_state(&rctx->framebuffer, state); in evergreen_set_framebuffer_state()
1713 rctx->export_16bpc = true; in evergreen_set_framebuffer_state()
1714 rctx->nr_cbufs = state->nr_cbufs; in evergreen_set_framebuffer_state()
1715 rctx->cb0_is_integer = state->nr_cbufs && in evergreen_set_framebuffer_state()
1717 rctx->compressed_cb_mask = 0; in evergreen_set_framebuffer_state()
1727 evergreen_init_color_surface(rctx, surf); in evergreen_set_framebuffer_state()
1731 rctx->export_16bpc = false; in evergreen_set_framebuffer_state()
1759 if (rctx->chip_class != CAYMAN && rtex->fmask_size && rtex->cmask_size) { in evergreen_set_framebuffer_state()
1760 rctx->compressed_cb_mask |= 1 << i; in evergreen_set_framebuffer_state()
1777 if (rctx->alphatest_state.bypass != surf->alphatest_bypass) { in evergreen_set_framebuffer_state()
1778 rctx->alphatest_state.bypass = surf->alphatest_bypass; in evergreen_set_framebuffer_state()
1779 r600_atom_dirty(rctx, &rctx->alphatest_state.atom); in evergreen_set_framebuffer_state()
1781 if (rctx->alphatest_state.cb0_export_16bpc != surf->export_16bpc) { in evergreen_set_framebuffer_state()
1782 rctx->alphatest_state.cb0_export_16bpc = surf->export_16bpc; in evergreen_set_framebuffer_state()
1783 r600_atom_dirty(rctx, &rctx->alphatest_state.atom); in evergreen_set_framebuffer_state()
1795 evergreen_init_depth_surface(rctx, surf); in evergreen_set_framebuffer_state()
1818 evergreen_get_scissor_rect(rctx, 0, 0, state->width, state->height, &tl, &br); in evergreen_set_framebuffer_state()
1838 if (rctx->chip_class == CAYMAN) { in evergreen_set_framebuffer_state()
1864 if (rctx->chip_class == CAYMAN) { in evergreen_set_framebuffer_state()
1877 free(rctx->states[R600_PIPE_STATE_FRAMEBUFFER]); in evergreen_set_framebuffer_state()
1878 rctx->states[R600_PIPE_STATE_FRAMEBUFFER] = rstate; in evergreen_set_framebuffer_state()
1879 r600_context_pipe_state_set(rctx, rstate); in evergreen_set_framebuffer_state()
1882 evergreen_polygon_offset_update(rctx); in evergreen_set_framebuffer_state()
1885 if (rctx->cb_misc_state.nr_cbufs != state->nr_cbufs) { in evergreen_set_framebuffer_state()
1886 rctx->cb_misc_state.nr_cbufs = state->nr_cbufs; in evergreen_set_framebuffer_state()
1887 r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); in evergreen_set_framebuffer_state()
1890 if (state->nr_cbufs == 0 && rctx->alphatest_state.bypass) { in evergreen_set_framebuffer_state()
1891 rctx->alphatest_state.bypass = false; in evergreen_set_framebuffer_state()
1892 r600_atom_dirty(rctx, &rctx->alphatest_state.atom); in evergreen_set_framebuffer_state()
1895 if (rctx->chip_class == CAYMAN && rctx->db_misc_state.log_samples != log_samples) { in evergreen_set_framebuffer_state()
1896 rctx->db_misc_state.log_samples = log_samples; in evergreen_set_framebuffer_state()
1897 r600_atom_dirty(rctx, &rctx->db_misc_state.atom); in evergreen_set_framebuffer_state()
1901 static void evergreen_emit_cb_misc_state(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_cb_misc_state() argument
1903 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_cb_misc_state()
1916 static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_db_misc_state() argument
1918 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_db_misc_state()
1929 if (rctx->chip_class == CAYMAN) { in evergreen_emit_db_misc_state()
1950 static void evergreen_emit_vertex_buffers(struct r600_context *rctx, in evergreen_emit_vertex_buffers() argument
1955 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_vertex_buffers()
1968 va = r600_resource_va(&rctx->screen->screen, &rbuffer->b.b); in evergreen_emit_vertex_buffers()
1991 r600_write_value(cs, r600_context_bo_reloc(rctx, rbuffer, RADEON_USAGE_READ)); in evergreen_emit_vertex_buffers()
1996 static void evergreen_fs_emit_vertex_buffers(struct r600_context *rctx, struct r600_atom * atom) in evergreen_fs_emit_vertex_buffers() argument
1998 evergreen_emit_vertex_buffers(rctx, &rctx->vertex_buffer_state, 992, 0); in evergreen_fs_emit_vertex_buffers()
2001 static void evergreen_cs_emit_vertex_buffers(struct r600_context *rctx, struct r600_atom * atom) in evergreen_cs_emit_vertex_buffers() argument
2003 evergreen_emit_vertex_buffers(rctx, &rctx->cs_vertex_buffer_state, 816, in evergreen_cs_emit_vertex_buffers()
2007 static void evergreen_emit_constant_buffers(struct r600_context *rctx, in evergreen_emit_constant_buffers() argument
2013 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_constant_buffers()
2026 va = r600_resource_va(&rctx->screen->screen, &rbuffer->b.b); in evergreen_emit_constant_buffers()
2034 r600_write_value(cs, r600_context_bo_reloc(rctx, rbuffer, RADEON_USAGE_READ)); in evergreen_emit_constant_buffers()
2055 r600_write_value(cs, r600_context_bo_reloc(rctx, rbuffer, RADEON_USAGE_READ)); in evergreen_emit_constant_buffers()
2062 static void evergreen_emit_vs_constant_buffers(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_vs_constant_buffers() argument
2064 evergreen_emit_constant_buffers(rctx, &rctx->vs_constbuf_state, 176, in evergreen_emit_vs_constant_buffers()
2069 static void evergreen_emit_ps_constant_buffers(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_ps_constant_buffers() argument
2071 evergreen_emit_constant_buffers(rctx, &rctx->ps_constbuf_state, 0, in evergreen_emit_ps_constant_buffers()
2076 static void evergreen_emit_sampler_views(struct r600_context *rctx, in evergreen_emit_sampler_views() argument
2080 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_sampler_views()
2096 reloc = r600_context_bo_reloc(rctx, rview->tex_resource, in evergreen_emit_sampler_views()
2106 static void evergreen_emit_vs_sampler_views(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_vs_sampler_views() argument
2108 evergreen_emit_sampler_views(rctx, &rctx->vs_samplers.views, 176 + R600_MAX_CONST_BUFFERS); in evergreen_emit_vs_sampler_views()
2111 static void evergreen_emit_ps_sampler_views(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_ps_sampler_views() argument
2113 evergreen_emit_sampler_views(rctx, &rctx->ps_samplers.views, R600_MAX_CONST_BUFFERS); in evergreen_emit_ps_sampler_views()
2116 static void evergreen_emit_sampler(struct r600_context *rctx, in evergreen_emit_sampler() argument
2121 struct radeon_winsys_cs *cs = rctx->cs; in evergreen_emit_sampler()
2141 static void evergreen_emit_vs_sampler(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_vs_sampler() argument
2143 evergreen_emit_sampler(rctx, &rctx->vs_samplers, 18, R_00A414_TD_VS_SAMPLER0_BORDER_INDEX); in evergreen_emit_vs_sampler()
2146 static void evergreen_emit_ps_sampler(struct r600_context *rctx, struct r600_atom *atom) in evergreen_emit_ps_sampler() argument
2148 evergreen_emit_sampler(rctx, &rctx->ps_samplers, 0, R_00A400_TD_PS_SAMPLER0_BORDER_INDEX); in evergreen_emit_ps_sampler()
2151 static void evergreen_emit_sample_mask(struct r600_context *rctx, struct r600_atom *a) in evergreen_emit_sample_mask() argument
2156 r600_write_context_reg(rctx->cs, R_028C3C_PA_SC_AA_MASK, in evergreen_emit_sample_mask()
2160 static void cayman_emit_sample_mask(struct r600_context *rctx, struct r600_atom *a) in cayman_emit_sample_mask() argument
2163 struct radeon_winsys_cs *cs = rctx->cs; in cayman_emit_sample_mask()
2171 void evergreen_init_state_functions(struct r600_context *rctx) in evergreen_init_state_functions() argument
2173 r600_init_atom(&rctx->cb_misc_state.atom, evergreen_emit_cb_misc_state, 0, 0); in evergreen_init_state_functions()
2174 r600_atom_dirty(rctx, &rctx->cb_misc_state.atom); in evergreen_init_state_functions()
2175 r600_init_atom(&rctx->db_misc_state.atom, evergreen_emit_db_misc_state, 7, 0); in evergreen_init_state_functions()
2176 r600_atom_dirty(rctx, &rctx->db_misc_state.atom); in evergreen_init_state_functions()
2177 r600_init_atom(&rctx->vertex_buffer_state.atom, evergreen_fs_emit_vertex_buffers, 0, 0); in evergreen_init_state_functions()
2178 r600_init_atom(&rctx->cs_vertex_buffer_state.atom, evergreen_cs_emit_vertex_buffers, 0, 0); in evergreen_init_state_functions()
2179 r600_init_atom(&rctx->vs_constbuf_state.atom, evergreen_emit_vs_constant_buffers, 0, 0); in evergreen_init_state_functions()
2180 r600_init_atom(&rctx->ps_constbuf_state.atom, evergreen_emit_ps_constant_buffers, 0, 0); in evergreen_init_state_functions()
2181 r600_init_atom(&rctx->vs_samplers.views.atom, evergreen_emit_vs_sampler_views, 0, 0); in evergreen_init_state_functions()
2182 r600_init_atom(&rctx->ps_samplers.views.atom, evergreen_emit_ps_sampler_views, 0, 0); in evergreen_init_state_functions()
2183 r600_init_atom(&rctx->cs_shader_state.atom, evergreen_emit_cs_shader, 0, 0); in evergreen_init_state_functions()
2184 r600_init_atom(&rctx->vs_samplers.atom_sampler, evergreen_emit_vs_sampler, 0, 0); in evergreen_init_state_functions()
2185 r600_init_atom(&rctx->ps_samplers.atom_sampler, evergreen_emit_ps_sampler, 0, 0); in evergreen_init_state_functions()
2187 if (rctx->chip_class == EVERGREEN) in evergreen_init_state_functions()
2188 r600_init_atom(&rctx->sample_mask.atom, evergreen_emit_sample_mask, 3, 0); in evergreen_init_state_functions()
2190 r600_init_atom(&rctx->sample_mask.atom, cayman_emit_sample_mask, 4, 0); in evergreen_init_state_functions()
2191 rctx->sample_mask.sample_mask = ~0; in evergreen_init_state_functions()
2192 r600_atom_dirty(rctx, &rctx->sample_mask.atom); in evergreen_init_state_functions()
2194 rctx->context.create_blend_state = evergreen_create_blend_state; in evergreen_init_state_functions()
2195 rctx->context.create_depth_stencil_alpha_state = evergreen_create_dsa_state; in evergreen_init_state_functions()
2196 rctx->context.create_fs_state = r600_create_shader_state_ps; in evergreen_init_state_functions()
2197 rctx->context.create_rasterizer_state = evergreen_create_rs_state; in evergreen_init_state_functions()
2198 rctx->context.create_sampler_state = evergreen_create_sampler_state; in evergreen_init_state_functions()
2199 rctx->context.create_sampler_view = evergreen_create_sampler_view; in evergreen_init_state_functions()
2200 rctx->context.create_vertex_elements_state = r600_create_vertex_elements; in evergreen_init_state_functions()
2201 rctx->context.create_vs_state = r600_create_shader_state_vs; in evergreen_init_state_functions()
2202 rctx->context.bind_blend_state = r600_bind_blend_state; in evergreen_init_state_functions()
2203 rctx->context.bind_depth_stencil_alpha_state = r600_bind_dsa_state; in evergreen_init_state_functions()
2204 rctx->context.bind_fragment_sampler_states = r600_bind_ps_samplers; in evergreen_init_state_functions()
2205 rctx->context.bind_fs_state = r600_bind_ps_shader; in evergreen_init_state_functions()
2206 rctx->context.bind_rasterizer_state = r600_bind_rs_state; in evergreen_init_state_functions()
2207 rctx->context.bind_vertex_elements_state = r600_bind_vertex_elements; in evergreen_init_state_functions()
2208 rctx->context.bind_vertex_sampler_states = r600_bind_vs_samplers; in evergreen_init_state_functions()
2209 rctx->context.bind_vs_state = r600_bind_vs_shader; in evergreen_init_state_functions()
2210 rctx->context.delete_blend_state = r600_delete_state; in evergreen_init_state_functions()
2211 rctx->context.delete_depth_stencil_alpha_state = r600_delete_state; in evergreen_init_state_functions()
2212 rctx->context.delete_fs_state = r600_delete_ps_shader; in evergreen_init_state_functions()
2213 rctx->context.delete_rasterizer_state = r600_delete_rs_state; in evergreen_init_state_functions()
2214 rctx->context.delete_sampler_state = r600_delete_sampler; in evergreen_init_state_functions()
2215 rctx->context.delete_vertex_elements_state = r600_delete_vertex_element; in evergreen_init_state_functions()
2216 rctx->context.delete_vs_state = r600_delete_vs_shader; in evergreen_init_state_functions()
2217 rctx->context.set_blend_color = r600_set_blend_color; in evergreen_init_state_functions()
2218 rctx->context.set_clip_state = evergreen_set_clip_state; in evergreen_init_state_functions()
2219 rctx->context.set_constant_buffer = r600_set_constant_buffer; in evergreen_init_state_functions()
2220 rctx->context.set_fragment_sampler_views = evergreen_set_ps_sampler_views; in evergreen_init_state_functions()
2221 rctx->context.set_framebuffer_state = evergreen_set_framebuffer_state; in evergreen_init_state_functions()
2222 rctx->context.set_polygon_stipple = evergreen_set_polygon_stipple; in evergreen_init_state_functions()
2223 rctx->context.set_sample_mask = r600_set_sample_mask; in evergreen_init_state_functions()
2224 rctx->context.set_scissor_state = evergreen_set_scissor_state; in evergreen_init_state_functions()
2225 rctx->context.set_stencil_ref = r600_set_pipe_stencil_ref; in evergreen_init_state_functions()
2226 rctx->context.set_vertex_buffers = r600_set_vertex_buffers; in evergreen_init_state_functions()
2227 rctx->context.set_index_buffer = r600_set_index_buffer; in evergreen_init_state_functions()
2228 rctx->context.set_vertex_sampler_views = evergreen_set_vs_sampler_views; in evergreen_init_state_functions()
2229 rctx->context.set_viewport_state = evergreen_set_viewport_state; in evergreen_init_state_functions()
2230 rctx->context.sampler_view_destroy = r600_sampler_view_destroy; in evergreen_init_state_functions()
2231 rctx->context.texture_barrier = r600_texture_barrier; in evergreen_init_state_functions()
2232 rctx->context.create_stream_output_target = r600_create_so_target; in evergreen_init_state_functions()
2233 rctx->context.stream_output_target_destroy = r600_so_target_destroy; in evergreen_init_state_functions()
2234 rctx->context.set_stream_output_targets = r600_set_so_targets; in evergreen_init_state_functions()
2235 evergreen_init_compute_state_functions(rctx); in evergreen_init_state_functions()
2238 static void cayman_init_atom_start_cs(struct r600_context *rctx) in cayman_init_atom_start_cs() argument
2240 struct r600_command_buffer *cb = &rctx->start_cs_cmd; in cayman_init_atom_start_cs()
2377 if (rctx->screen->has_streamout) { in cayman_init_atom_start_cs()
2596 void evergreen_init_atom_start_cs(struct r600_context *rctx) in evergreen_init_atom_start_cs() argument
2598 struct r600_command_buffer *cb = &rctx->start_cs_cmd; in evergreen_init_atom_start_cs()
2615 if (rctx->chip_class == CAYMAN) { in evergreen_init_atom_start_cs()
2616 cayman_init_atom_start_cs(rctx); in evergreen_init_atom_start_cs()
2627 evergreen_init_common_regs(cb, rctx->chip_class in evergreen_init_atom_start_cs()
2628 , rctx->family, rctx->screen->info.drm_minor); in evergreen_init_atom_start_cs()
2630 family = rctx->family; in evergreen_init_atom_start_cs()
2909 if (rctx->screen->has_streamout) { in evergreen_init_atom_start_cs()
2917 void evergreen_polygon_offset_update(struct r600_context *rctx) in evergreen_polygon_offset_update() argument
2923 if (rctx->rasterizer && rctx->framebuffer.zsbuf) { in evergreen_polygon_offset_update()
2924 float offset_units = rctx->rasterizer->offset_units; in evergreen_polygon_offset_update()
2927 switch (rctx->framebuffer.zsbuf->format) { in evergreen_polygon_offset_update()
2950 fui(rctx->rasterizer->offset_scale)); in evergreen_polygon_offset_update()
2956 fui(rctx->rasterizer->offset_scale)); in evergreen_polygon_offset_update()
2963 r600_context_pipe_state_set(rctx, &state); in evergreen_polygon_offset_update()
2969 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_pipe_shader_ps() local
3008 rctx->rasterizer && rctx->rasterizer->flatshade)) { in evergreen_pipe_shader_ps()
3013 (rctx->sprite_coord_enable & (1 << rshader->input[i].sid))) { in evergreen_pipe_shader_ps()
3111 shader->sprite_coord_enable = rctx->sprite_coord_enable; in evergreen_pipe_shader_ps()
3112 if (rctx->rasterizer) in evergreen_pipe_shader_ps()
3113 shader->flatshade = rctx->rasterizer->flatshade; in evergreen_pipe_shader_ps()
3118 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_pipe_shader_vs() local
3170 struct r600_context *rctx = (struct r600_context *)ctx; in evergreen_fetch_shader() local
3179 void *evergreen_create_resolve_blend(struct r600_context *rctx) in evergreen_create_resolve_blend() argument
3187 rstate = evergreen_create_blend_state_mode(&rctx->context, &blend, V_028808_CB_RESOLVE); in evergreen_create_resolve_blend()
3191 void *evergreen_create_decompress_blend(struct r600_context *rctx) in evergreen_create_decompress_blend() argument
3199 rstate = evergreen_create_blend_state_mode(&rctx->context, &blend, V_028808_CB_DECOMPRESS); in evergreen_create_decompress_blend()
3203 void *evergreen_create_db_flush_dsa(struct r600_context *rctx) in evergreen_create_db_flush_dsa() argument
3207 return rctx->context.create_depth_stencil_alpha_state(&rctx->context, &dsa); in evergreen_create_db_flush_dsa()
3210 void evergreen_update_dual_export_state(struct r600_context * rctx) in evergreen_update_dual_export_state() argument
3212 unsigned dual_export = rctx->export_16bpc && rctx->nr_cbufs && in evergreen_update_dual_export_state()
3213 !rctx->ps_shader->current->ps_depth_export; in evergreen_update_dual_export_state()
3218 unsigned db_shader_control = rctx->ps_shader->current->db_shader_control | in evergreen_update_dual_export_state()
3221 S_02880C_ALPHA_TO_MASK_DISABLE(rctx->cb0_is_integer); in evergreen_update_dual_export_state()
3223 if (db_shader_control != rctx->db_shader_control) { in evergreen_update_dual_export_state()
3226 rctx->db_shader_control = db_shader_control; in evergreen_update_dual_export_state()
3230 r600_context_pipe_state_set(rctx, &rstate); in evergreen_update_dual_export_state()