The split made no sense.
{
int r;
- memset(ctx, 0, sizeof(struct r600_context));
ctx->screen = screen;
ctx->ws = screen->ws;
static void evergreen_set_blend_color(struct pipe_context *ctx,
const struct pipe_blend_color *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
free(rctx->states[R600_PIPE_STATE_BLEND_COLOR]);
rctx->states[R600_PIPE_STATE_BLEND_COLOR] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
static void *evergreen_create_blend_state(struct pipe_context *ctx,
const struct pipe_blend_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_blend *blend = CALLOC_STRUCT(r600_pipe_blend);
struct r600_pipe_state *rstate;
uint32_t color_control, target_mask;
static void *evergreen_create_dsa_state(struct pipe_context *ctx,
const struct pipe_depth_stencil_alpha_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_dsa *dsa = CALLOC_STRUCT(r600_pipe_dsa);
unsigned db_depth_control, alpha_test_control, alpha_ref;
unsigned db_render_override, db_render_control;
static void *evergreen_create_rs_state(struct pipe_context *ctx,
const struct pipe_rasterizer_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_rasterizer *rs = CALLOC_STRUCT(r600_pipe_rasterizer);
struct r600_pipe_state *rstate;
unsigned tmp;
static void evergreen_set_vs_sampler_view(struct pipe_context *ctx, unsigned count,
struct pipe_sampler_view **views)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_sampler_view **resource = (struct r600_pipe_sampler_view **)views;
for (int i = 0; i < count; i++) {
if (resource[i]) {
- evergreen_context_pipe_state_set_vs_resource(&rctx->ctx, &resource[i]->state,
+ evergreen_context_pipe_state_set_vs_resource(rctx, &resource[i]->state,
i + R600_MAX_CONST_BUFFERS);
}
}
static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned count,
struct pipe_sampler_view **views)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_sampler_view **resource = (struct r600_pipe_sampler_view **)views;
int i;
int has_depth = 0;
if (resource[i]) {
if (((struct r600_resource_texture *)resource[i]->base.texture)->depth)
has_depth = 1;
- evergreen_context_pipe_state_set_ps_resource(&rctx->ctx, &resource[i]->state,
+ evergreen_context_pipe_state_set_ps_resource(rctx, &resource[i]->state,
i + R600_MAX_CONST_BUFFERS);
} else
- evergreen_context_pipe_state_set_ps_resource(&rctx->ctx, NULL,
+ evergreen_context_pipe_state_set_ps_resource(rctx, NULL,
i + R600_MAX_CONST_BUFFERS);
pipe_sampler_view_reference(
}
for (i = count; i < NUM_TEX_UNITS; i++) {
if (rctx->ps_samplers.views[i]) {
- evergreen_context_pipe_state_set_ps_resource(&rctx->ctx, NULL,
+ evergreen_context_pipe_state_set_ps_resource(rctx, NULL,
i + R600_MAX_CONST_BUFFERS);
pipe_sampler_view_reference((struct pipe_sampler_view **)&rctx->ps_samplers.views[i], NULL);
}
static void evergreen_bind_ps_sampler(struct pipe_context *ctx, unsigned count, void **states)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state **rstates = (struct r600_pipe_state **)states;
rctx->ps_samplers.n_samplers = count;
for (int i = 0; i < count; i++) {
- evergreen_context_pipe_state_set_ps_sampler(&rctx->ctx, rstates[i], i);
+ evergreen_context_pipe_state_set_ps_sampler(rctx, rstates[i], i);
}
}
static void evergreen_bind_vs_sampler(struct pipe_context *ctx, unsigned count, void **states)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state **rstates = (struct r600_pipe_state **)states;
for (int i = 0; i < count; i++) {
- evergreen_context_pipe_state_set_vs_sampler(&rctx->ctx, rstates[i], i);
+ evergreen_context_pipe_state_set_vs_sampler(rctx, rstates[i], i);
}
}
static void evergreen_set_clip_state(struct pipe_context *ctx,
const struct pipe_clip_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
struct pipe_resource *cbuf;
free(rctx->states[R600_PIPE_STATE_CLIP]);
rctx->states[R600_PIPE_STATE_CLIP] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
cbuf = pipe_user_buffer_create(ctx->screen,
state->ucp,
static void evergreen_set_scissor_state(struct pipe_context *ctx,
const struct pipe_scissor_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
uint32_t tl, br;
free(rctx->states[R600_PIPE_STATE_SCISSOR]);
rctx->states[R600_PIPE_STATE_SCISSOR] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
static void evergreen_set_viewport_state(struct pipe_context *ctx,
const struct pipe_viewport_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
free(rctx->states[R600_PIPE_STATE_VIEWPORT]);
rctx->states[R600_PIPE_STATE_VIEWPORT] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
-static void evergreen_cb(struct r600_pipe_context *rctx, struct r600_pipe_state *rstate,
+static void evergreen_cb(struct r600_context *rctx, struct r600_pipe_state *rstate,
const struct pipe_framebuffer_state *state, int cb)
{
struct r600_resource_texture *rtex;
&rtex->resource, RADEON_USAGE_READWRITE);
}
-static void evergreen_db(struct r600_pipe_context *rctx, struct r600_pipe_state *rstate,
+static void evergreen_db(struct r600_context *rctx, struct r600_pipe_state *rstate,
const struct pipe_framebuffer_state *state)
{
struct r600_resource_texture *rtex;
static void evergreen_set_framebuffer_state(struct pipe_context *ctx,
const struct pipe_framebuffer_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
uint32_t shader_mask, tl, br;
int tl_x, tl_y, br_x, br_y;
if (rstate == NULL)
return;
- evergreen_context_flush_dest_caches(&rctx->ctx);
- rctx->ctx.num_dest_buffers = state->nr_cbufs;
+ evergreen_context_flush_dest_caches(rctx);
+ rctx->num_dest_buffers = state->nr_cbufs;
/* unreference old buffer and reference new one */
rstate->id = R600_PIPE_STATE_FRAMEBUFFER;
}
if (state->zsbuf) {
evergreen_db(rctx, rstate, state);
- rctx->ctx.num_dest_buffers++;
+ rctx->num_dest_buffers++;
}
shader_mask = 0;
free(rctx->states[R600_PIPE_STATE_FRAMEBUFFER]);
rctx->states[R600_PIPE_STATE_FRAMEBUFFER] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
if (state->zsbuf) {
evergreen_polygon_offset_update(rctx);
static void evergreen_texture_barrier(struct pipe_context *ctx)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
- r600_context_flush_all(&rctx->ctx, S_0085F0_TC_ACTION_ENA(1) | S_0085F0_CB_ACTION_ENA(1) |
+ r600_context_flush_all(rctx, S_0085F0_TC_ACTION_ENA(1) | S_0085F0_CB_ACTION_ENA(1) |
S_0085F0_CB0_DEST_BASE_ENA(1) | S_0085F0_CB1_DEST_BASE_ENA(1) |
S_0085F0_CB2_DEST_BASE_ENA(1) | S_0085F0_CB3_DEST_BASE_ENA(1) |
S_0085F0_CB4_DEST_BASE_ENA(1) | S_0085F0_CB5_DEST_BASE_ENA(1) |
S_0085F0_CB10_DEST_BASE_ENA(1) | S_0085F0_CB11_DEST_BASE_ENA(1));
}
-void evergreen_init_state_functions(struct r600_pipe_context *rctx)
+void evergreen_init_state_functions(struct r600_context *rctx)
{
rctx->context.create_blend_state = evergreen_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = evergreen_create_dsa_state;
rctx->context.set_stream_output_targets = r600_set_so_targets;
}
-static void cayman_init_config(struct r600_pipe_context *rctx)
+static void cayman_init_config(struct r600_context *rctx)
{
struct r600_pipe_state *rstate = &rctx->config;
unsigned tmp;
r600_pipe_state_add_reg(rstate, R_0288EC_SQ_LDS_ALLOC_PS, 0, NULL, 0);
r600_pipe_state_add_reg(rstate, CM_R_028804_DB_EQAA, 0x110000, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
-void evergreen_init_config(struct r600_pipe_context *rctx)
+void evergreen_init_config(struct r600_context *rctx)
{
struct r600_pipe_state *rstate = &rctx->config;
int ps_prio;
r600_pipe_state_add_reg(rstate, R_028810_PA_CL_CLIP_CNTL, 0x0, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
-void evergreen_polygon_offset_update(struct r600_pipe_context *rctx)
+void evergreen_polygon_offset_update(struct r600_context *rctx)
{
struct r600_pipe_state state;
r600_pipe_state_add_reg(&state,
R_028B78_PA_SU_POLY_OFFSET_DB_FMT_CNTL,
offset_db_fmt_cntl, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, &state);
+ r600_context_pipe_state_set(rctx, &state);
}
}
void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &shader->rstate;
struct r600_shader *rshader = &shader->shader;
unsigned i, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z, spi_ps_in_control_1, db_shader_control;
void evergreen_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &shader->rstate;
struct r600_shader *rshader = &shader->shader;
unsigned spi_vs_out_id[10] = {};
void evergreen_fetch_shader(struct pipe_context *ctx,
struct r600_vertex_element *ve)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &ve->rstate;
rstate->id = R600_PIPE_STATE_FETCH_SHADER;
rstate->nregs = 0;
ve->fetch_shader, RADEON_USAGE_READ);
}
-void *evergreen_create_db_flush_dsa(struct r600_pipe_context *rctx)
+void *evergreen_create_db_flush_dsa(struct r600_context *rctx)
{
struct pipe_depth_stencil_alpha_state dsa;
struct r600_pipe_state *rstate;
return rstate;
}
-void evergreen_pipe_init_buffer_resource(struct r600_pipe_context *rctx,
+void evergreen_pipe_init_buffer_resource(struct r600_context *rctx,
struct r600_pipe_resource_state *rstate)
{
rstate->id = R600_PIPE_STATE_RESOURCE;
#define R600_CONTEXT_DST_CACHES_DIRTY (1 << 1)
#define R600_CONTEXT_CHECK_EVENT_FLUSH (1 << 2)
-struct r600_context {
- struct r600_screen *screen;
- struct radeon_winsys *ws;
- struct radeon_winsys_cs *cs;
- struct pipe_context *pipe;
-
- void (*flush)(void *pipe, unsigned flags);
-
- struct r600_range *range;
- unsigned nblocks;
- struct r600_block **blocks;
- struct list_head dirty;
- struct list_head resource_dirty;
- struct list_head enable_list;
- unsigned pm4_dirty_cdwords;
- unsigned ctx_pm4_ndwords;
- unsigned init_dwords;
-
- unsigned creloc;
- struct r600_resource **bo;
-
- uint32_t *pm4;
- unsigned pm4_cdwords;
-
- /* The list of active queries. Only one query of each type can be active. */
- struct list_head active_query_list;
- unsigned num_cs_dw_queries_suspend;
- unsigned num_cs_dw_streamout_end;
-
- unsigned backend_mask;
- unsigned max_db; /* for OQ */
- unsigned num_dest_buffers;
- unsigned flags;
- boolean predicate_drawing;
- struct r600_range ps_resources;
- struct r600_range vs_resources;
- struct r600_range fs_resources;
- int num_ps_resources, num_vs_resources, num_fs_resources;
- boolean have_depth_texture, have_depth_fb;
-
- unsigned num_so_targets;
- struct r600_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
- boolean streamout_start;
- unsigned streamout_append_bitmask;
- unsigned *vs_so_stride_in_dw;
-};
-
struct r600_draw {
uint32_t vgt_num_indices;
uint32_t vgt_num_instances;
struct r600_resource *indices;
};
+struct r600_context;
+struct r600_screen;
+
void r600_get_backend_mask(struct r600_context *ctx);
int r600_context_init(struct r600_context *ctx, struct r600_screen *screen);
void r600_context_fini(struct r600_context *ctx);
struct r600_resource *bo,
enum radeon_bo_usage usage);
-#define r600_pipe_state_add_reg(state, offset, value, bo, usage) _r600_pipe_state_add_reg(&rctx->ctx, state, offset, value, CTX_RANGE_ID(offset), CTX_BLOCK_ID(offset), bo, usage)
+#define r600_pipe_state_add_reg(state, offset, value, bo, usage) _r600_pipe_state_add_reg(rctx, state, offset, value, CTX_RANGE_ID(offset), CTX_BLOCK_ID(offset), bo, usage)
static inline void r600_pipe_state_mod_reg(struct r600_pipe_state *state,
uint32_t value)
R600_ERR("unsupported vertex format %s\n", util_format_name(pformat));
}
-int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, struct r600_vertex_element *ve)
+int r600_vertex_elements_build_fetch_shader(struct r600_context *rctx, struct r600_vertex_element *ve)
{
static int dump_shaders = -1;
return -ENOMEM;
}
- bytecode = rctx->ws->buffer_map(ve->fetch_shader->buf, rctx->ctx.cs, PIPE_TRANSFER_WRITE);
+ bytecode = rctx->ws->buffer_map(ve->fetch_shader->buf, rctx->cs, PIPE_TRANSFER_WRITE);
if (bytecode == NULL) {
r600_bytecode_clear(&bc);
pipe_resource_reference((struct pipe_resource**)&ve->fetch_shader, NULL);
#define R600_ASM_H
struct r600_vertex_element;
-struct r600_pipe_context;
+struct r600_context;
struct r600_bytecode_alu_src {
unsigned sel;
int cm_bytecode_add_cf_end(struct r600_bytecode *bc);
-int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, struct r600_vertex_element *ve);
+int r600_vertex_elements_build_fetch_shader(struct r600_context *rctx, struct r600_vertex_element *ve);
/* r700_asm.c */
void r700_bytecode_cf_vtx_build(uint32_t *bytecode, const struct r600_bytecode_cf *cf);
static void r600_blitter_begin(struct pipe_context *ctx, enum r600_blitter_op op)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
- r600_context_queries_suspend(&rctx->ctx);
+ r600_context_queries_suspend(rctx);
util_blitter_save_blend(rctx->blitter, rctx->states[R600_PIPE_STATE_BLEND]);
util_blitter_save_depth_stencil_alpha(rctx->blitter, rctx->states[R600_PIPE_STATE_DSA]);
util_blitter_save_vertex_buffers(rctx->blitter,
rctx->vbuf_mgr->nr_vertex_buffers,
rctx->vbuf_mgr->vertex_buffer);
- util_blitter_save_so_targets(rctx->blitter, rctx->ctx.num_so_targets,
- (struct pipe_stream_output_target**)rctx->ctx.so_targets);
+ util_blitter_save_so_targets(rctx->blitter, rctx->num_so_targets,
+ (struct pipe_stream_output_target**)rctx->so_targets);
if (op & R600_SAVE_FRAMEBUFFER)
util_blitter_save_framebuffer(rctx->blitter, &rctx->framebuffer);
static void r600_blitter_end(struct pipe_context *ctx)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
if (rctx->saved_render_cond) {
rctx->context.render_condition(&rctx->context,
rctx->saved_render_cond,
rctx->saved_render_cond_mode);
rctx->saved_render_cond = NULL;
}
- r600_context_queries_resume(&rctx->ctx);
+ r600_context_queries_resume(rctx);
}
static unsigned u_num_layers(struct pipe_resource *r, unsigned level)
void r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_texture *texture)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
unsigned layer, level;
float depth = 1.0f;
texture->dirty_db = FALSE;
}
-void r600_flush_depth_textures(struct r600_pipe_context *rctx)
+void r600_flush_depth_textures(struct r600_context *rctx)
{
unsigned int i;
const union pipe_color_union *color,
double depth, unsigned stencil)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct pipe_framebuffer_state *fb = &rctx->framebuffer;
r600_blitter_begin(ctx, R600_CLEAR);
unsigned dstx, unsigned dsty,
unsigned width, unsigned height)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_blitter_begin(ctx, R600_CLEAR_SURFACE);
util_blitter_clear_render_target(rctx->blitter, dst, color,
unsigned dstx, unsigned dsty,
unsigned width, unsigned height)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_blitter_begin(ctx, R600_CLEAR_SURFACE);
util_blitter_clear_depth_stencil(rctx->blitter, dst, clear_flags, depth, stencil,
unsigned src_level,
const struct pipe_box *src_box)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_blitter_begin(ctx, R600_COPY);
util_blitter_copy_texture(rctx->blitter, dst, dst_level, dstx, dsty, dstz,
r600_reset_blittable_to_compressed(dst, &orig_info[1]);
}
-void r600_init_blit_functions(struct r600_pipe_context *rctx)
+void r600_init_blit_functions(struct r600_context *rctx)
{
rctx->context.clear = r600_clear;
rctx->context.clear_render_target = r600_clear_render_target;
unsigned usage,
const struct pipe_box *box)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)ctx;
+ struct r600_context *rctx = (struct r600_context*)ctx;
struct pipe_transfer *transfer = util_slab_alloc(&rctx->pool_transfers);
transfer->resource = resource;
struct pipe_transfer *transfer)
{
struct r600_resource *rbuffer = r600_resource(transfer->resource);
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)pipe;
+ struct r600_context *rctx = (struct r600_context*)pipe;
uint8_t *data;
if (rbuffer->b.user_ptr)
return (uint8_t*)rbuffer->b.user_ptr + transfer->box.x;
- data = rctx->ws->buffer_map(rbuffer->buf, rctx->ctx.cs, transfer->usage);
+ data = rctx->ws->buffer_map(rbuffer->buf, rctx->cs, transfer->usage);
if (!data)
return NULL;
struct pipe_transfer *transfer)
{
struct r600_resource *rbuffer = r600_resource(transfer->resource);
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)pipe;
+ struct r600_context *rctx = (struct r600_context*)pipe;
if (rbuffer->b.user_ptr)
return;
static void r600_transfer_destroy(struct pipe_context *ctx,
struct pipe_transfer *transfer)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)ctx;
+ struct r600_context *rctx = (struct r600_context*)ctx;
util_slab_free(&rctx->pool_transfers, transfer);
}
unsigned stride,
unsigned layer_stride)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)pipe;
+ struct r600_context *rctx = (struct r600_context*)pipe;
struct r600_resource *rbuffer = r600_resource(resource);
uint8_t *map = NULL;
assert(rbuffer->b.user_ptr == NULL);
- map = rctx->ws->buffer_map(rbuffer->buf, rctx->ctx.cs,
+ map = rctx->ws->buffer_map(rbuffer->buf, rctx->cs,
PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage);
memcpy(map + box->x, data, box->width);
return &rbuffer->b.b.b;
}
-void r600_upload_index_buffer(struct r600_pipe_context *rctx,
+void r600_upload_index_buffer(struct r600_context *rctx,
struct pipe_index_buffer *ib, unsigned count)
{
struct r600_resource *rbuffer = r600_resource(ib->buffer);
rbuffer->b.user_ptr, &ib->offset, &ib->buffer);
}
-void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resource **rbuffer,
+void r600_upload_const_buffer(struct r600_context *rctx, struct r600_resource **rbuffer,
uint32_t *const_offset)
{
if ((*rbuffer)->b.user_ptr) {
free(ctx->blocks);
free(ctx->bo);
ctx->ws->cs_destroy(ctx->cs);
-
- memset(ctx, 0, sizeof(struct r600_context));
}
static void r600_add_resource_block(struct r600_context *ctx, struct r600_range *range, int num_blocks, int *index)
{
int r;
- memset(ctx, 0, sizeof(struct r600_context));
ctx->screen = screen;
ctx->ws = screen->ws;
/*
* pipe_context
*/
-static struct r600_fence *r600_create_fence(struct r600_pipe_context *ctx)
+static struct r600_fence *r600_create_fence(struct r600_context *rctx)
{
- struct r600_screen *rscreen = ctx->screen;
+ struct r600_screen *rscreen = rctx->screen;
struct r600_fence *fence = NULL;
pipe_mutex_lock(rscreen->fences.mutex);
R600_ERR("r600: failed to create bo for fence objects\n");
goto out;
}
- rscreen->fences.data = ctx->ws->buffer_map(rscreen->fences.bo->buf,
- ctx->ctx.cs,
+ rscreen->fences.data = rctx->ws->buffer_map(rscreen->fences.bo->buf,
+ rctx->cs,
PIPE_TRANSFER_READ_WRITE);
}
pipe_reference_init(&fence->reference, 1);
rscreen->fences.data[fence->index] = 0;
- r600_context_emit_fence(&ctx->ctx, rscreen->fences.bo, fence->index, 1);
+ r600_context_emit_fence(rctx, rscreen->fences.bo, fence->index, 1);
out:
pipe_mutex_unlock(rscreen->fences.mutex);
return fence;
void r600_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
unsigned flags)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_fence **rfence = (struct r600_fence**)fence;
struct pipe_query *render_cond = NULL;
unsigned render_cond_mode = 0;
ctx->render_condition(ctx, NULL, 0);
}
- r600_context_flush(&rctx->ctx, flags);
+ r600_context_flush(rctx, flags);
/* Re-enable render condition. */
if (render_cond) {
static void r600_destroy_context(struct pipe_context *context)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)context;
+ struct r600_context *rctx = (struct r600_context *)context;
rctx->context.delete_depth_stencil_alpha_state(&rctx->context, rctx->custom_dsa_flush);
util_unreference_framebuffer_state(&rctx->framebuffer);
- r600_context_fini(&rctx->ctx);
+ r600_context_fini(rctx);
util_blitter_destroy(rctx->blitter);
static struct pipe_context *r600_create_context(struct pipe_screen *screen, void *priv)
{
- struct r600_pipe_context *rctx = CALLOC_STRUCT(r600_pipe_context);
+ struct r600_context *rctx = CALLOC_STRUCT(r600_context);
struct r600_screen* rscreen = (struct r600_screen *)screen;
if (rctx == NULL)
case R600:
case R700:
r600_init_state_functions(rctx);
- if (r600_context_init(&rctx->ctx, rctx->screen)) {
+ if (r600_context_init(rctx, rctx->screen)) {
r600_destroy_context(&rctx->context);
return NULL;
}
case EVERGREEN:
case CAYMAN:
evergreen_init_state_functions(rctx);
- if (evergreen_context_init(&rctx->ctx, rctx->screen)) {
+ if (evergreen_context_init(rctx, rctx->screen)) {
r600_destroy_context(&rctx->context);
return NULL;
}
return NULL;
}
- rctx->ctx.pipe = &rctx->context;
- rctx->ctx.flush = r600_flush_from_winsys;
- rctx->ws->cs_set_flush_callback(rctx->ctx.cs, r600_flush_from_winsys, rctx);
+ rctx->pipe = &rctx->context;
+ rctx->flush = r600_flush_from_winsys;
+ rctx->ws->cs_set_flush_callback(rctx->cs, r600_flush_from_winsys, rctx);
util_slab_create(&rctx->pool_transfers,
sizeof(struct pipe_transfer), 64,
return NULL;
}
- r600_get_backend_mask(&rctx->ctx); /* this emits commands and must be last */
+ r600_get_backend_mask(rctx); /* this emits commands and must be last */
return &rctx->context;
}
ubyte writemask[2];
};
-struct r600_pipe_context {
+struct r600_context {
struct pipe_context context;
struct blitter_context *blitter;
enum radeon_family family;
struct r600_screen *screen;
struct radeon_winsys *ws;
struct r600_pipe_state *states[R600_PIPE_NSTATES];
- struct r600_context ctx;
struct r600_vertex_element *vertex_elements;
struct r600_pipe_resource_state fs_resource[PIPE_MAX_ATTRIBS];
struct pipe_framebuffer_state framebuffer;
boolean have_depth_texture, have_depth_fb;
unsigned default_ps_gprs, default_vs_gprs;
+
+ /* Below are variables from the old r600_context.
+ */
+ struct radeon_winsys_cs *cs;
+ struct pipe_context *pipe;
+
+ void (*flush)(void *pipe, unsigned flags);
+
+ struct r600_range *range;
+ unsigned nblocks;
+ struct r600_block **blocks;
+ struct list_head dirty;
+ struct list_head resource_dirty;
+ struct list_head enable_list;
+ unsigned pm4_dirty_cdwords;
+ unsigned ctx_pm4_ndwords;
+ unsigned init_dwords;
+
+ unsigned creloc;
+ struct r600_resource **bo;
+
+ uint32_t *pm4;
+ unsigned pm4_cdwords;
+
+ /* The list of active queries. Only one query of each type can be active. */
+ struct list_head active_query_list;
+ unsigned num_cs_dw_queries_suspend;
+ unsigned num_cs_dw_streamout_end;
+
+ unsigned backend_mask;
+ unsigned max_db; /* for OQ */
+ unsigned num_dest_buffers;
+ unsigned flags;
+ boolean predicate_drawing;
+ struct r600_range ps_resources;
+ struct r600_range vs_resources;
+ struct r600_range fs_resources;
+ int num_ps_resources, num_vs_resources, num_fs_resources;
+
+ unsigned num_so_targets;
+ struct r600_so_target *so_targets[PIPE_MAX_SO_BUFFERS];
+ boolean streamout_start;
+ unsigned streamout_append_bitmask;
+ unsigned *vs_so_stride_in_dw;
};
/* evergreen_state.c */
-void evergreen_init_state_functions(struct r600_pipe_context *rctx);
-void evergreen_init_config(struct r600_pipe_context *rctx);
+void evergreen_init_state_functions(struct r600_context *rctx);
+void evergreen_init_config(struct r600_context *rctx);
void evergreen_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader);
void evergreen_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader);
void evergreen_fetch_shader(struct pipe_context *ctx, struct r600_vertex_element *ve);
-void *evergreen_create_db_flush_dsa(struct r600_pipe_context *rctx);
-void evergreen_polygon_offset_update(struct r600_pipe_context *rctx);
-void evergreen_pipe_init_buffer_resource(struct r600_pipe_context *rctx,
+void *evergreen_create_db_flush_dsa(struct r600_context *rctx);
+void evergreen_polygon_offset_update(struct r600_context *rctx);
+void evergreen_pipe_init_buffer_resource(struct r600_context *rctx,
struct r600_pipe_resource_state *rstate);
void evergreen_pipe_mod_buffer_resource(struct pipe_context *ctx,
struct r600_pipe_resource_state *rstate,
unsigned usage);
/* r600_blit.c */
-void r600_init_blit_functions(struct r600_pipe_context *rctx);
+void r600_init_blit_functions(struct r600_context *rctx);
void r600_blit_uncompress_depth(struct pipe_context *ctx, struct r600_resource_texture *texture);
void r600_blit_push_depth(struct pipe_context *ctx, struct r600_resource_texture *texture);
-void r600_flush_depth_textures(struct r600_pipe_context *rctx);
+void r600_flush_depth_textures(struct r600_context *rctx);
/* r600_buffer.c */
bool r600_init_resource(struct r600_screen *rscreen,
struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
void *ptr, unsigned bytes,
unsigned bind);
-void r600_upload_index_buffer(struct r600_pipe_context *rctx,
+void r600_upload_index_buffer(struct r600_context *rctx,
struct pipe_index_buffer *ib, unsigned count);
unsigned flags);
/* r600_query.c */
-void r600_init_query_functions(struct r600_pipe_context *rctx);
+void r600_init_query_functions(struct r600_context *rctx);
/* r600_resource.c */
-void r600_init_context_resource_functions(struct r600_pipe_context *r600);
+void r600_init_context_resource_functions(struct r600_context *r600);
/* r600_shader.c */
int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *shader);
struct r600_shader *ps, int id);
/* r600_state.c */
-void r600_update_sampler_states(struct r600_pipe_context *rctx);
-void r600_init_state_functions(struct r600_pipe_context *rctx);
-void r600_init_config(struct r600_pipe_context *rctx);
+void r600_update_sampler_states(struct r600_context *rctx);
+void r600_init_state_functions(struct r600_context *rctx);
+void r600_init_config(struct r600_context *rctx);
void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader);
void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader);
void r600_fetch_shader(struct pipe_context *ctx, struct r600_vertex_element *ve);
-void *r600_create_db_flush_dsa(struct r600_pipe_context *rctx);
-void r600_polygon_offset_update(struct r600_pipe_context *rctx);
-void r600_pipe_init_buffer_resource(struct r600_pipe_context *rctx,
+void *r600_create_db_flush_dsa(struct r600_context *rctx);
+void r600_polygon_offset_update(struct r600_context *rctx);
+void r600_pipe_init_buffer_resource(struct r600_context *rctx,
struct r600_pipe_resource_state *rstate);
void r600_pipe_mod_buffer_resource(struct r600_pipe_resource_state *rstate,
struct r600_resource *rbuffer,
unsigned offset, unsigned stride,
enum radeon_bo_usage usage);
-void r600_adjust_gprs(struct r600_pipe_context *rctx);
+void r600_adjust_gprs(struct r600_context *rctx);
boolean r600_is_format_supported(struct pipe_screen *screen,
enum pipe_format format,
enum pipe_texture_target target,
/* r600_texture.c */
void r600_init_screen_texture_functions(struct pipe_screen *screen);
-void r600_init_surface_functions(struct r600_pipe_context *r600);
+void r600_init_surface_functions(struct r600_context *r600);
uint32_t r600_translate_texformat(struct pipe_screen *screen, enum pipe_format format,
const unsigned char *swizzle_view,
uint32_t *word4_p, uint32_t *yuv_format_p);
unsigned level, unsigned layer);
/* r600_translate.c */
-void r600_translate_index_buffer(struct r600_pipe_context *r600,
+void r600_translate_index_buffer(struct r600_context *r600,
struct pipe_index_buffer *ib,
unsigned count);
static struct pipe_query *r600_create_query(struct pipe_context *ctx, unsigned query_type)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
- return (struct pipe_query*)r600_context_query_create(&rctx->ctx, query_type);
+ return (struct pipe_query*)r600_context_query_create(rctx, query_type);
}
static void r600_destroy_query(struct pipe_context *ctx, struct pipe_query *query)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
- r600_context_query_destroy(&rctx->ctx, (struct r600_query *)query);
+ r600_context_query_destroy(rctx, (struct r600_query *)query);
}
static void r600_begin_query(struct pipe_context *ctx, struct pipe_query *query)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
memset(&rquery->result, 0, sizeof(rquery->result));
rquery->results_start = rquery->results_end;
- r600_query_begin(&rctx->ctx, (struct r600_query *)query);
- LIST_ADDTAIL(&rquery->list, &rctx->ctx.active_query_list);
+ r600_query_begin(rctx, (struct r600_query *)query);
+ LIST_ADDTAIL(&rquery->list, &rctx->active_query_list);
}
static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
- r600_query_end(&rctx->ctx, rquery);
+ r600_query_end(rctx, rquery);
LIST_DELINIT(&rquery->list);
}
struct pipe_query *query,
boolean wait, void *vresult)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
- return r600_context_query_result(&rctx->ctx, rquery, wait, vresult);
+ return r600_context_query_result(rctx, rquery, wait, vresult);
}
static void r600_render_condition(struct pipe_context *ctx,
struct pipe_query *query,
uint mode)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_query *rquery = (struct r600_query *)query;
int wait_flag = 0;
rctx->current_render_cond_mode = mode;
if (query == NULL) {
- if (rctx->ctx.predicate_drawing) {
- rctx->ctx.predicate_drawing = false;
- r600_query_predication(&rctx->ctx, NULL, PREDICATION_OP_CLEAR, 1);
+ if (rctx->predicate_drawing) {
+ rctx->predicate_drawing = false;
+ r600_query_predication(rctx, NULL, PREDICATION_OP_CLEAR, 1);
}
return;
}
wait_flag = 1;
}
- rctx->ctx.predicate_drawing = true;
+ rctx->predicate_drawing = true;
switch (rquery->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_OCCLUSION_PREDICATE:
- r600_query_predication(&rctx->ctx, rquery, PREDICATION_OP_ZPASS, wait_flag);
+ r600_query_predication(rctx, rquery, PREDICATION_OP_ZPASS, wait_flag);
break;
case PIPE_QUERY_PRIMITIVES_EMITTED:
case PIPE_QUERY_PRIMITIVES_GENERATED:
case PIPE_QUERY_SO_STATISTICS:
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
- r600_query_predication(&rctx->ctx, rquery, PREDICATION_OP_PRIMCOUNT, wait_flag);
+ r600_query_predication(rctx, rquery, PREDICATION_OP_PRIMCOUNT, wait_flag);
break;
default:
assert(0);
}
}
-void r600_init_query_functions(struct r600_pipe_context *rctx)
+void r600_init_query_functions(struct r600_context *rctx)
{
rctx->context.create_query = r600_create_query;
rctx->context.destroy_query = r600_destroy_query;
screen->user_buffer_create = r600_user_buffer_create;
}
-void r600_init_context_resource_functions(struct r600_pipe_context *r600)
+void r600_init_context_resource_functions(struct r600_context *r600)
{
r600->context.get_transfer = u_get_transfer_vtbl;
r600->context.transfer_map = u_transfer_map_vtbl;
void r600_texture_transfer_unmap(struct pipe_context *ctx,
struct pipe_transfer* transfer);
-struct r600_pipe_context;
+struct r600_context;
-void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resource **rbuffer, uint32_t *offset);
+void r600_upload_const_buffer(struct r600_context *rctx, struct r600_resource **rbuffer, uint32_t *offset);
uint64_t r600_resource_va(struct pipe_screen *screen, struct pipe_resource *resource);
static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_shader *rshader = &shader->shader;
uint32_t *ptr;
int i;
if (shader->bo == NULL) {
return -ENOMEM;
}
- ptr = (uint32_t*)rctx->ws->buffer_map(shader->bo->buf, rctx->ctx.cs, PIPE_TRANSFER_WRITE);
+ ptr = (uint32_t*)rctx->ws->buffer_map(shader->bo->buf, rctx->cs, PIPE_TRANSFER_WRITE);
if (R600_BIG_ENDIAN) {
for (i = 0; i < rshader->bc.ndw; ++i) {
ptr[i] = bswap_32(rshader->bc.bytecode[i]);
return 0;
}
-static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pipe_shader *pipeshader);
+static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_shader *pipeshader);
int r600_pipe_shader_create(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
static int dump_shaders = -1;
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
int r;
/* Would like some magic "get_bool_option_once" routine.
return 0;
}
-static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pipe_shader *pipeshader)
+static int r600_shader_from_tgsi(struct r600_context * rctx, struct r600_pipe_shader *pipeshader)
{
struct r600_shader *shader = &pipeshader->shader;
struct tgsi_token *tokens = pipeshader->tokens;
return retval == usage;
}
-void r600_polygon_offset_update(struct r600_pipe_context *rctx)
+void r600_polygon_offset_update(struct r600_context *rctx)
{
struct r600_pipe_state state;
r600_pipe_state_add_reg(&state,
R_028DF8_PA_SU_POLY_OFFSET_DB_FMT_CNTL,
offset_db_fmt_cntl, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, &state);
+ r600_context_pipe_state_set(rctx, &state);
}
}
static void r600_set_blend_color(struct pipe_context *ctx,
const struct pipe_blend_color *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
r600_pipe_state_add_reg(rstate, R_028420_CB_BLEND_ALPHA, fui(state->color[3]), NULL, 0);
free(rctx->states[R600_PIPE_STATE_BLEND_COLOR]);
rctx->states[R600_PIPE_STATE_BLEND_COLOR] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
static void *r600_create_blend_state(struct pipe_context *ctx,
const struct pipe_blend_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_blend *blend = CALLOC_STRUCT(r600_pipe_blend);
struct r600_pipe_state *rstate;
uint32_t color_control = 0, target_mask;
static void *r600_create_dsa_state(struct pipe_context *ctx,
const struct pipe_depth_stencil_alpha_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_dsa *dsa = CALLOC_STRUCT(r600_pipe_dsa);
unsigned db_depth_control, alpha_test_control, alpha_ref;
unsigned db_render_override, db_render_control;
static void *r600_create_rs_state(struct pipe_context *ctx,
const struct pipe_rasterizer_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_rasterizer *rs = CALLOC_STRUCT(r600_pipe_rasterizer);
struct r600_pipe_state *rstate;
unsigned tmp;
return &view->base;
}
-static void r600_set_sampler_views(struct r600_pipe_context *rctx,
+static void r600_set_sampler_views(struct r600_context *rctx,
struct r600_textures_info *dst,
unsigned count,
struct pipe_sampler_view **views,
rviews[i]->base.texture->target == PIPE_TEXTURE_2D_ARRAY) != dst->is_array_sampler[i])
dst->samplers_dirty = true;
- set_resource(&rctx->ctx, &rviews[i]->state, i + R600_MAX_CONST_BUFFERS);
+ set_resource(rctx, &rviews[i]->state, i + R600_MAX_CONST_BUFFERS);
} else {
- set_resource(&rctx->ctx, NULL, i + R600_MAX_CONST_BUFFERS);
+ set_resource(rctx, NULL, i + R600_MAX_CONST_BUFFERS);
}
pipe_sampler_view_reference(
for (i = count; i < dst->n_views; i++) {
if (dst->views[i]) {
- set_resource(&rctx->ctx, NULL, i + R600_MAX_CONST_BUFFERS);
+ set_resource(rctx, NULL, i + R600_MAX_CONST_BUFFERS);
pipe_sampler_view_reference((struct pipe_sampler_view **)&dst->views[i], NULL);
}
}
static void r600_set_vs_sampler_views(struct pipe_context *ctx, unsigned count,
struct pipe_sampler_view **views)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_set_sampler_views(rctx, &rctx->vs_samplers, count, views,
r600_context_pipe_state_set_vs_resource);
}
static void r600_set_ps_sampler_views(struct pipe_context *ctx, unsigned count,
struct pipe_sampler_view **views)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_set_sampler_views(rctx, &rctx->ps_samplers, count, views,
r600_context_pipe_state_set_ps_resource);
}
-static void r600_set_seamless_cubemap(struct r600_pipe_context *rctx, boolean enable)
+static void r600_set_seamless_cubemap(struct r600_context *rctx, boolean enable)
{
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
free(rctx->states[R600_PIPE_STATE_SEAMLESS_CUBEMAP]);
rctx->states[R600_PIPE_STATE_SEAMLESS_CUBEMAP] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
-static void r600_bind_samplers(struct r600_pipe_context *rctx,
+static void r600_bind_samplers(struct r600_context *rctx,
struct r600_textures_info *dst,
unsigned count, void **states)
{
static void r600_bind_vs_samplers(struct pipe_context *ctx, unsigned count, void **states)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_bind_samplers(rctx, &rctx->vs_samplers, count, states);
}
static void r600_bind_ps_samplers(struct pipe_context *ctx, unsigned count, void **states)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
r600_bind_samplers(rctx, &rctx->ps_samplers, count, states);
}
-static void r600_update_samplers(struct r600_pipe_context *rctx,
+static void r600_update_samplers(struct r600_context *rctx,
struct r600_textures_info *tex,
void (*set_sampler)(struct r600_context*, struct r600_pipe_state*, unsigned))
{
}
}
- set_sampler(&rctx->ctx, &tex->samplers[i]->rstate, i);
+ set_sampler(rctx, &tex->samplers[i]->rstate, i);
if (tex->samplers[i])
seamless = tex->samplers[i]->seamless_cube_map;
}
}
-void r600_update_sampler_states(struct r600_pipe_context *rctx)
+void r600_update_sampler_states(struct r600_context *rctx)
{
r600_update_samplers(rctx, &rctx->vs_samplers,
r600_context_pipe_state_set_vs_sampler);
static void r600_set_clip_state(struct pipe_context *ctx,
const struct pipe_clip_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
struct pipe_resource * cbuf;
free(rctx->states[R600_PIPE_STATE_CLIP]);
rctx->states[R600_PIPE_STATE_CLIP] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
cbuf = pipe_user_buffer_create(ctx->screen,
state->ucp,
static void r600_set_scissor_state(struct pipe_context *ctx,
const struct pipe_scissor_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
uint32_t tl, br;
free(rctx->states[R600_PIPE_STATE_SCISSOR]);
rctx->states[R600_PIPE_STATE_SCISSOR] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
static void r600_set_viewport_state(struct pipe_context *ctx,
const struct pipe_viewport_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
free(rctx->states[R600_PIPE_STATE_VIEWPORT]);
rctx->states[R600_PIPE_STATE_VIEWPORT] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
-static void r600_cb(struct r600_pipe_context *rctx, struct r600_pipe_state *rstate,
+static void r600_cb(struct r600_context *rctx, struct r600_pipe_state *rstate,
const struct pipe_framebuffer_state *state, int cb)
{
struct r600_resource_texture *rtex;
0x00000000, NULL, 0);
}
-static void r600_db(struct r600_pipe_context *rctx, struct r600_pipe_state *rstate,
+static void r600_db(struct r600_context *rctx, struct r600_pipe_state *rstate,
const struct pipe_framebuffer_state *state)
{
struct r600_resource_texture *rtex;
static void r600_set_framebuffer_state(struct pipe_context *ctx,
const struct pipe_framebuffer_state *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
uint32_t shader_mask, tl, br, shader_control;
if (rstate == NULL)
return;
- r600_context_flush_dest_caches(&rctx->ctx);
- rctx->ctx.num_dest_buffers = state->nr_cbufs;
+ r600_context_flush_dest_caches(rctx);
+ rctx->num_dest_buffers = state->nr_cbufs;
/* unreference old buffer and reference new one */
rstate->id = R600_PIPE_STATE_FRAMEBUFFER;
}
if (state->zsbuf) {
r600_db(rctx, rstate, state);
- rctx->ctx.num_dest_buffers++;
+ rctx->num_dest_buffers++;
}
shader_mask = 0;
free(rctx->states[R600_PIPE_STATE_FRAMEBUFFER]);
rctx->states[R600_PIPE_STATE_FRAMEBUFFER] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
if (state->zsbuf) {
r600_polygon_offset_update(rctx);
static void r600_texture_barrier(struct pipe_context *ctx)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
- r600_context_flush_all(&rctx->ctx, S_0085F0_TC_ACTION_ENA(1) | S_0085F0_CB_ACTION_ENA(1) |
+ r600_context_flush_all(rctx, S_0085F0_TC_ACTION_ENA(1) | S_0085F0_CB_ACTION_ENA(1) |
S_0085F0_CB0_DEST_BASE_ENA(1) | S_0085F0_CB1_DEST_BASE_ENA(1) |
S_0085F0_CB2_DEST_BASE_ENA(1) | S_0085F0_CB3_DEST_BASE_ENA(1) |
S_0085F0_CB4_DEST_BASE_ENA(1) | S_0085F0_CB5_DEST_BASE_ENA(1) |
S_0085F0_CB6_DEST_BASE_ENA(1) | S_0085F0_CB7_DEST_BASE_ENA(1));
}
-void r600_init_state_functions(struct r600_pipe_context *rctx)
+void r600_init_state_functions(struct r600_context *rctx)
{
rctx->context.create_blend_state = r600_create_blend_state;
rctx->context.create_depth_stencil_alpha_state = r600_create_dsa_state;
rctx->context.set_stream_output_targets = r600_set_so_targets;
}
-void r600_adjust_gprs(struct r600_pipe_context *rctx)
+void r600_adjust_gprs(struct r600_context *rctx)
{
struct r600_pipe_state rstate;
unsigned num_ps_gprs = rctx->default_ps_gprs;
rstate.nregs = 0;
r600_pipe_state_add_reg(&rstate, R_008C04_SQ_GPR_RESOURCE_MGMT_1, tmp, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, &rstate);
+ r600_context_pipe_state_set(rctx, &rstate);
}
-void r600_init_config(struct r600_pipe_context *rctx)
+void r600_init_config(struct r600_context *rctx)
{
int ps_prio;
int vs_prio;
r600_pipe_state_add_reg(rstate, R_028A94_VGT_MULTI_PRIM_IB_RESET_EN, 0x00000000, NULL, 0);
r600_pipe_state_add_reg(rstate, R_028AA0_VGT_INSTANCE_STEP_RATE_0, 0x00000000, NULL, 0);
r600_pipe_state_add_reg(rstate, R_028AA4_VGT_INSTANCE_STEP_RATE_1, 0x00000000, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
r600_set_seamless_cubemap(rctx, FALSE);
}
void r600_pipe_shader_ps(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &shader->rstate;
struct r600_shader *rshader = &shader->shader;
unsigned i, exports_ps, num_cout, spi_ps_in_control_0, spi_input_z, spi_ps_in_control_1, db_shader_control;
void r600_pipe_shader_vs(struct pipe_context *ctx, struct r600_pipe_shader *shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = &shader->rstate;
struct r600_shader *rshader = &shader->shader;
unsigned spi_vs_out_id[10] = {};
struct r600_vertex_element *ve)
{
struct r600_pipe_state *rstate;
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
rstate = &ve->rstate;
rstate->id = R600_PIPE_STATE_FETCH_SHADER;
ve->fetch_shader, RADEON_USAGE_READ);
}
-void *r600_create_db_flush_dsa(struct r600_pipe_context *rctx)
+void *r600_create_db_flush_dsa(struct r600_context *rctx)
{
struct pipe_depth_stencil_alpha_state dsa;
struct r600_pipe_state *rstate;
return rstate;
}
-void r600_pipe_init_buffer_resource(struct r600_pipe_context *rctx,
+void r600_pipe_init_buffer_resource(struct r600_context *rctx,
struct r600_pipe_resource_state *rstate)
{
rstate->id = R600_PIPE_STATE_RESOURCE;
/* common state between evergreen and r600 */
void r600_bind_blend_state(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_blend *blend = (struct r600_pipe_blend *)state;
struct r600_pipe_state *rstate;
rctx->cb_color_control &= ~C_028808_MULTIWRITE_ENABLE;
rctx->cb_color_control |= blend->cb_color_control & C_028808_MULTIWRITE_ENABLE;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
static void r600_set_stencil_ref(struct pipe_context *ctx,
const struct r600_stencil_ref *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = CALLOC_STRUCT(r600_pipe_state);
if (rstate == NULL)
free(rctx->states[R600_PIPE_STATE_STENCIL_REF]);
rctx->states[R600_PIPE_STATE_STENCIL_REF] = rstate;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
}
void r600_set_pipe_stencil_ref(struct pipe_context *ctx,
const struct pipe_stencil_ref *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_dsa *dsa = (struct r600_pipe_dsa*)rctx->states[R600_PIPE_STATE_DSA];
struct r600_stencil_ref ref;
void r600_bind_dsa_state(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_dsa *dsa = state;
struct r600_pipe_state *rstate;
struct r600_stencil_ref ref;
rctx->states[rstate->id] = rstate;
rctx->alpha_ref = dsa->alpha_ref;
rctx->alpha_ref_dirty = true;
- r600_context_pipe_state_set(&rctx->ctx, rstate);
+ r600_context_pipe_state_set(rctx, rstate);
ref.ref_value[0] = rctx->stencil_ref.ref_value[0];
ref.ref_value[1] = rctx->stencil_ref.ref_value[1];
void r600_bind_rs_state(struct pipe_context *ctx, void *state)
{
struct r600_pipe_rasterizer *rs = (struct r600_pipe_rasterizer *)state;
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
if (state == NULL)
return;
rctx->rasterizer = rs;
rctx->states[rs->rstate.id] = &rs->rstate;
- r600_context_pipe_state_set(&rctx->ctx, &rs->rstate);
+ r600_context_pipe_state_set(rctx, &rs->rstate);
if (rctx->chip_class >= EVERGREEN) {
evergreen_polygon_offset_update(rctx);
void r600_delete_rs_state(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_rasterizer *rs = (struct r600_pipe_rasterizer *)state;
if (rctx->rasterizer == rs) {
void r600_delete_state(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_state *rstate = (struct r600_pipe_state *)state;
if (rctx->states[rstate->id] == rstate) {
void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
rctx->vertex_elements = v;
v->vmgr_elements);
rctx->states[v->rstate.id] = &v->rstate;
- r600_context_pipe_state_set(&rctx->ctx, &v->rstate);
+ r600_context_pipe_state_set(rctx, &v->rstate);
}
}
void r600_delete_vertex_element(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
if (rctx->states[v->rstate.id] == &v->rstate) {
void r600_set_index_buffer(struct pipe_context *ctx,
const struct pipe_index_buffer *ib)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
u_vbuf_set_index_buffer(rctx->vbuf_mgr, ib);
}
void r600_set_vertex_buffers(struct pipe_context *ctx, unsigned count,
const struct pipe_vertex_buffer *buffers)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
int i;
/* Zero states. */
for (i = 0; i < count; i++) {
if (!buffers[i].buffer) {
if (rctx->chip_class >= EVERGREEN) {
- evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
+ evergreen_context_pipe_state_set_fs_resource(rctx, NULL, i);
} else {
- r600_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
+ r600_context_pipe_state_set_fs_resource(rctx, NULL, i);
}
}
}
for (; i < rctx->vbuf_mgr->nr_real_vertex_buffers; i++) {
if (rctx->chip_class >= EVERGREEN) {
- evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
+ evergreen_context_pipe_state_set_fs_resource(rctx, NULL, i);
} else {
- r600_context_pipe_state_set_fs_resource(&rctx->ctx, NULL, i);
+ r600_context_pipe_state_set_fs_resource(rctx, NULL, i);
}
}
unsigned count,
const struct pipe_vertex_element *elements)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_vertex_element *v = CALLOC_STRUCT(r600_vertex_element);
assert(count < 32);
void r600_bind_ps_shader(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
/* TODO delete old shader */
rctx->ps_shader = (struct r600_pipe_shader *)state;
if (state) {
- r600_context_pipe_state_set(&rctx->ctx, &rctx->ps_shader->rstate);
+ r600_context_pipe_state_set(rctx, &rctx->ps_shader->rstate);
rctx->cb_color_control &= C_028808_MULTIWRITE_ENABLE;
rctx->cb_color_control |= S_028808_MULTIWRITE_ENABLE(!!rctx->ps_shader->shader.fs_write_all);
void r600_bind_vs_shader(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
/* TODO delete old shader */
rctx->vs_shader = (struct r600_pipe_shader *)state;
if (state) {
- r600_context_pipe_state_set(&rctx->ctx, &rctx->vs_shader->rstate);
+ r600_context_pipe_state_set(rctx, &rctx->vs_shader->rstate);
}
if (rctx->ps_shader && rctx->vs_shader) {
r600_adjust_gprs(rctx);
void r600_delete_ps_shader(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_shader *shader = (struct r600_pipe_shader *)state;
if (rctx->ps_shader == shader) {
void r600_delete_vs_shader(struct pipe_context *ctx, void *state)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_shader *shader = (struct r600_pipe_shader *)state;
if (rctx->vs_shader == shader) {
free(shader);
}
-static void r600_update_alpha_ref(struct r600_pipe_context *rctx)
+static void r600_update_alpha_ref(struct r600_context *rctx)
{
unsigned alpha_ref;
struct r600_pipe_state rstate;
alpha_ref &= ~0x1FFF;
r600_pipe_state_add_reg(&rstate, R_028438_SX_ALPHA_REF, alpha_ref, NULL, 0);
- r600_context_pipe_state_set(&rctx->ctx, &rstate);
+ r600_context_pipe_state_set(rctx, &rstate);
rctx->alpha_ref_dirty = false;
}
void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint index,
struct pipe_resource *buffer)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_resource *rbuffer = r600_resource(buffer);
struct r600_pipe_resource_state *rstate;
uint64_t va_offset;
r600_pipe_state_add_reg(&rctx->vs_const_buffer,
R_028980_ALU_CONST_CACHE_VS_0 + index * 4,
va_offset, rbuffer, RADEON_USAGE_READ);
- r600_context_pipe_state_set(&rctx->ctx, &rctx->vs_const_buffer);
+ r600_context_pipe_state_set(rctx, &rctx->vs_const_buffer);
rstate = &rctx->vs_const_buffer_resource[index];
if (!rstate->id) {
if (rctx->chip_class >= EVERGREEN) {
evergreen_pipe_mod_buffer_resource(ctx, rstate, rbuffer, offset, 16, RADEON_USAGE_READ);
- evergreen_context_pipe_state_set_vs_resource(&rctx->ctx, rstate, index);
+ evergreen_context_pipe_state_set_vs_resource(rctx, rstate, index);
} else {
r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, 16, RADEON_USAGE_READ);
- r600_context_pipe_state_set_vs_resource(&rctx->ctx, rstate, index);
+ r600_context_pipe_state_set_vs_resource(rctx, rstate, index);
}
break;
case PIPE_SHADER_FRAGMENT:
r600_pipe_state_add_reg(&rctx->ps_const_buffer,
R_028940_ALU_CONST_CACHE_PS_0,
va_offset, rbuffer, RADEON_USAGE_READ);
- r600_context_pipe_state_set(&rctx->ctx, &rctx->ps_const_buffer);
+ r600_context_pipe_state_set(rctx, &rctx->ps_const_buffer);
rstate = &rctx->ps_const_buffer_resource[index];
if (!rstate->id) {
}
if (rctx->chip_class >= EVERGREEN) {
evergreen_pipe_mod_buffer_resource(ctx, rstate, rbuffer, offset, 16, RADEON_USAGE_READ);
- evergreen_context_pipe_state_set_ps_resource(&rctx->ctx, rstate, index);
+ evergreen_context_pipe_state_set_ps_resource(rctx, rstate, index);
} else {
r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, 16, RADEON_USAGE_READ);
- r600_context_pipe_state_set_ps_resource(&rctx->ctx, rstate, index);
+ r600_context_pipe_state_set_ps_resource(rctx, rstate, index);
}
break;
default:
unsigned buffer_offset,
unsigned buffer_size)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_so_target *t;
void *ptr;
t->filled_size = (struct r600_resource*)
pipe_buffer_create(ctx->screen, PIPE_BIND_CUSTOM, PIPE_USAGE_STATIC, 4);
- ptr = rctx->ws->buffer_map(t->filled_size->buf, rctx->ctx.cs, PIPE_TRANSFER_WRITE);
+ ptr = rctx->ws->buffer_map(t->filled_size->buf, rctx->cs, PIPE_TRANSFER_WRITE);
memset(ptr, 0, t->filled_size->buf->size);
rctx->ws->buffer_unmap(t->filled_size->buf);
struct pipe_stream_output_target **targets,
unsigned append_bitmask)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
unsigned i;
/* Stop streamout. */
- if (rctx->ctx.num_so_targets) {
- r600_context_streamout_end(&rctx->ctx);
+ if (rctx->num_so_targets) {
+ r600_context_streamout_end(rctx);
}
/* Set the new targets. */
for (i = 0; i < num_targets; i++) {
- pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->ctx.so_targets[i], targets[i]);
+ pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->so_targets[i], targets[i]);
}
- for (; i < rctx->ctx.num_so_targets; i++) {
- pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->ctx.so_targets[i], NULL);
+ for (; i < rctx->num_so_targets; i++) {
+ pipe_so_target_reference((struct pipe_stream_output_target**)&rctx->so_targets[i], NULL);
}
- rctx->ctx.num_so_targets = num_targets;
- rctx->ctx.streamout_start = num_targets != 0;
- rctx->ctx.streamout_append_bitmask = append_bitmask;
+ rctx->num_so_targets = num_targets;
+ rctx->streamout_start = num_targets != 0;
+ rctx->streamout_append_bitmask = append_bitmask;
}
-static void r600_vertex_buffer_update(struct r600_pipe_context *rctx)
+static void r600_vertex_buffer_update(struct r600_context *rctx)
{
struct r600_pipe_resource_state *rstate;
struct r600_resource *rbuffer;
if (rctx->chip_class >= EVERGREEN) {
evergreen_pipe_mod_buffer_resource(&rctx->context, rstate, rbuffer, offset, vertex_buffer->stride, RADEON_USAGE_READ);
- evergreen_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i);
+ evergreen_context_pipe_state_set_fs_resource(rctx, rstate, i);
} else {
r600_pipe_mod_buffer_resource(rstate, rbuffer, offset, vertex_buffer->stride, RADEON_USAGE_READ);
- r600_context_pipe_state_set_fs_resource(&rctx->ctx, rstate, i);
+ r600_context_pipe_state_set_fs_resource(rctx, rstate, i);
}
}
}
static int r600_shader_rebuild(struct pipe_context * ctx, struct r600_pipe_shader * shader)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
int r;
r600_pipe_shader_destroy(ctx, shader);
if (r) {
return r;
}
- r600_context_pipe_state_set(&rctx->ctx, &shader->rstate);
+ r600_context_pipe_state_set(rctx, &shader->rstate);
return 0;
}
-static void r600_update_derived_state(struct r600_pipe_context *rctx)
+static void r600_update_derived_state(struct r600_context *rctx)
{
struct pipe_context * ctx = (struct pipe_context*)rctx;
struct r600_pipe_state rstate;
rstate.nregs = 0;
if (rstate.nregs)
- r600_context_pipe_state_set(&rctx->ctx, &rstate);
+ r600_context_pipe_state_set(rctx, &rstate);
if (!rctx->blitter->running) {
if (rctx->have_depth_fb || rctx->have_depth_texture)
else
r600_pipe_shader_ps(ctx, rctx->ps_shader);
- r600_context_pipe_state_set(&rctx->ctx, &rctx->ps_shader->rstate);
+ r600_context_pipe_state_set(rctx, &rctx->ps_shader->rstate);
}
}
void r600_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *dinfo)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_pipe_dsa *dsa = (struct r600_pipe_dsa*)rctx->states[R600_PIPE_STATE_DSA];
struct pipe_draw_info info = *dinfo;
struct r600_draw rdraw = {};
if (info.count_from_stream_output) {
rdraw.vgt_draw_initiator |= S_0287F0_USE_OPAQUE(1);
- r600_context_draw_opaque_count(&rctx->ctx, (struct r600_so_target*)info.count_from_stream_output);
+ r600_context_draw_opaque_count(rctx, (struct r600_so_target*)info.count_from_stream_output);
}
}
- rctx->ctx.vs_so_stride_in_dw = rctx->vs_shader->so.stride;
+ rctx->vs_so_stride_in_dw = rctx->vs_shader->so.stride;
mask = (1ULL << ((unsigned)rctx->framebuffer.nr_cbufs * 4)) - 1;
rctx->vs_shader->shader.vs_prohibit_ucps ?
0 : rctx->rasterizer->clip_plane_enable & 0x3F));
- r600_context_pipe_state_set(&rctx->ctx, &rctx->vgt);
+ r600_context_pipe_state_set(rctx, &rctx->vgt);
rdraw.db_render_override = dsa->db_render_override;
rdraw.db_render_control = dsa->db_render_control;
if (rctx->chip_class >= EVERGREEN) {
- evergreen_context_draw(&rctx->ctx, &rdraw);
+ evergreen_context_draw(rctx, &rdraw);
} else {
- r600_context_draw(&rctx->ctx, &rdraw);
+ r600_context_draw(rctx, &rdraw);
}
if (rctx->framebuffer.zsbuf)
void* r600_texture_transfer_map(struct pipe_context *ctx,
struct pipe_transfer* transfer)
{
- struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
+ struct r600_context *rctx = (struct r600_context *)ctx;
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
struct pb_buffer *buf;
enum pipe_format format = transfer->resource->format;
transfer->box.x / util_format_get_blockwidth(format) * util_format_get_blocksize(format);
}
- if (!(map = rctx->ws->buffer_map(buf, rctx->ctx.cs, transfer->usage))) {
+ if (!(map = rctx->ws->buffer_map(buf, rctx->cs, transfer->usage))) {
return NULL;
}
struct pipe_transfer* transfer)
{
struct r600_transfer *rtransfer = (struct r600_transfer*)transfer;
- struct r600_pipe_context *rctx = (struct r600_pipe_context*)ctx;
+ struct r600_context *rctx = (struct r600_context*)ctx;
struct pb_buffer *buf;
if (rtransfer->staging_texture) {
rctx->ws->buffer_unmap(buf);
}
-void r600_init_surface_functions(struct r600_pipe_context *r600)
+void r600_init_surface_functions(struct r600_context *r600)
{
r600->context.create_surface = r600_create_surface;
r600->context.surface_destroy = r600_surface_destroy;
#include "r600_pipe.h"
-void r600_translate_index_buffer(struct r600_pipe_context *r600,
+void r600_translate_index_buffer(struct r600_context *r600,
struct pipe_index_buffer *ib,
unsigned count)
{