mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
swrast: replace macro with inline function
This commit is contained in:
parent
bd944ef783
commit
81ca8b93f2
3 changed files with 17 additions and 4 deletions
|
|
@ -238,7 +238,20 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
#define RENDER_START(SWctx, GLctx) \
|
||||
do { \
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ else { \
|
|||
void
|
||||
_swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
|
||||
{
|
||||
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
|
||||
GLfloat rFog, gFog, bFog;
|
||||
|
||||
ASSERT(swrast->_FogEnabled);
|
||||
|
|
@ -283,7 +283,7 @@ _swrast_fog_rgba_span( const GLcontext *ctx, SWspan *span )
|
|||
void
|
||||
_swrast_fog_ci_span( const GLcontext *ctx, SWspan *span )
|
||||
{
|
||||
const SWcontext *swrast = SWRAST_CONTEXT(ctx);
|
||||
const SWcontext *swrast = CONST_SWRAST_CONTEXT(ctx);
|
||||
const GLuint fogIndex = (GLuint) ctx->Fog.Index;
|
||||
GLuint *index = span->array->index;
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ texture_combine( const GLcontext *ctx, GLuint unit, GLuint n,
|
|||
|
||||
ASSERT(ctx->Extensions.EXT_texture_env_combine ||
|
||||
ctx->Extensions.ARB_texture_env_combine);
|
||||
ASSERT(SWRAST_CONTEXT(ctx)->_AnyTextureCombine);
|
||||
ASSERT(CONST_SWRAST_CONTEXT(ctx)->_AnyTextureCombine);
|
||||
|
||||
/*
|
||||
printf("modeRGB 0x%x modeA 0x%x srcRGB1 0x%x srcA1 0x%x srcRGB2 0x%x srcA2 0x%x\n",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue