aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-04-04 15:55:25 -0400
committerRob Clark <[email protected]>2017-05-04 13:48:06 -0400
commit5f7e55582eb7d4e2c791493a0d79b0d2b26c6b51 (patch)
tree1faf5922dfa63f5de70571659e25b3ee2e145a00 /src/mesa/state_tracker/st_program.c
parent53aa109ba2fd63e319012b8224099d0019243e63 (diff)
mesa/st: compute support for glsl_to_nir
Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 0dc3b1ea9bd..09e0d86601f 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -1798,6 +1798,19 @@ st_translate_compute_program(struct st_context *st,
struct ureg_program *ureg;
struct pipe_shader_state prog;
+ if (stcp->shader_program) {
+ nir_shader *nir = st_glsl_to_nir(st, &stcp->Base, stcp->shader_program,
+ MESA_SHADER_COMPUTE);
+
+ /* no compute variants: */
+ st_finalize_nir(st, &stcp->Base, nir);
+
+ stcp->tgsi.ir_type = PIPE_SHADER_IR_NIR;
+ stcp->tgsi.prog = nir;
+
+ return true;
+ }
+
ureg = ureg_create_with_screen(PIPE_SHADER_COMPUTE, st->pipe->screen);
if (ureg == NULL)
return false;