void
fd2_emit_init_screen(struct pipe_screen *pscreen)
{
+ struct fd_screen *screen = fd_screen(pscreen);
+ screen->emit_ib = fd2_emit_ib;
}
void
fd2_emit_init(struct pipe_context *pctx)
{
- struct fd_context *ctx = fd_context(pctx);
- ctx->emit_ib = fd2_emit_ib;
}
struct fd_screen *screen = fd_screen(pscreen);
screen->emit_const = fd3_emit_const;
screen->emit_const_bo = fd3_emit_const_bo;
+ screen->emit_ib = fd3_emit_ib;
}
void
fd3_emit_init(struct pipe_context *pctx)
{
- struct fd_context *ctx = fd_context(pctx);
- ctx->emit_ib = fd3_emit_ib;
}
screen->emit_const = fd4_emit_const;
screen->emit_const_bo = fd4_emit_const_bo;
+ screen->emit_ib = fd4_emit_ib;
+ screen->mem_to_mem = fd4_mem_to_mem;
}
void
fd4_emit_init(struct pipe_context *pctx)
{
- struct fd_context *ctx = fd_context(pctx);
- ctx->emit_ib = fd4_emit_ib;
- ctx->mem_to_mem = fd4_mem_to_mem;
}
struct fd_screen *screen = fd_screen(pscreen);
screen->emit_const = fd5_emit_const;
screen->emit_const_bo = fd5_emit_const_bo;
+ screen->emit_ib = fd5_emit_ib;
+ screen->mem_to_mem = fd5_mem_to_mem;
}
void
fd5_emit_init(struct pipe_context *pctx)
{
- struct fd_context *ctx = fd_context(pctx);
- ctx->emit_ib = fd5_emit_ib;
- ctx->mem_to_mem = fd5_mem_to_mem;
}
struct fd_screen *screen = fd_screen(pscreen);
screen->emit_const = fd6_emit_const;
screen->emit_const_bo = fd6_emit_const_bo;
+ screen->emit_ib = fd6_emit_ib;
+ screen->mem_to_mem = fd6_mem_to_mem;
}
void
fd6_emit_init(struct pipe_context *pctx)
{
struct fd_context *ctx = fd_context(pctx);
- ctx->emit_ib = fd6_emit_ib;
- ctx->mem_to_mem = fd6_mem_to_mem;
ctx->framebuffer_barrier = fd6_framebuffer_barrier;
}
/* compute: */
void (*launch_grid)(struct fd_context *ctx, const struct pipe_grid_info *info);
- /* indirect-branch emit: */
- void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target);
-
/* query: */
struct fd_query * (*create_query)(struct fd_context *ctx, unsigned query_type);
void (*query_prepare)(struct fd_batch *batch, uint32_t num_tiles);
/* blitter: */
bool (*blit)(struct fd_context *ctx, const struct pipe_blit_info *info);
- /* simple gpu "memcpy": */
- void (*mem_to_mem)(struct fd_ringbuffer *ring, struct pipe_resource *dst,
- unsigned dst_off, struct pipe_resource *src, unsigned src_off,
- unsigned sizedwords);
-
/* handling for barriers: */
void (*framebuffer_barrier)(struct fd_context *ctx);
if (ctx->emit_tile) {
ctx->emit_tile(batch, tile);
} else {
- ctx->emit_ib(batch->gmem, batch->draw);
+ ctx->screen->emit_ib(batch->gmem, batch->draw);
}
fd_reset_wfi(batch);
ctx->query_prepare_tile(batch, 0, batch->gmem);
/* emit IB to drawcmds: */
- ctx->emit_ib(batch->gmem, batch->draw);
+ ctx->screen->emit_ib(batch->gmem, batch->draw);
fd_reset_wfi(batch);
if (ctx->emit_sysmem_fini)
void (*emit_const_bo)(struct fd_ringbuffer *ring, gl_shader_stage type, boolean write,
uint32_t regid, uint32_t num, struct pipe_resource **prscs, uint32_t *offsets);
+ /* indirect-branch emit: */
+ void (*emit_ib)(struct fd_ringbuffer *ring, struct fd_ringbuffer *target);
+
+ /* simple gpu "memcpy": */
+ void (*mem_to_mem)(struct fd_ringbuffer *ring, struct pipe_resource *dst,
+ unsigned dst_off, struct pipe_resource *src, unsigned src_off,
+ unsigned sizedwords);
+
int64_t cpu_gpu_time_delta;
struct fd_batch_cache batch_cache;
}
/* copy index_bias or start from draw params: */
- ctx->mem_to_mem(ring, vertex_params_rsc, 0,
+ ctx->screen->mem_to_mem(ring, vertex_params_rsc, 0,
indirect->buffer, src_off, 1);
emit_const(ctx, ring, v, offset * 4, 0,
0x1000);
indirect_offset = 0;
- ctx->mem_to_mem(ring, indirect, 0, info->indirect,
+ ctx->screen->mem_to_mem(ring, indirect, 0, info->indirect,
info->indirect_offset, 3);
} else {
pipe_resource_reference(&indirect, info->indirect);