summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-02-03 18:08:01 +0100
committerSamuel Pitoiset <[email protected]>2016-02-13 16:01:00 +0100
commit44e04dc809659323ae0b5e32b97fcfccc5db66f1 (patch)
tree4cbc5ba9fb2f5c5ffea56b377aa993de91809037 /src/mesa/state_tracker/st_program.c
parent7c79c1e3e25857a45150f6a0bf2e813fed074a6c (diff)
st/mesa: add conversion for compute shaders
According to the spec, there are no predefined inputs nor any fixed-function outputs. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 16627ac7834..2e21d02b8b5 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1428,7 +1428,24 @@ bool
st_translate_compute_program(struct st_context *st,
struct st_compute_program *stcp)
{
- return false; /* will be updated in the next commit */
+ struct ureg_program *ureg;
+ struct pipe_shader_state prog;
+
+ ureg = ureg_create_with_screen(TGSI_PROCESSOR_COMPUTE, st->pipe->screen);
+ if (ureg == NULL)
+ return false;
+
+ st_translate_program_common(st, &stcp->Base.Base, stcp->glsl_to_tgsi, ureg,
+ TGSI_PROCESSOR_COMPUTE, &prog);
+
+ stcp->tgsi.prog = prog.tokens;
+ stcp->tgsi.req_local_mem = stcp->Base.SharedSize;
+ stcp->tgsi.req_private_mem = 0;
+ stcp->tgsi.req_input_mem = 0;
+
+ free_glsl_to_tgsi_visitor(stcp->glsl_to_tgsi);
+ stcp->glsl_to_tgsi = NULL;
+ return true;
}