本文整理汇总了C++中FALLBACK函数的典型用法代码示例。如果您正苦于以下问题:C++ FALLBACK函数的具体用法?C++ FALLBACK怎么用?C++ FALLBACK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FALLBACK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: i810UpdateTexUnit
/**
* Update hardware state for a texture unit.
*
* \todo
* 1D textures should be supported! Just use a 2D texture with the second
* texture coordinate value fixed at 0.0.
*/
static void i810UpdateTexUnit( struct gl_context *ctx, GLuint unit,
int * next_color_stage, int * next_alpha_stage )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
GLboolean ret;
switch(texUnit->_ReallyEnabled) {
case TEXTURE_2D_BIT:
ret = enable_tex_common( ctx, unit);
ret &= enable_tex_2d(ctx, unit);
if (ret == GL_FALSE) {
FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
}
break;
case TEXTURE_RECT_BIT:
ret = enable_tex_common( ctx, unit);
ret &= enable_tex_rect(ctx, unit);
if (ret == GL_FALSE) {
FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
}
break;
case 0:
disable_tex(ctx, unit);
break;
}
if (!i810UpdateTexEnvCombine( ctx, unit,
next_color_stage, next_alpha_stage )) {
FALLBACK( imesa, I810_FALLBACK_TEXTURE, GL_TRUE );
}
return;
}
示例2: updateTextureUnit
static void updateTextureUnit( struct gl_context *ctx, int unit )
{
sisContextPtr smesa = SIS_CONTEXT( ctx );
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
struct gl_texture_object *texObj = texUnit->_Current;
GLint fallbackbit;
if (unit == 0)
fallbackbit = SIS_FALLBACK_TEXTURE0;
else
fallbackbit = SIS_FALLBACK_TEXTURE1;
if (texUnit->_ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT)) {
if (smesa->TexStates[unit] & NEW_TEXTURING) {
GLboolean ok;
ok = sis_set_texobj_parm (ctx, texObj, unit);
FALLBACK( smesa, fallbackbit, !ok );
}
if (smesa->TexStates[unit] & NEW_TEXTURE_ENV) {
if (unit == 0)
sis_set_texture_env0( ctx, texObj, unit );
else
sis_set_texture_env1( ctx, texObj, unit );
}
smesa->TexStates[unit] = 0;
} else if ( texUnit->_ReallyEnabled ) {
/* fallback */
FALLBACK( smesa, fallbackbit, 1 );
} else {
sis_reset_texture_env( ctx, unit );
FALLBACK( smesa, fallbackbit, 0 );
}
}
示例3: tdfxDDDrawBuffer
/* XXX support for separate read/draw buffers hasn't been tested */
static void tdfxDDDrawBuffer( GLcontext *ctx, GLenum mode )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
if ( TDFX_DEBUG & DEBUG_VERBOSE_API ) {
fprintf( stderr, "%s()\n", __FUNCTION__ );
}
FLUSH_BATCH( fxMesa );
if (ctx->DrawBuffer->_NumColorDrawBuffers > 1) {
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) {
case BUFFER_FRONT_LEFT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_FRONTBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BACK_LEFT:
fxMesa->DrawBuffer = fxMesa->ReadBuffer = GR_BUFFER_BACKBUFFER;
fxMesa->new_state |= TDFX_NEW_RENDER;
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case -1:
FX_grColorMaskv( ctx, false4 );
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( fxMesa, TDFX_FALLBACK_DRAW_BUFFER, GL_TRUE );
break;
}
}
示例4: mgaDDDrawBuffer
static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
FLUSH_BATCH( mmesa );
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mmesa->draw_buffer = MGA_FRONT;
mgaXMesaSetFrontClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case DD_BACK_LEFT_BIT:
mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
mmesa->draw_buffer = MGA_BACK;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mgaXMesaSetBackClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
/* We want to update the s/w rast state too so that r200SetBuffer()
* gets called.
*/
_swrast_DrawBuffer(ctx, mode);
}
示例5: mgaDDDrawBuffer
static void mgaDDDrawBuffer(GLcontext *ctx, GLenum mode )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
FLUSH_BATCH( mmesa );
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) {
case BUFFER_BIT_FRONT_LEFT:
mmesa->setup.dstorg = mmesa->mgaScreen->frontOffset;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mmesa->draw_buffer = MGA_FRONT;
mgaXMesaSetFrontClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BIT_BACK_LEFT:
mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
mmesa->draw_buffer = MGA_BACK;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
mgaXMesaSetBackClipRects( mmesa );
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( ctx, MGA_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
}
示例6: gammaUpdateTexUnit
static void gammaUpdateTexUnit( GLcontext *ctx, GLuint unit )
{
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
/* fprintf(stderr, "%s\n", __FUNCTION__); */
if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT)
{
struct gl_texture_object *tObj = texUnit->_Current;
gammaTextureObjectPtr t = (gammaTextureObjectPtr)tObj->DriverData;
/* Upload teximages (not pipelined)
*/
if (t->dirty_images) {
gammaSetTexImages( gmesa, tObj );
if (!t->MemBlock) {
FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
return;
}
}
#if 0
if (tObj->Image[0][tObj->BaseLevel]->Border > 0) {
FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
return;
}
#endif
/* Update state if this is a different texture object to last
* time.
*/
if (gmesa->CurrentTexObj[unit] != t) {
gmesa->dirty |= GAMMA_UPLOAD_TEX0 /* << unit */;
gmesa->CurrentTexObj[unit] = t;
gammaUpdateTexLRU( gmesa, t ); /* done too often */
}
/* Update texture environment if texture object image format or
* texture environment state has changed.
*/
if (tObj->Image[0][tObj->BaseLevel]->Format != gmesa->TexEnvImageFmt[unit]) {
gmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format;
gammaUpdateTexEnv( ctx, unit );
}
}
else if (texUnit->_ReallyEnabled) {
FALLBACK( gmesa, GAMMA_FALLBACK_TEXTURE, GL_TRUE );
}
else /*if (gmesa->CurrentTexObj[unit])*/ {
gmesa->CurrentTexObj[unit] = 0;
gmesa->TexEnvImageFmt[unit] = 0;
gmesa->dirty &= ~(GAMMA_UPLOAD_TEX0<<unit);
}
}
示例7: sis6326DDColorMask
static void sis6326DDColorMask( GLcontext *ctx,
GLboolean r, GLboolean g,
GLboolean b, GLboolean a )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
if (r && g && b && ((ctx->Visual.alphaBits == 0) || a)) {
FALLBACK(smesa, SIS_FALLBACK_WRITEMASK, 0);
} else {
FALLBACK(smesa, SIS_FALLBACK_WRITEMASK, 1);
}
}
示例8: i810BlendEquationSeparate
static void i810BlendEquationSeparate(struct gl_context *ctx,
GLenum modeRGB, GLenum modeA)
{
assert( modeRGB == modeA );
/* Can only do GL_ADD equation in hardware */
FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_BLEND_EQ,
modeRGB != GL_FUNC_ADD);
/* BlendEquation sets ColorLogicOpEnabled in an unexpected
* manner.
*/
FALLBACK( I810_CONTEXT(ctx), I810_FALLBACK_LOGICOP,
(ctx->Color.ColorLogicOpEnabled &&
ctx->Color.LogicOp != GL_COPY));
}
示例9: mgaDDDepthFunc
static void mgaDDDepthFunc(GLcontext *ctx, GLenum func)
{
mgaContextPtr mmesa = MGA_CONTEXT( ctx );
int zmode;
switch (func) {
case GL_NEVER:
/* can't do this in h/w, we'll use a s/w fallback */
FALLBACK (ctx, MGA_FALLBACK_DEPTH, ctx->Depth.Test);
/* FALLTHROUGH */
case GL_ALWAYS:
zmode = DC_zmode_nozcmp; break;
case GL_LESS:
zmode = DC_zmode_zlt; break;
case GL_LEQUAL:
zmode = DC_zmode_zlte; break;
case GL_EQUAL:
zmode = DC_zmode_ze; break;
case GL_GREATER:
zmode = DC_zmode_zgt; break;
case GL_GEQUAL:
zmode = DC_zmode_zgte; break;
case GL_NOTEQUAL:
zmode = DC_zmode_zne; break;
default:
zmode = 0; break;
}
MGA_STATECHANGE( mmesa, MGA_UPLOAD_CONTEXT );
mmesa->hw.zmode &= DC_zmode_MASK;
mmesa->hw.zmode |= zmode;
}
示例10: tdfxDDColorMask
static void tdfxDDColorMask( GLcontext *ctx,
GLboolean r, GLboolean g,
GLboolean b, GLboolean a )
{
tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx);
FLUSH_BATCH( fxMesa );
if ( fxMesa->Color.ColorMask[RCOMP] != r ||
fxMesa->Color.ColorMask[GCOMP] != g ||
fxMesa->Color.ColorMask[BCOMP] != b ||
fxMesa->Color.ColorMask[ACOMP] != a ) {
fxMesa->Color.ColorMask[RCOMP] = r;
fxMesa->Color.ColorMask[GCOMP] = g;
fxMesa->Color.ColorMask[BCOMP] = b;
fxMesa->Color.ColorMask[ACOMP] = a;
fxMesa->dirty |= TDFX_UPLOAD_COLOR_MASK;
if (ctx->Visual.redBits < 8) {
/* Can't do RGB colormasking in 16bpp mode. */
/* We can completely ignore the alpha mask. */
FALLBACK( fxMesa, TDFX_FALLBACK_COLORMASK, (r != g || g != b) );
}
}
}
示例11: r128UpdateTextureState
void r128UpdateTextureState( GLcontext *ctx )
{
r128ContextPtr rmesa = R128_CONTEXT(ctx);
GLboolean ok;
/* This works around a quirk with the R128 hardware. If only OpenGL
* TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The
* hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used.
*/
rmesa->tmu_source[0] = 0;
rmesa->tmu_source[1] = 1;
if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) {
/* only texture 1 enabled */
rmesa->tmu_source[0] = 1;
rmesa->tmu_source[1] = 0;
}
ok = (updateTextureUnit( ctx, 0 ) &&
updateTextureUnit( ctx, 1 ));
FALLBACK( rmesa, R128_FALLBACK_TEXTURE, !ok );
}
示例12: i810DrawBuffer
void i810DrawBuffer(GLcontext *ctx, GLenum mode )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
int front = 0;
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
switch ( ctx->Color._DrawDestMask[0] ) {
case DD_FRONT_LEFT_BIT:
front = 1;
break;
case DD_BACK_LEFT_BIT:
front = 0;
break;
default:
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
if ( imesa->sarea->pf_current_page == 1 )
front ^= 1;
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE );
I810_FIREVERTICES(imesa);
I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
if (front)
{
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset |
imesa->i810Screen->backPitchBits);
i810XMesaSetFrontClipRects( imesa );
}
else
{
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset |
imesa->i810Screen->backPitchBits);
i810XMesaSetBackClipRects( imesa );
}
/* We want to update the s/w rast state too so that r200SetBuffer()
* gets called.
*/
_swrast_DrawBuffer(ctx, mode);
}
示例13: tm_tags_equal
gboolean tm_tags_equal(const TMTag *a, const TMTag *b)
{
if (a == b)
return TRUE;
return (a->line == b->line &&
a->file == b->file /* ptr comparison */ &&
strcmp(FALLBACK(a->name, ""), FALLBACK(b->name, "")) == 0 &&
a->type == b->type &&
a->local == b->local &&
a->pointerOrder == b->pointerOrder &&
a->access == b->access &&
a->impl == b->impl &&
a->lang == b->lang &&
strcmp(FALLBACK(a->scope, ""), FALLBACK(b->scope, "")) == 0 &&
strcmp(FALLBACK(a->arglist, ""), FALLBACK(b->arglist, "")) == 0 &&
strcmp(FALLBACK(a->inheritance, ""), FALLBACK(b->inheritance, "")) == 0 &&
strcmp(FALLBACK(a->var_type, ""), FALLBACK(b->var_type, "")) == 0);
}
示例14: i810DrawBuffer
void i810DrawBuffer(struct gl_context *ctx, GLenum mode )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
int front = 0;
if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) {
/* GL_NONE or GL_FRONT_AND_BACK or stereo left&right, etc */
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0]) {
case BUFFER_FRONT_LEFT:
front = 1;
break;
case BUFFER_BACK_LEFT:
front = 0;
break;
default:
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
if ( imesa->sarea->pf_current_page == 1 )
front ^= 1;
FALLBACK( imesa, I810_FALLBACK_DRAW_BUFFER, GL_FALSE );
I810_FIREVERTICES(imesa);
I810_STATECHANGE(imesa, I810_UPLOAD_BUFFERS);
if (front)
{
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->fbOffset |
imesa->i810Screen->backPitchBits);
i810XMesaSetFrontClipRects( imesa );
}
else
{
imesa->BufferSetup[I810_DESTREG_DI1] = (imesa->i810Screen->backOffset |
imesa->i810Screen->backPitchBits);
i810XMesaSetBackClipRects( imesa );
}
}
示例15: sis6326DDDrawBuffer
void sis6326DDDrawBuffer( GLcontext *ctx, GLenum mode )
{
sisContextPtr smesa = SIS_CONTEXT(ctx);
__GLSiSHardware *prev = &smesa->prev;
__GLSiSHardware *current = &smesa->current;
if(getenv("SIS_DRAW_FRONT"))
ctx->DrawBuffer->_ColorDrawBufferIndexes[0] = BUFFER_FRONT_LEFT;
if (ctx->DrawBuffer->_NumColorDrawBuffers > 1) {
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
current->hwDstSet &= ~MASK_DstBufferPitch;
switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) {
case BUFFER_FRONT_LEFT:
current->hwOffsetDest = smesa->front.offset;
current->hwDstSet |= smesa->front.pitch;
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
case BUFFER_BACK_LEFT:
current->hwOffsetDest = smesa->back.offset;
current->hwDstSet |= smesa->back.pitch;
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_FALSE );
break;
default:
FALLBACK( smesa, SIS_FALLBACK_DRAW_BUFFER, GL_TRUE );
return;
}
if (current->hwDstSet != prev->hwDstSet) {
prev->hwDstSet = current->hwDstSet;
smesa->GlobalFlag |= GFLAG_DESTSETTING;
}
if (current->hwOffsetDest != prev->hwOffsetDest) {
prev->hwOffsetDest = current->hwOffsetDest;
smesa->GlobalFlag |= GFLAG_DESTSETTING;
}
}