#define NUM_USER_SGPRS 4
#endif
-struct si_pipe_compute {
+struct si_compute {
struct si_context *ctx;
unsigned local_size;
const struct pipe_compute_state *cso)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_compute *program =
- CALLOC_STRUCT(si_pipe_compute);
+ struct si_compute *program = CALLOC_STRUCT(si_compute);
const struct pipe_llvm_program_header *header;
const unsigned char *code;
unsigned i;
static void si_bind_compute_state(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context*)ctx;
- sctx->cs_shader_state.program = (struct si_pipe_compute*)state;
+ sctx->cs_shader_state.program = (struct si_compute*)state;
}
static void si_set_global_binding(
{
unsigned i;
struct si_context *sctx = (struct si_context*)ctx;
- struct si_pipe_compute *program = sctx->cs_shader_state.program;
+ struct si_compute *program = sctx->cs_shader_state.program;
if (!resources) {
for (i = first; i < first + n; i++) {
uint32_t pc, const void *input)
{
struct si_context *sctx = (struct si_context*)ctx;
- struct si_pipe_compute *program = sctx->cs_shader_state.program;
+ struct si_compute *program = sctx->cs_shader_state.program;
struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
struct r600_resource *input_buffer = program->input_buffer;
unsigned kernel_args_size;
static void si_delete_compute_state(struct pipe_context *ctx, void* state){
- struct si_pipe_compute *program = (struct si_pipe_compute *)state;
+ struct si_compute *program = (struct si_compute *)state;
if (!state) {
return;
if (program->kernels) {
for (int i = 0; i < program->num_kernels; i++){
if (program->kernels[i].bo){
- si_pipe_shader_destroy(ctx, &program->kernels[i]);
+ si_shader_destroy(ctx, &program->kernels[i]);
}
}
FREE(program->kernels);
/* Add relocations to the CS. */
while (mask) {
int i = u_bit_scan(&mask);
- struct si_pipe_sampler_view *rview =
- (struct si_pipe_sampler_view*)views->views[i];
+ struct si_sampler_view *rview =
+ (struct si_sampler_view*)views->views[i];
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
rview->resource, RADEON_USAGE_READ,
return;
if (view) {
- struct si_pipe_sampler_view *rview =
- (struct si_pipe_sampler_view*)view;
+ struct si_sampler_view *rview =
+ (struct si_sampler_view*)view;
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
rview->resource, RADEON_USAGE_READ,
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_textures_info *samplers = &sctx->samplers[shader];
- struct si_pipe_sampler_view **rviews = (struct si_pipe_sampler_view **)views;
+ struct si_sampler_view **rviews = (struct si_sampler_view **)views;
int i;
if (!count || shader >= SI_NUM_SHADERS)
unsigned start, unsigned count, void **states)
{
struct si_sampler_states *samplers = &sctx->samplers[shader].states;
- struct si_pipe_sampler_state **sstates = (struct si_pipe_sampler_state**)states;
+ struct si_sampler_state **sstates = (struct si_sampler_state**)states;
int i;
if (start == 0)
uint64_t old_va = rbuffer->gpu_address;
unsigned num_elems = sctx->vertex_elements ?
sctx->vertex_elements->count : 0;
- struct si_pipe_sampler_view *view;
+ struct si_sampler_view *view;
/* Reallocate the buffer in the same pipe_resource. */
r600_init_resource(&sctx->screen->b, rbuffer, rbuffer->b.b.width0,
#define SI_MAX_DRAW_CS_DWORDS 18
-struct si_pipe_compute;
+struct si_compute;
struct si_screen {
struct r600_common_screen b;
};
-struct si_pipe_sampler_view {
+struct si_sampler_view {
struct pipe_sampler_view base;
struct list_head list;
struct r600_resource *resource;
uint32_t fmask_state[8];
};
-struct si_pipe_sampler_state {
+struct si_sampler_state {
uint32_t val[4];
uint32_t border_color[4];
};
struct si_cs_shader_state {
- struct si_pipe_compute *program;
+ struct si_compute *program;
};
struct si_textures_info {
unsigned pa_su_sc_mode_cntl;
/* for saving when using blitter */
struct pipe_stencil_ref stencil_ref;
- struct si_pipe_shader_selector *ps_shader;
- struct si_pipe_shader_selector *gs_shader;
- struct si_pipe_shader_selector *vs_shader;
+ /* shaders */
+ struct si_shader_selector *ps_shader;
+ struct si_shader_selector *gs_shader;
+ struct si_shader_selector *vs_shader;
struct si_cs_shader_state cs_shader_state;
/* shader information */
unsigned sprite_coord_enable;
return r;
}
-int si_pipe_shader_create(
+int si_shader_create(
struct pipe_context *ctx,
struct si_shader *shader)
{
struct si_context *sctx = (struct si_context*)ctx;
- struct si_pipe_shader_selector *sel = shader->selector;
+ struct si_shader_selector *sel = shader->selector;
struct si_shader_context si_shader_ctx;
struct tgsi_shader_info shader_info;
struct lp_build_tgsi_context * bld_base;
return r;
}
-void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_shader *shader)
+void si_shader_destroy(struct pipe_context *ctx, struct si_shader *shader)
{
r600_resource_reference(&shader->bo, NULL);
}
struct si_shader;
-struct si_pipe_shader_selector {
+struct si_shader_selector {
struct si_shader *current;
struct tgsi_token *tokens;
};
struct si_shader {
- struct si_pipe_shader_selector *selector;
+ struct si_shader_selector *selector;
struct si_shader *next_variant;
struct si_shader *gs_copy_shader;
}
/* radeonsi_shader.c */
-int si_pipe_shader_create(struct pipe_context *ctx, struct si_shader *shader);
-int si_pipe_shader_create(struct pipe_context *ctx, struct si_shader *shader);
+int si_shader_create(struct pipe_context *ctx, struct si_shader *shader);
+int si_shader_create(struct pipe_context *ctx, struct si_shader *shader);
int si_compile_llvm(struct si_context *sctx, struct si_shader *shader,
LLVMModuleRef mod);
-void si_pipe_shader_destroy(struct pipe_context *ctx, struct si_shader *shader);
+void si_shader_destroy(struct pipe_context *ctx, struct si_shader *shader);
#endif
/* Compute the key for the hw shader variant */
static INLINE void si_shader_selector_key(struct pipe_context *ctx,
- struct si_pipe_shader_selector *sel,
+ struct si_shader_selector *sel,
union si_shader_key *key)
{
struct si_context *sctx = (struct si_context *)ctx;
/* Select the hw shader variant depending on the current state. */
int si_shader_select(struct pipe_context *ctx,
- struct si_pipe_shader_selector *sel)
+ struct si_shader_selector *sel)
{
union si_shader_key key;
struct si_shader * shader = NULL;
shader->next_variant = sel->current;
sel->current = shader;
- r = si_pipe_shader_create(ctx, shader);
+ r = si_shader_create(ctx, shader);
if (unlikely(r)) {
R600_ERR("Failed to build shader variant (type=%u) %d\n",
sel->type, r);
const struct pipe_shader_state *state,
unsigned pipe_shader_type)
{
- struct si_pipe_shader_selector *sel = CALLOC_STRUCT(si_pipe_shader_selector);
+ struct si_shader_selector *sel = CALLOC_STRUCT(si_shader_selector);
int r;
sel->type = pipe_shader_type;
static void si_bind_vs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = state;
+ struct si_shader_selector *sel = state;
if (sctx->vs_shader == sel)
return;
static void si_bind_gs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = state;
+ struct si_shader_selector *sel = state;
if (sctx->gs_shader == sel)
return;
static void si_bind_ps_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = state;
+ struct si_shader_selector *sel = state;
/* skip if supplied shader is one already in use */
if (sctx->ps_shader == sel)
}
static void si_delete_shader_selector(struct pipe_context *ctx,
- struct si_pipe_shader_selector *sel)
+ struct si_shader_selector *sel)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_shader *p = sel->current, *c;
si_pm4_delete_state(sctx, es, p->pm4);
else
si_pm4_delete_state(sctx, vs, p->pm4);
- si_pipe_shader_destroy(ctx, p);
+ si_shader_destroy(ctx, p);
free(p);
p = c;
}
static void si_delete_vs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = (struct si_pipe_shader_selector *)state;
+ struct si_shader_selector *sel = (struct si_shader_selector *)state;
if (sctx->vs_shader == sel) {
sctx->vs_shader = NULL;
static void si_delete_gs_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = (struct si_pipe_shader_selector *)state;
+ struct si_shader_selector *sel = (struct si_shader_selector *)state;
if (sctx->gs_shader == sel) {
sctx->gs_shader = NULL;
static void si_delete_ps_shader(struct pipe_context *ctx, void *state)
{
struct si_context *sctx = (struct si_context *)ctx;
- struct si_pipe_shader_selector *sel = (struct si_pipe_shader_selector *)state;
+ struct si_shader_selector *sel = (struct si_shader_selector *)state;
if (sctx->ps_shader == sel) {
sctx->ps_shader = NULL;
const struct pipe_sampler_view *state)
{
struct si_context *sctx = (struct si_context*)ctx;
- struct si_pipe_sampler_view *view = CALLOC_STRUCT(si_pipe_sampler_view);
+ struct si_sampler_view *view = CALLOC_STRUCT(si_sampler_view);
struct r600_texture *tmp = (struct r600_texture*)texture;
const struct util_format_description *desc;
unsigned format, num_format;
static void si_sampler_view_destroy(struct pipe_context *ctx,
struct pipe_sampler_view *state)
{
- struct si_pipe_sampler_view *view = (struct si_pipe_sampler_view *)state;
+ struct si_sampler_view *view = (struct si_sampler_view *)state;
if (view->resource->b.b.target == PIPE_BUFFER)
LIST_DELINIT(&view->list);
static void *si_create_sampler_state(struct pipe_context *ctx,
const struct pipe_sampler_state *state)
{
- struct si_pipe_sampler_state *rstate = CALLOC_STRUCT(si_pipe_sampler_state);
+ struct si_sampler_state *rstate = CALLOC_STRUCT(si_sampler_state);
unsigned aniso_flag_offset = state->max_anisotropy > 1 ? 2 : 0;
unsigned border_color_type;
static void si_set_border_colors(struct si_context *sctx, unsigned count,
void **states)
{
- struct si_pipe_sampler_state **rstates = (struct si_pipe_sampler_state **)states;
+ struct si_sampler_state **rstates = (struct si_sampler_state **)states;
uint32_t *border_color_table = NULL;
int i, j;
const uint8_t *ptr, unsigned size, uint32_t *const_offset);
/* si_state.c */
-struct si_pipe_shader_selector;
+struct si_shader_selector;
boolean si_is_format_supported(struct pipe_screen *screen,
enum pipe_format format,
unsigned sample_count,
unsigned usage);
int si_shader_select(struct pipe_context *ctx,
- struct si_pipe_shader_selector *sel);
+ struct si_shader_selector *sel);
void si_init_state_functions(struct si_context *sctx);
void si_init_config(struct si_context *sctx);
unsigned cik_bank_wh(unsigned bankwh);
* Shaders
*/
-static void si_pipe_shader_es(struct pipe_context *ctx, struct si_shader *shader)
+static void si_shader_es(struct pipe_context *ctx, struct si_shader *shader)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_pm4_state *pm4;
sctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE;
}
-static void si_pipe_shader_gs(struct pipe_context *ctx, struct si_shader *shader)
+static void si_shader_gs(struct pipe_context *ctx, struct si_shader *shader)
{
struct si_context *sctx = (struct si_context *)ctx;
unsigned gs_vert_itemsize = shader->noutput * (16 >> 2);
sctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE;
}
-static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_shader *shader)
+static void si_shader_vs(struct pipe_context *ctx, struct si_shader *shader)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_pm4_state *pm4;
sctx->b.flags |= R600_CONTEXT_INV_SHADER_CACHE;
}
-static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_shader *shader)
+static void si_shader_ps(struct pipe_context *ctx, struct si_shader *shader)
{
struct si_context *sctx = (struct si_context *)ctx;
struct si_pm4_state *pm4;
si_shader_select(ctx, sctx->gs_shader);
if (!sctx->gs_shader->current->pm4) {
- si_pipe_shader_gs(ctx, sctx->gs_shader->current);
- si_pipe_shader_vs(ctx,
- sctx->gs_shader->current->gs_copy_shader);
+ si_shader_gs(ctx, sctx->gs_shader->current);
+ si_shader_vs(ctx, sctx->gs_shader->current->gs_copy_shader);
}
si_pm4_bind_state(sctx, gs, sctx->gs_shader->current->pm4);
si_shader_select(ctx, sctx->vs_shader);
if (!sctx->vs_shader->current->pm4)
- si_pipe_shader_es(ctx, sctx->vs_shader->current);
+ si_shader_es(ctx, sctx->vs_shader->current);
si_pm4_bind_state(sctx, es, sctx->vs_shader->current->pm4);
si_shader_select(ctx, sctx->vs_shader);
if (!sctx->vs_shader->current->pm4)
- si_pipe_shader_vs(ctx, sctx->vs_shader->current);
+ si_shader_vs(ctx, sctx->vs_shader->current);
si_pm4_bind_state(sctx, vs, sctx->vs_shader->current->pm4);
si_shader_select(ctx, sctx->ps_shader);
if (!sctx->ps_shader->current->pm4)
- si_pipe_shader_ps(ctx, sctx->ps_shader->current);
+ si_shader_ps(ctx, sctx->ps_shader->current);
si_pm4_bind_state(sctx, ps, sctx->ps_shader->current->pm4);