From: Dave Airlie Date: Tue, 27 Aug 2019 04:28:37 +0000 (+1000) Subject: llvmpipe: add initial compute state structs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3879f69b503dbea62342ba37e7a475e3fdbf09cf;p=mesa.git llvmpipe: add initial compute state structs These mirror the fragment shader structs, this is just a framework. Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index c60fe9c7ad5..bfdf41570ff 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -152,6 +152,7 @@ llvmpipe_create_context(struct pipe_screen *screen, void *priv, make_empty_list(&llvmpipe->setup_variants_list); + make_empty_list(&llvmpipe->cs_variants_list); llvmpipe->pipe.screen = screen; llvmpipe->pipe.priv = priv; diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index b82cb880e43..f1c2d40f9eb 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -49,6 +49,7 @@ struct draw_context; struct draw_stage; struct draw_vertex_shader; struct lp_fragment_shader; +struct lp_compute_shader; struct lp_blend_state; struct lp_setup_context; struct lp_setup_variant; @@ -66,6 +67,7 @@ struct llvmpipe_context { struct lp_fragment_shader *fs; struct draw_vertex_shader *vs; const struct lp_geometry_shader *gs; + struct lp_compute_shader *cs; const struct lp_velems_state *velems; const struct lp_so_state *so; @@ -150,6 +152,10 @@ struct llvmpipe_context { struct lp_setup_variant_list_item setup_variants_list; unsigned nr_setup_variants; + /** List of all compute shader variants */ + struct lp_cs_variant_list_item cs_variants_list; + unsigned nr_cs_variants; + unsigned nr_cs_instrs; struct lp_cs_context *csctx; /** Conditional query object and mode */ diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.h b/src/gallium/drivers/llvmpipe/lp_state_cs.h index c65cc165e38..b2a00a06011 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.h +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.h @@ -30,8 +30,41 @@ #include "util/u_thread.h" #include "pipe/p_state.h" +struct lp_compute_shader_variant; + +struct lp_compute_shader_variant_key +{ +}; + +struct lp_cs_variant_list_item +{ + struct lp_compute_shader_variant *base; + struct lp_cs_variant_list_item *next, *prev; +}; + +struct lp_compute_shader_variant +{ + struct lp_compute_shader_variant_key key; + + struct gallivm_state *gallivm; +}; + +struct lp_compute_shader { + struct pipe_shader_state base; + + struct lp_cs_variant_list_item variants; +}; + +struct lp_cs_exec { + struct lp_compute_shader_variant *variant; +}; + struct lp_cs_context { struct pipe_context *pipe; + + struct { + struct lp_cs_exec current; + } cs; }; struct lp_cs_context *lp_csctx_create(struct pipe_context *pipe);