void eg_dump_debug_state(struct pipe_context *ctx, FILE *f,
unsigned flags);
+struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_context *ctx,
+ const struct tgsi_token *tokens,
+ unsigned pipe_shader_type);
+int r600_shader_select(struct pipe_context *ctx,
+ struct r600_pipe_shader_selector* sel,
+ bool *dirty);
+
+void r600_delete_shader_selector(struct pipe_context *ctx,
+ struct r600_pipe_shader_selector *sel);
+
struct r600_shader_atomic;
bool evergreen_emit_atomic_buffer_setup(struct r600_context *rctx,
struct r600_pipe_shader *cs_shader,
/* Select the hw shader variant depending on the current state.
* (*dirty) is set to 1 if current variant was changed */
-static int r600_shader_select(struct pipe_context *ctx,
+int r600_shader_select(struct pipe_context *ctx,
struct r600_pipe_shader_selector* sel,
bool *dirty)
{
return 0;
}
+struct r600_pipe_shader_selector *r600_create_shader_state_tokens(struct pipe_context *ctx,
+ const struct tgsi_token *tokens,
+ unsigned pipe_shader_type)
+{
+ struct r600_pipe_shader_selector *sel = CALLOC_STRUCT(r600_pipe_shader_selector);
+ int i;
+
+ sel->type = pipe_shader_type;
+ sel->tokens = tgsi_dup_tokens(tokens);
+ tgsi_scan_shader(tokens, &sel->info);
+ return sel;
+}
+
static void *r600_create_shader_state(struct pipe_context *ctx,
const struct pipe_shader_state *state,
unsigned pipe_shader_type)
{
- struct r600_pipe_shader_selector *sel = CALLOC_STRUCT(r600_pipe_shader_selector);
int i;
+ struct r600_pipe_shader_selector *sel = r600_create_shader_state_tokens(ctx, state->tokens, pipe_shader_type);
- sel->type = pipe_shader_type;
- sel->tokens = tgsi_dup_tokens(state->tokens);
sel->so = state->stream_output;
- tgsi_scan_shader(state->tokens, &sel->info);
switch (pipe_shader_type) {
case PIPE_SHADER_GEOMETRY:
rctx->b.streamout.stride_in_dw = rctx->tes_shader->so.stride;
}
-static void r600_delete_shader_selector(struct pipe_context *ctx,
- struct r600_pipe_shader_selector *sel)
+void r600_delete_shader_selector(struct pipe_context *ctx,
+ struct r600_pipe_shader_selector *sel)
{
struct r600_pipe_shader *p = sel->current, *c;
while (p) {