Home | History | Annotate | Download | only in radeonsi

Lines Matching defs:rctx

40 static void si_update_fb_blend_state(struct r600_context *rctx)
43 struct si_state_blend *blend = rctx->queued.named.blend;
53 mask = (1ULL << ((unsigned)rctx->framebuffer.nr_cbufs * 4)) - 1;
57 si_pm4_set_state(rctx, fb_blend, pm4);
197 struct r600_context *rctx = (struct r600_context *)ctx;
198 si_pm4_bind_state(rctx, blend, (struct si_state_blend *)state);
199 si_update_fb_blend_state(rctx);
204 struct r600_context *rctx = (struct r600_context *)ctx;
205 si_pm4_delete_state(rctx, blend, (struct si_state_blend *)state);
211 struct r600_context *rctx = (struct r600_context *)ctx;
222 si_pm4_set_state(rctx, blend_color, pm4);
232 struct r600_context *rctx = (struct r600_context *)ctx;
249 si_pm4_set_state(rctx, clip, pm4);
255 struct r600_context *rctx = (struct r600_context *)ctx;
273 si_pm4_set_state(rctx, scissor, pm4);
279 struct r600_context *rctx = (struct r600_context *)ctx;
297 si_pm4_set_state(rctx, viewport, viewport);
303 static void si_update_fb_rs_state(struct r600_context *rctx)
305 struct si_state_rasterizer *rs = rctx->queued.named.rasterizer;
310 if (!rs || !rctx->framebuffer.zsbuf)
313 offset_units = rctx->queued.named.rasterizer->offset_units;
314 switch (rctx->framebuffer.zsbuf->texture->format) {
338 fui(rctx->queued.named.rasterizer->offset_scale));
341 fui(rctx->queued.named.rasterizer->offset_scale));
345 si_pm4_set_state(rctx, fb_rs, pm4);
471 struct r600_context *rctx = (struct r600_context *)ctx;
478 rctx->sprite_coord_enable = rs->sprite_coord_enable;
479 rctx->pa_sc_line_stipple = rs->pa_sc_line_stipple;
480 rctx->pa_su_sc_mode_cntl = rs->pa_su_sc_mode_cntl;
481 rctx->pa_cl_clip_cntl = rs->pa_cl_clip_cntl;
482 rctx->pa_cl_vs_out_cntl = rs->pa_cl_vs_out_cntl;
484 rctx, rasterizer, rs);
485 si_update_fb_rs_state(rctx);
490 struct r600_context *rctx = (struct r600_context *)ctx;
491 si_pm4_delete_state(rctx, rasterizer, (struct si_state_rasterizer *)state);
497 static void si_update_dsa_stencil_ref(struct r600_context *rctx)
500 struct pipe_stencil_ref *ref = &rctx->stencil_ref;
501 struct si_state_dsa *dsa = rctx->queued.named.dsa;
515 si_pm4_set_state(rctx, dsa_stencil_ref, pm4);
521 struct r600_context *rctx = (struct r600_context *)ctx;
522 rctx->stencil_ref = *state;
523 si_update_dsa_stencil_ref(rctx);
633 struct r600_context *rctx = (struct r600_context *)ctx;
639 si_pm4_bind_state(rctx, dsa, dsa);
640 si_update_dsa_stencil_ref(rctx);
643 rctx->alpha_ref = dsa->alpha_ref;
644 rctx->alpha_ref_dirty = true;
649 struct r600_context *rctx = (struct r600_context *)ctx;
650 si_pm4_delete_state(rctx, dsa, (struct si_state_dsa *)state);
653 static void *si_create_db_flush_dsa(struct r600_context *rctx)
660 state = rctx->context.create_depth_stencil_alpha_state(&rctx->context, &dsa);
1444 static void si_cb(struct r600_context *rctx, struct si_pm4_state *pm4,
1465 rctx->have_depth_fb = TRUE;
1468 r600_texture_depth_flush(&rctx->context, state->cbufs[cb]->texture, TRUE);
1579 rctx->alpha_ref_dirty = true;
1581 offset += r600_resource_va(rctx->context.screen, state->cbufs[cb]->texture);
1606 rctx->export_16bpc |= 1 << cb;
1607 rctx->spi_shader_col_format |= V_028714_SPI_SHADER_FP16_ABGR << (4 * cb);
1609 rctx->spi_shader_col_format |= V_028714_SPI_SHADER_32_ABGR << (4 * cb);
1612 static void si_db(struct r600_context *rctx, struct si_pm4_state *pm4,
1633 z_offs = r600_resource_va(rctx->context.screen, surf->base.texture);
1636 s_offs = r600_resource_va(rctx->context.screen, surf->base.texture);
1711 struct r600_context *rctx = (struct r600_context *)ctx;
1724 util_copy_framebuffer_state(&rctx->framebuffer, state);
1727 rctx->have_depth_fb = 0;
1728 rctx->export_16bpc = 0;
1729 rctx->spi_shader_col_format = 0;
1731 si_cb(rctx, pm4, state, i);
1733 assert(!(rctx->export_16bpc & ~0xff));
1734 si_db(rctx, pm4, state);
1751 if (rctx->chip_class == CAYMAN) {
1771 rctx->spi_shader_col_format);
1774 si_pm4_set_state(rctx, framebuffer, pm4);
1775 si_update_fb_rs_state(rctx);
1776 si_update_fb_blend_state(rctx);
1787 struct r600_context *rctx = (struct r600_context *)ctx;
1792 key |= rctx->framebuffer.nr_cbufs;
1793 key |= rctx->export_16bpc << 4;
1794 /*if (rctx->queued.named.rasterizer)
1795 key |= rctx->queued.named.rasterizer->flatshade << 12;*/
1796 /*key |== rctx->two_side << 13;*/
1851 * rctx->framebuffer.nr_cbufs) after building first variant. */
1906 struct r600_context *rctx = (struct r600_context *)ctx;
1909 if (rctx->vs_shader == sel)
1912 rctx->shader_dirty = true;
1913 rctx->vs_shader = sel;
1916 si_pm4_bind_state(rctx, vs, sel->current->pm4);
1918 si_pm4_bind_state(rctx, vs, rctx->dummy_pixel_shader->pm4);
1923 struct r600_context *rctx = (struct r600_context *)ctx;
1926 if (rctx->ps_shader == sel)
1929 rctx->shader_dirty = true;
1930 rctx->ps_shader = sel;
1933 si_pm4_bind_state(rctx, ps, sel->current->pm4);
1935 si_pm4_bind_state(rctx, ps, rctx->dummy_pixel_shader->pm4);
1941 struct r600_context *rctx = (struct r600_context *)ctx;
1946 si_pm4_delete_state(rctx, vs, p->pm4);
1958 struct r600_context *rctx = (struct r600_context *)ctx;
1961 if (rctx->vs_shader == sel) {
1962 rctx->vs_shader = NULL;
1970 struct r600_context *rctx = (struct r600_context *)ctx;
1973 if (rctx->ps_shader == sel) {
1974 rctx->ps_shader = NULL;
2194 struct r600_context *rctx = (struct r600_context *)ctx;
2208 (struct pipe_sampler_view **)&rctx->ps_samplers.views[i],
2223 if (rctx->ps_samplers.views[i])
2224 pipe_sampler_view_reference((struct pipe_sampler_view **)&rctx->ps_samplers.views[i], NULL);
2230 si_pm4_set_state(rctx, ps_sampler_views, pm4);
2231 rctx->have_depth_texture = has_depth;
2232 rctx->ps_samplers.n_views = count;
2242 struct r600_context *rctx = (struct r600_context *)ctx;
2260 memcpy(rctx->ps_samplers.samplers, states, sizeof(void*) * count);
2263 si_pm4_set_state(rctx, ps_sampler, pm4);
2264 rctx->ps_samplers.n_samplers = count;
2282 struct r600_context *rctx = (struct r600_context *)ctx;
2298 r600_upload_const_buffer(rctx, &rbuffer, cb->user_buffer, cb->buffer_size, &offset);
2310 si_pm4_set_state(rctx, vs_const, pm4);
2316 si_pm4_set_state(rctx, ps_const, pm4);
2382 struct r600_context *rctx = (struct r600_context *)ctx;
2385 rctx->vertex_elements = v;
2390 struct r600_context *rctx = (struct r600_context *)ctx;
2392 if (rctx->vertex_elements == state)
2393 rctx->vertex_elements = NULL;
2400 struct r600_context *rctx = (struct r600_context *)ctx;
2402 util_copy_vertex_buffers(rctx->vertex_buffer, &rctx->nr_vertex_buffers, buffers, count);
2408 struct r600_context *rctx = (struct r600_context *)ctx;
2411 pipe_resource_reference(&rctx->index_buffer.buffer, ib->buffer);
2412 memcpy(&rctx->index_buffer, ib, sizeof(*ib));
2414 pipe_resource_reference(&rctx->index_buffer.buffer, NULL);
2428 struct r600_context *rctx = (struct r600_context *)ctx;
2432 si_pm4_inval_fb_cache(pm4, rctx->framebuffer.nr_cbufs);
2433 si_pm4_set_state(rctx, texture_barrier, pm4);
2436 void si_init_state_functions(struct r600_context *rctx)
2438 rctx->context.create_blend_state = si_create_blend_state;
2439 rctx->context.bind_blend_state = si_bind_blend_state;
2440 rctx->context.delete_blend_state = si_delete_blend_state;
2441 rctx->context.set_blend_color = si_set_blend_color;
2443 rctx->context.create_rasterizer_state = si_create_rs_state;
2444 rctx->context.bind_rasterizer_state = si_bind_rs_state;
2445 rctx->context.delete_rasterizer_state = si_delete_rs_state;
2447 rctx->context.create_depth_stencil_alpha_state = si_create_dsa_state;
2448 rctx->context.bind_depth_stencil_alpha_state = si_bind_dsa_state;
2449 rctx->context.delete_depth_stencil_alpha_state = si_delete_dsa_state;
2450 rctx->custom_dsa_flush = si_create_db_flush_dsa(rctx);
2452 rctx->context.set_clip_state = si_set_clip_state;
2453 rctx->context.set_scissor_state = si_set_scissor_state;
2454 rctx->context.set_viewport_state = si_set_viewport_state;
2455 rctx->context.set_stencil_ref = si_set_pipe_stencil_ref;
2457 rctx->context.set_framebuffer_state = si_set_framebuffer_state;
2459 rctx->context.create_vs_state = si_create_vs_state;
2460 rctx->context.create_fs_state = si_create_fs_state;
2461 rctx->context.bind_vs_state = si_bind_vs_shader;
2462 rctx->context.bind_fs_state = si_bind_ps_shader;
2463 rctx->context.delete_vs_state = si_delete_vs_shader;
2464 rctx->context.delete_fs_state = si_delete_ps_shader;
2466 rctx->context.create_sampler_state = si_create_sampler_state;
2467 rctx->context.bind_vertex_sampler_states = si_bind_vs_sampler;
2468 rctx->context.bind_fragment_sampler_states = si_bind_ps_sampler;
2469 rctx->context.delete_sampler_state = si_delete_sampler_state;
2471 rctx->context.create_sampler_view = si_create_sampler_view;
2472 rctx->context.set_vertex_sampler_views = si_set_vs_sampler_view;
2473 rctx->context.set_fragment_sampler_views = si_set_ps_sampler_view;
2474 rctx->context.sampler_view_destroy = si_sampler_view_destroy;
2476 rctx->context.set_sample_mask = si_set_sample_mask;
2478 rctx->context.set_constant_buffer = si_set_constant_buffer;
2480 rctx->context.create_vertex_elements_state = si_create_vertex_elements;
2481 rctx->context.bind_vertex_elements_state = si_bind_vertex_elements;
2482 rctx->context.delete_vertex_elements_state = si_delete_vertex_element;
2483 rctx->context.set_vertex_buffers = si_set_vertex_buffers;
2484 rctx->context.set_index_buffer = si_set_index_buffer;
2486 rctx->context.create_stream_output_target = si_create_so_target;
2487 rctx->context.stream_output_target_destroy = si_so_target_destroy;
2488 rctx->context.set_stream_output_targets = si_set_so_targets;
2490 rctx->context.texture_barrier = si_texture_barrier;
2491 rctx->context.set_polygon_stipple = si_set_polygon_stipple;
2493 rctx->context.draw_vbo = si_draw_vbo;
2496 void si_init_config(struct r600_context *rctx)
2538 si_pm4_set_state(rctx, init, pm4);