fd5_delete_compute_state(struct pipe_context *pctx, void *hwcso)
{
struct fd5_compute_stateobj *so = hwcso;
- ir3_shader_destroy(so->shader);
+ ir3_shader_state_delete(pctx, so->shader);
free(so);
}
fd6_delete_compute_state(struct pipe_context *pctx, void *hwcso)
{
struct fd6_compute_stateobj *so = hwcso;
- ir3_shader_destroy(so->shader);
+ ir3_shader_state_delete(pctx, so->shader);
free(so);
}
static void *
fd6_shader_state_create(struct pipe_context *pctx, const struct pipe_shader_state *cso)
{
- struct fd_context *ctx = fd_context(pctx);
- struct ir3_compiler *compiler = ctx->screen->compiler;
- struct ir3_shader *shader =
- ir3_shader_create(compiler, cso, &ctx->debug, pctx->screen);
+ struct ir3_shader *shader = ir3_shader_state_create(pctx, cso);
unsigned packets, size;
/* pre-calculate size required for userconst stateobj: */
static void
fd6_shader_state_delete(struct pipe_context *pctx, void *hwcso)
{
- struct ir3_shader *so = hwcso;
struct fd_context *ctx = fd_context(pctx);
ir3_cache_invalidate(fd6_context(ctx)->shader_cache, hwcso);
- ir3_shader_destroy(so);
+ ir3_shader_state_delete(pctx, hwcso);
}
void
return shader;
}
-static void *
+void *
ir3_shader_state_create(struct pipe_context *pctx, const struct pipe_shader_state *cso)
{
struct fd_context *ctx = fd_context(pctx);
return ir3_shader_create(compiler, cso, &ctx->debug, pctx->screen);
}
-static void
+void
ir3_shader_state_delete(struct pipe_context *pctx, void *hwcso)
{
struct ir3_shader *so = hwcso;
struct ir3_shader_key key, bool binning_pass,
struct pipe_debug_callback *debug);
+void * ir3_shader_state_create(struct pipe_context *pctx, const struct pipe_shader_state *cso);
+void ir3_shader_state_delete(struct pipe_context *pctx, void *hwcso);
+
void ir3_prog_init(struct pipe_context *pctx);
#endif /* IR3_GALLIUM_H_ */