panfrost: Derive texture/sampler_count from shader
[mesa.git] / src / gallium / drivers / panfrost / pan_context.h
index 5e0bce31e1d5137c7d79ad7d9d5b41a8cd36de7d..8fb6c3a3ad14b4b0cd18f7083d8a06c482142a9a 100644 (file)
@@ -185,10 +185,10 @@ struct panfrost_shader_state {
         bool compiled;
 
         /* Non-descript information */
-        int uniform_count;
-        unsigned uniform_cutoff;
+        unsigned uniform_count;
         unsigned work_reg_count;
         unsigned attribute_count;
+        unsigned texture_count;
         bool can_discard;
         bool writes_point_size;
         bool writes_depth;
@@ -222,7 +222,9 @@ struct panfrost_shader_state {
         /* Should we enable helper invocations */
         bool helper_invocations;
 
-        unsigned first_tag;
+        /* Pointer to GPU-executable memory formatted for the hardware. bo->gpu
+         * on Bifrost, bo->gpu | initial_tag on Midgard */
+        mali_ptr shader;
         struct panfrost_bo *bo;
 
         BITSET_WORD outputs_read;
@@ -254,7 +256,7 @@ struct panfrost_vertex_state {
         unsigned num_elements;
 
         struct pipe_vertex_element pipe[PIPE_MAX_ATTRIBS];
-        struct mali_attr_meta hw[PIPE_MAX_ATTRIBS];
+        unsigned formats[PIPE_MAX_ATTRIBS];
 };
 
 struct panfrost_zsa_state {
@@ -269,8 +271,7 @@ struct panfrost_zsa_state {
 
 struct panfrost_sampler_state {
         struct pipe_sampler_state base;
-        struct mali_sampler_descriptor midgard_hw;
-        struct bifrost_sampler_descriptor bifrost_hw;
+        struct mali_midgard_sampler_packed hw;
 };
 
 /* Misnomer: Sampler view corresponds to textures, not samplers */
@@ -278,7 +279,7 @@ struct panfrost_sampler_state {
 struct panfrost_sampler_view {
         struct pipe_sampler_view base;
         struct panfrost_bo *bo;
-        struct bifrost_texture_descriptor *bifrost_descriptor;
+        struct mali_bifrost_texture_packed bifrost_descriptor;
         mali_ptr texture_bo;
         uint64_t modifier;
 };
@@ -304,16 +305,9 @@ panfrost_get_shader_state(struct panfrost_context *ctx,
 struct pipe_context *
 panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags);
 
-void
-panfrost_invalidate_frame(struct panfrost_context *ctx);
-
 bool
 panfrost_writes_point_size(struct panfrost_context *ctx);
 
-void
-panfrost_vertex_state_upd_attr_offs(struct panfrost_context *ctx,
-                                    struct mali_vertex_tiler_postfix *vertex_postfix);
-
 struct panfrost_transfer
 panfrost_vertex_tiler_job(struct panfrost_context *ctx, bool is_tiler);