nv50,nvc0: get rid of draw module support
[mesa.git] / src / gallium / drivers / nouveau / nv50 / nv50_context.h
index ee6eb0ef71555ccfafdb3d04b746351e67df4e02..9557317af9f62a911ca91878817b437cd0b1cec7 100644 (file)
 #include "util/u_inlines.h"
 #include "util/u_dynarray.h"
 
-#ifdef NV50_WITH_DRAW_MODULE
-#include "draw/draw_vertex.h"
-#endif
-
-#include "nv50/nv50_debug.h"
 #include "nv50/nv50_winsys.h"
 #include "nv50/nv50_stateobj.h"
 #include "nv50/nv50_screen.h"
@@ -23,6 +18,7 @@
 #include "nv50/nv50_transfer.h"
 
 #include "nouveau_context.h"
+#include "nouveau_debug.h"
 #include "nv_object.xml.h"
 #include "nv_m2mf.xml.h"
 #include "nv50/nv50_3ddefs.xml.h"
@@ -49,6 +45,7 @@
 #define NV50_NEW_TEXTURES     (1 << 19)
 #define NV50_NEW_SAMPLERS     (1 << 20)
 #define NV50_NEW_STRMOUT      (1 << 21)
+#define NV50_NEW_MIN_SAMPLES  (1 << 22)
 #define NV50_NEW_CONTEXT      (1 << 31)
 
 #define NV50_BIND_FB          0
 #define NV50_CB_PVP 124
 #define NV50_CB_PGP 126
 #define NV50_CB_PFP 125
+/* constant buffer permanently mapped in as c15[] */
 #define NV50_CB_AUX 127
+/* size of the buffer: 64k. not all taken up, can be reduced if needed. */
+#define NV50_CB_AUX_SIZE          (1 << 16)
+/* 8 user clip planes, at 4 32-bit floats each */
+#define NV50_CB_AUX_UCP_OFFSET    0x0000
+#define NV50_CB_AUX_UCP_SIZE      (8 * 4 * 4)
+/* 16 textures * 3 shaders, each with ms_x, ms_y u32 pairs */
+#define NV50_CB_AUX_TEX_MS_OFFSET 0x0080
+#define NV50_CB_AUX_TEX_MS_SIZE   (16 * 3 * 2 * 4)
+/* For each MS level (4), 8 sets of 32-bit integer pairs sample offsets */
+#define NV50_CB_AUX_MS_OFFSET     0x200
+#define NV50_CB_AUX_MS_SIZE       (4 * 8 * 4 * 2)
+/* Sample position pairs for the current output MS level */
+#define NV50_CB_AUX_SAMPLE_OFFSET 0x300
+#define NV50_CB_AUX_SAMPLE_OFFSET_SIZE (4 * 8 * 2)
+/* next spot: 0x340 */
+/* 4 32-bit floats for the vertex runout, put at the end */
+#define NV50_CB_AUX_RUNOUT_OFFSET (NV50_CB_AUX_SIZE - 0x10)
+
 
 
 struct nv50_blitctx;
@@ -86,6 +102,7 @@ struct nv50_context {
    struct nouveau_bufctx *bufctx;
 
    uint32_t dirty;
+   boolean cb_dirty;
 
    struct {
       uint32_t instance_elts; /* bitmask of per-instance elements */
@@ -147,23 +164,24 @@ struct nv50_context {
    struct pipe_blend_color blend_colour;
    struct pipe_stencil_ref stencil_ref;
    struct pipe_poly_stipple stipple;
-   struct pipe_scissor_state scissor;
-   struct pipe_viewport_state viewport;
+   struct pipe_scissor_state scissors[NV50_MAX_VIEWPORTS];
+   unsigned scissors_dirty;
+   struct pipe_viewport_state viewports[NV50_MAX_VIEWPORTS];
+   unsigned viewports_dirty;
    struct pipe_clip_state clip;
 
    unsigned sample_mask;
+   unsigned min_samples;
 
    boolean vbo_push_hint;
 
+   uint32_t rt_array_mode;
+
    struct pipe_query *cond_query;
    boolean cond_cond;
    uint cond_mode;
 
    struct nv50_blitctx *blit;
-
-#ifdef NV50_WITH_DRAW_MODULE
-   struct draw_context *draw;
-#endif
 };
 
 static INLINE struct nv50_context *
@@ -241,6 +259,7 @@ extern void nv50_init_surface_functions(struct nv50_context *);
 /* nv50_tex.c */
 void nv50_validate_textures(struct nv50_context *);
 void nv50_validate_samplers(struct nv50_context *);
+void nv50_upload_ms_info(struct nouveau_pushbuf *);
 
 struct pipe_sampler_view *
 nv50_create_texture_view(struct pipe_context *,