当前位置: 首页>>代码示例>>C++>>正文


C++ FALLBACK函数代码示例

本文整理汇总了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;
}
开发者ID:GunioRobot,项目名称:mesa-7.10.2-PS3,代码行数:42,代码来源:i810texstate.c

示例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 );
   }
}
开发者ID:GunioRobot,项目名称:mesa-7.10.2-PS3,代码行数:34,代码来源:sis_texstate.c

示例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;
   }
}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:36,代码来源:tdfx_state.c

示例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);
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:35,代码来源:mgastate.c

示例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;
   }
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:30,代码来源:mgastate.c

示例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); 
   }
}
开发者ID:DavidGriffith,项目名称:finx,代码行数:55,代码来源:gamma_texstate.c

示例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);
   }
}
开发者ID:emcmanus,项目名称:FlashMesa3D,代码行数:12,代码来源:sis6326_state.c

示例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));
}
开发者ID:nikai3d,项目名称:mesa,代码行数:16,代码来源:i810state.c

示例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;
}
开发者ID:Magister,项目名称:x11rdp_xorg71,代码行数:33,代码来源:mgastate.c

示例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) );
      }
   }
}
开发者ID:AchironOS,项目名称:chromium.src,代码行数:25,代码来源:tdfx_state.c

示例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 );
}
开发者ID:toastpp,项目名称:toastpp,代码行数:25,代码来源:r128_texstate.c

示例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);
}
开发者ID:BackupTheBerlios,项目名称:dri-ex-svn,代码行数:46,代码来源:i810state.c

示例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);
}
开发者ID:kleopatra999,项目名称:geany,代码行数:19,代码来源:tm_tag.c

示例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 );
   }
}
开发者ID:nikai3d,项目名称:mesa,代码行数:43,代码来源:i810state.c

示例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;
   }
}
开发者ID:emcmanus,项目名称:FlashMesa3D,代码行数:43,代码来源:sis6326_state.c


注:本文中的FALLBACK函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。