diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-11-22 02:46:45 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2015-11-22 02:46:45 +0000 |
commit | 3e40341f9dcd7c1bbc9afb8ddb812304820396cf (patch) | |
tree | 274b3f522afe1da16ab2b5347758c908bc23fac4 /lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c | |
parent | 7b644ad52b574bec410d557155d666ac17fdf51a (diff) |
import Mesa 11.0.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c')
-rw-r--r-- | lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c | 64 |
1 files changed, 5 insertions, 59 deletions
diff --git a/lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c b/lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c index da4792757..8ab2903dc 100644 --- a/lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c +++ b/lib/mesa/src/gallium/drivers/softpipe/sp_state_shader.c @@ -64,8 +64,7 @@ create_fs_variant(struct softpipe_context *softpipe, /* get new shader that implements polygon stippling */ var->tokens = util_pstipple_create_fragment_shader(curfs->tokens, - &var->stipple_sampler_unit, 0, - TGSI_FILE_INPUT); + &var->stipple_sampler_unit, 0); } else #endif @@ -208,7 +207,7 @@ softpipe_create_vs_state(struct pipe_context *pipe, struct sp_vertex_shader *state; state = CALLOC_STRUCT(sp_vertex_shader); - if (!state) + if (state == NULL ) goto fail; /* copy shader tokens, the ones passed in will go away. @@ -270,7 +269,7 @@ softpipe_create_gs_state(struct pipe_context *pipe, struct sp_geometry_shader *state; state = CALLOC_STRUCT(sp_geometry_shader); - if (!state) + if (state == NULL ) goto fail; state->shader = *templ; @@ -337,8 +336,8 @@ softpipe_delete_gs_state(struct pipe_context *pipe, void *gs) static void softpipe_set_constant_buffer(struct pipe_context *pipe, - enum pipe_shader_type shader, uint index, - const struct pipe_constant_buffer *cb) + uint shader, uint index, + struct pipe_constant_buffer *cb) { struct softpipe_context *softpipe = softpipe_context(pipe); struct pipe_resource *constants = cb ? cb->buffer : NULL; @@ -378,55 +377,6 @@ softpipe_set_constant_buffer(struct pipe_context *pipe, } } -static void * -softpipe_create_compute_state(struct pipe_context *pipe, - const struct pipe_compute_state *templ) -{ - struct softpipe_context *softpipe = softpipe_context(pipe); - const struct tgsi_token *tokens; - struct sp_compute_shader *state; - if (templ->ir_type != PIPE_SHADER_IR_TGSI) - return NULL; - - tokens = templ->prog; - /* debug */ - if (softpipe->dump_cs) - tgsi_dump(tokens, 0); - - state = CALLOC_STRUCT(sp_compute_shader); - - state->shader = *templ; - state->tokens = tgsi_dup_tokens(tokens); - tgsi_scan_shader(state->tokens, &state->info); - - state->max_sampler = state->info.file_max[TGSI_FILE_SAMPLER]; - - return state; -} - -static void -softpipe_bind_compute_state(struct pipe_context *pipe, - void *cs) -{ - struct softpipe_context *softpipe = softpipe_context(pipe); - struct sp_compute_shader *state = (struct sp_compute_shader *)cs; - if (softpipe->cs == state) - return; - - softpipe->cs = state; -} - -static void -softpipe_delete_compute_state(struct pipe_context *pipe, - void *cs) -{ - MAYBE_UNUSED struct softpipe_context *softpipe = softpipe_context(pipe); - struct sp_compute_shader *state = (struct sp_compute_shader *)cs; - - assert(softpipe->cs != state); - tgsi_free_tokens(state->tokens); - FREE(state); -} void softpipe_init_shader_funcs(struct pipe_context *pipe) @@ -444,8 +394,4 @@ softpipe_init_shader_funcs(struct pipe_context *pipe) pipe->delete_gs_state = softpipe_delete_gs_state; pipe->set_constant_buffer = softpipe_set_constant_buffer; - - pipe->create_compute_state = softpipe_create_compute_state; - pipe->bind_compute_state = softpipe_bind_compute_state; - pipe->delete_compute_state = softpipe_delete_compute_state; } |