zink/spirv: support loading bool constants
[mesa.git] / src / gallium / drivers / swr / swr_context.h
index 233d95ab1675dd95049d4167e559d003f868d58e..55de8e04663df69719e0a92157f87dd3bf374110 100644 (file)
@@ -29,6 +29,8 @@
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 #include "util/u_blitter.h"
+#include "rasterizer/memory/SurfaceState.h"
+#include "rasterizer/memory/InitMemory.h"
 #include "jit_api.h"
 #include "swr_state.h"
 #include <unordered_map>
@@ -51,6 +53,7 @@
 #define SWR_NEW_FRAMEBUFFER (1 << 15)
 #define SWR_NEW_CLIP (1 << 16)
 #define SWR_NEW_SO (1 << 17)
+#define SWR_LARGE_CLIENT_DRAW (1<<18) // Indicates client draw will block
 
 namespace std
 {
@@ -98,8 +101,12 @@ struct swr_draw_context {
 
    float userClipPlanes[PIPE_MAX_CLIP_PLANES][4];
 
+   uint32_t polyStipple[32];
+
    SWR_SURFACE_STATE renderTargets[SWR_NUM_ATTACHMENTS];
-   void *pStats;
+   struct swr_query_result *pStats; // @llvm_struct
+   SWR_INTERFACE *pAPI; // @llvm_struct - Needed for the swr_memory callbacks
+   SWR_TILE_INTERFACE *pTileAPI; // @llvm_struct - Needed for the swr_memory callbacks
 };
 
 /* gen_llvm_types FINI */
@@ -127,22 +134,21 @@ struct swr_context {
    struct pipe_constant_buffer
       constants[PIPE_SHADER_TYPES][PIPE_MAX_CONSTANT_BUFFERS];
    struct pipe_framebuffer_state framebuffer;
-   struct pipe_poly_stipple poly_stipple;
-   struct pipe_scissor_state scissor;
-   SWR_RECT swr_scissor;
+   struct swr_poly_stipple poly_stipple;
+   struct pipe_scissor_state scissors[KNOB_NUM_VIEWPORTS_SCISSORS];
+   SWR_RECT swr_scissors[KNOB_NUM_VIEWPORTS_SCISSORS];
    struct pipe_sampler_view *
       sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
 
-   struct pipe_viewport_state viewport;
+   struct pipe_viewport_state viewports[KNOB_NUM_VIEWPORTS_SCISSORS];
    struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
-   struct pipe_index_buffer index_buffer;
 
    struct blitter_context *blitter;
 
    /** Conditional query object and mode */
    struct pipe_query *render_cond_query;
    enum pipe_render_cond_flag render_cond_mode;
-   boolean render_cond_cond;
+   bool render_cond_cond;
    unsigned active_queries;
 
    unsigned num_vertex_buffers;
@@ -168,6 +174,11 @@ struct swr_context {
    struct swr_draw_context swrDC;
 
    unsigned dirty; /**< Mask of SWR_NEW_x flags */
+
+   SWR_INTERFACE api;
+   SWR_TILE_INTERFACE tileApi;
+
+   uint32_t max_draws_in_flight;
 };
 
 static INLINE struct swr_context *
@@ -181,7 +192,7 @@ swr_update_draw_context(struct swr_context *ctx,
       struct swr_query_result *pqr = nullptr)
 {
    swr_draw_context *pDC =
-      (swr_draw_context *)SwrGetPrivateContextState(ctx->swrContext);
+      (swr_draw_context *)ctx->api.pfnSwrGetPrivateContextState(ctx->swrContext);
    if (pqr)
       ctx->swrDC.pStats = pqr;
    memcpy(pDC, &ctx->swrDC, sizeof(swr_draw_context));