nir: Add nir_foreach_shader_in/out_variable helpers
[mesa.git] / src / gallium / drivers / lima / lima_context.h
index 53a0086fff1f110000e76e3bd353d8bbaeaab9a4..f74554e812c4dc1ce7e80c93ef5a761d739d6ddd 100644 (file)
@@ -25,6 +25,7 @@
 #ifndef H_LIMA_CONTEXT
 #define H_LIMA_CONTEXT
 
+#include "util/list.h"
 #include "util/slab.h"
 
 #include "pipe/p_context.h"
@@ -43,9 +44,11 @@ struct lima_depth_stencil_alpha_state {
 };
 
 struct lima_fs_shader_state {
+   struct pipe_shader_state base;
    void *shader;
    int shader_size;
    int stack_size;
+   uint8_t swizzles[PIPE_MAX_SAMPLERS][4];
    bool uses_discard;
    struct lima_bo *bo;
 };
@@ -138,16 +141,19 @@ struct lima_texture_stateobj {
 };
 
 struct lima_ctx_plb_pp_stream_key {
-   uint32_t plb_index;
-   uint32_t tiled_w;
-   uint32_t tiled_h;
+   uint16_t plb_index;
+   /* Coordinates are in tiles */
+   uint16_t minx, miny, maxx, maxy;
+   /* FB params */
+   uint16_t shift_w, shift_h;
+   uint16_t block_w, block_h;
 };
 
 struct lima_ctx_plb_pp_stream {
+   struct list_head lru_list;
    struct lima_ctx_plb_pp_stream_key key;
-   uint32_t refcnt;
    struct lima_bo *bo;
-   uint32_t offset[4];
+   uint32_t offset[8];
 };
 
 struct lima_pp_stream_state {
@@ -185,6 +191,7 @@ struct lima_context {
    struct lima_context_framebuffer framebuffer;
    struct lima_context_viewport_state viewport;
    struct pipe_scissor_state scissor;
+   struct pipe_scissor_state clipped_scissor;
    struct lima_vs_shader_state *vs;
    struct lima_fs_shader_state *fs;
    struct lima_vertex_element_state *vertex_elements;
@@ -217,18 +224,20 @@ struct lima_context {
    uint32_t gp_output_point_size_offt;
 
    struct hash_table *plb_pp_stream;
+   struct list_head plb_pp_stream_lru_list;
    uint32_t plb_index;
+   size_t plb_stream_cache_size;
 
    struct lima_ctx_buff_state buffer_state[lima_ctx_buff_num];
 
-   /* current submit */
-   struct lima_submit *submit;
+   /* current job */
+   struct lima_job *job;
 
-   /* map from lima_submit_key to lima_submit */
-   struct hash_table *submits;
+   /* map from lima_job_key to lima_job */
+   struct hash_table *jobs;
 
-   /* map from pipe_resource to lima_submit which write to it */
-   struct hash_table *write_submits;
+   /* map from pipe_resource to lima_job which write to it */
+   struct hash_table *write_jobs;
 
    int in_sync_fd;
    uint32_t in_sync[2];
@@ -283,9 +292,9 @@ struct pipe_context *
 lima_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags);
 
 void lima_flush(struct lima_context *ctx);
-void lima_flush_submit_accessing_bo(
+void lima_flush_job_accessing_bo(
    struct lima_context *ctx, struct lima_bo *bo, bool write);
-void lima_flush_previous_submit_writing_resource(
+void lima_flush_previous_job_writing_resource(
    struct lima_context *ctx, struct pipe_resource *prsc);
 
 #endif