swrast: use ASSIGN_4V() macro
[mesa.git] / src / mesa / swrast / s_context.h
index aebc80c2080ea10645943e465cda1688b7e6a956..cdd6fa5048d6df2b3968323e20ef29c26b21f6e9 100644 (file)
@@ -136,10 +136,6 @@ typedef struct
    GLboolean _DeferredTexture;
    GLenum _FogMode;  /* either GL_FOG_MODE or fragment program's fog mode */
 
-   /** Multiple render targets */
-   GLbitfield _ColorOutputsMask;
-   GLuint _NumColorOutputs;
-
    /** List/array of the fragment attributes to interpolate */
    GLuint _ActiveAttribs[FRAG_ATTRIB_MAX];
    /** Same info, but as a bitmask */
@@ -210,6 +206,7 @@ typedef struct
     * on some systems.
     */
    SWspanarrays *SpanArrays;
+   SWspanarrays *ZoomedArrays;  /**< For pixel zooming */
 
    /**
     * Used to buffer N GL_POINTS, instead of rendering one by one.
@@ -241,21 +238,43 @@ extern void
 _swrast_update_texture_samplers(GLcontext *ctx);
 
 
-#define SWRAST_CONTEXT(ctx) ((SWcontext *)ctx->swrast_context)
+/** Return SWcontext for the given GLcontext */
+static INLINE SWcontext *
+SWRAST_CONTEXT(GLcontext *ctx)
+{
+   return (SWcontext *) ctx->swrast_context;
+}
+
+/** const version of above */
+static INLINE const SWcontext *
+CONST_SWRAST_CONTEXT(const GLcontext *ctx)
+{
+   return (const SWcontext *) ctx->swrast_context;
+}
+
+
+/**
+ * Called prior to framebuffer reading/writing.
+ * For drivers that rely on swrast for fallback rendering, this is the
+ * driver's opportunity to map renderbuffers and textures.
+ */
+static INLINE void
+swrast_render_start(GLcontext *ctx)
+{
+   SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   if (swrast->Driver.SpanRenderStart)
+      swrast->Driver.SpanRenderStart(ctx);
+}
 
-#define RENDER_START(SWctx, GLctx)                     \
-   do {                                                        \
-      if ((SWctx)->Driver.SpanRenderStart) {           \
-         (*(SWctx)->Driver.SpanRenderStart)(GLctx);    \
-      }                                                        \
-   } while (0)
 
-#define RENDER_FINISH(SWctx, GLctx)                    \
-   do {                                                        \
-      if ((SWctx)->Driver.SpanRenderFinish) {          \
-         (*(SWctx)->Driver.SpanRenderFinish)(GLctx);   \
-      }                                                        \
-   } while (0)
+/** Called after framebuffer reading/writing */
+static INLINE void
+swrast_render_finish(GLcontext *ctx)
+{
+   SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   if (swrast->Driver.SpanRenderFinish)
+      swrast->Driver.SpanRenderFinish(ctx);
+}