llvmpipe: add initial compute state structs
authorDave Airlie <airlied@redhat.com>
Tue, 27 Aug 2019 04:28:37 +0000 (14:28 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Sep 2019 05:22:20 +0000 (15:22 +1000)
These mirror the fragment shader structs, this is just a framework.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_state_cs.h

index c60fe9c..bfdf415 100644 (file)
@@ -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;
index b82cb88..f1c2d40 100644 (file)
@@ -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 */
index c65cc16..b2a00a0 100644 (file)
 #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);