X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fswrast%2Fs_context.h;h=cdd6fa5048d6df2b3968323e20ef29c26b21f6e9;hb=88f3656ea7ae57d22141225db0c5d90ceab420dd;hp=c8333b8e0a116bdabd6e1c6187d77116d5f8bcf7;hpb=1bdee1853627e08894bd267b8f0ec176a1b5978f;p=mesa.git diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h index c8333b8e0a1..cdd6fa5048d 100644 --- a/src/mesa/swrast/s_context.h +++ b/src/mesa/swrast/s_context.h @@ -43,10 +43,10 @@ #ifndef S_CONTEXT_H #define S_CONTEXT_H -#include "mtypes.h" +#include "main/mtypes.h" +#include "shader/prog_execute.h" #include "swrast.h" #include "s_span.h" -#include "prog_execute.h" typedef void (*texture_sample_func)(GLcontext *ctx, @@ -128,20 +128,22 @@ typedef struct * _swrast_validate_derived(): */ GLbitfield _RasterMask; - GLfloat _BackfaceSign; + GLfloat _BackfaceSign; /** +1 or -1 */ + GLfloat _BackfaceCullSign; /** +1, 0, or -1 */ GLboolean _PreferPixelFog; /* Compute fog blend factor per fragment? */ GLboolean _AnyTextureCombine; GLboolean _FogEnabled; + 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 */ + GLbitfield _ActiveAttribMask; /** Number of fragment attributes to interpolate */ GLuint _NumActiveAttribs; + /** Indicates how each attrib is to be interpolated (lines/tris) */ + GLenum _InterpMode[FRAG_ATTRIB_MAX]; /* GL_FLAT or GL_SMOOTH (for now) */ /* Accum buffer temporaries. */ @@ -151,6 +153,7 @@ typedef struct /* Working values: */ GLuint StippleCounter; /**< Line stipple counter */ + GLuint PointLineFacing; GLbitfield NewState; GLuint StateChanges; GLenum Primitive; /* current primitive being drawn (ala glBegin) */ @@ -203,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. @@ -234,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); +}