示例#1
0
void i810InitStateFuncs(GLcontext *ctx)
{
   /* Callbacks for internal Mesa events.
    */
   ctx->Driver.UpdateState = i810InvalidateState;

   /* API callbacks
    */
   ctx->Driver.AlphaFunc = i810AlphaFunc;
   ctx->Driver.BlendEquationSeparate = i810BlendEquationSeparate;
   ctx->Driver.BlendFuncSeparate = i810BlendFuncSeparate;
   ctx->Driver.ClearColor = i810ClearColor;
   ctx->Driver.ColorMask = i810ColorMask;
   ctx->Driver.CullFace = i810CullFaceFrontFace;
   ctx->Driver.DepthFunc = i810DepthFunc;
   ctx->Driver.DepthMask = i810DepthMask;
   ctx->Driver.Enable = i810Enable;
   ctx->Driver.Fogfv = i810Fogfv;
   ctx->Driver.FrontFace = i810CullFaceFrontFace;
   ctx->Driver.LineWidth = i810LineWidth;
   ctx->Driver.LogicOpcode = i810LogicOp;
   ctx->Driver.PolygonStipple = i810PolygonStipple;
   ctx->Driver.RenderMode = i810RenderMode;
   ctx->Driver.Scissor = i810Scissor;
   ctx->Driver.DrawBuffer = i810DrawBuffer;
   ctx->Driver.ReadBuffer = i810ReadBuffer;
   ctx->Driver.ShadeModel = i810ShadeModel;
   ctx->Driver.DepthRange = i810DepthRange;
   ctx->Driver.Viewport = i810Viewport;
   ctx->Driver.PointSize = i810PointSize;

   if (IS_I815(I810_CONTEXT(ctx))) {
      ctx->Driver.LightModelfv = i810LightModelfv_i815;
   } else {
      ctx->Driver.LightModelfv = i810LightModelfv;
   }

   /* Pixel path fallbacks.
    */
   ctx->Driver.Accum = _swrast_Accum;
   ctx->Driver.Bitmap = _swrast_Bitmap;
   ctx->Driver.CopyPixels = _swrast_CopyPixels;
   ctx->Driver.DrawPixels = _swrast_DrawPixels;
   ctx->Driver.ReadPixels = _swrast_ReadPixels;

   /* Swrast hooks for imaging extensions:
    */
   ctx->Driver.CopyColorTable = _swrast_CopyColorTable;
   ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable;
   ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D;
   ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D;
}
示例#2
0
文件: i810state.c 项目: nikai3d/mesa
void i810InitStateFuncs(struct gl_context *ctx)
{
   /* Callbacks for internal Mesa events.
    */
   ctx->Driver.UpdateState = i810InvalidateState;

   /* API callbacks
    */
   ctx->Driver.AlphaFunc = i810AlphaFunc;
   ctx->Driver.BlendEquationSeparate = i810BlendEquationSeparate;
   ctx->Driver.BlendFuncSeparate = i810BlendFuncSeparate;
   ctx->Driver.ClearColor = i810ClearColor;
   ctx->Driver.ColorMask = i810ColorMask;
   ctx->Driver.CullFace = i810CullFaceFrontFace;
   ctx->Driver.DepthFunc = i810DepthFunc;
   ctx->Driver.DepthMask = i810DepthMask;
   ctx->Driver.Enable = i810Enable;
   ctx->Driver.Fogfv = i810Fogfv;
   ctx->Driver.FrontFace = i810CullFaceFrontFace;
   ctx->Driver.LineWidth = i810LineWidth;
   ctx->Driver.LogicOpcode = i810LogicOp;
   ctx->Driver.PolygonStipple = i810PolygonStipple;
   ctx->Driver.RenderMode = i810RenderMode;
   ctx->Driver.Scissor = i810Scissor;
   ctx->Driver.DrawBuffer = i810DrawBuffer;
   ctx->Driver.ReadBuffer = i810ReadBuffer;
   ctx->Driver.ShadeModel = i810ShadeModel;
   ctx->Driver.DepthRange = i810DepthRange;
   ctx->Driver.Viewport = i810Viewport;
   ctx->Driver.PointSize = i810PointSize;

   if (IS_I815(I810_CONTEXT(ctx))) {
      ctx->Driver.LightModelfv = i810LightModelfv_i815;
   } else {
      ctx->Driver.LightModelfv = i810LightModelfv;
   }
}
示例#3
0
文件: i810tex.c 项目: aosm/X11
static void i810SetTexFilter(i810ContextPtr imesa, 
			     i810TextureObjectPtr t, 
			     GLenum minf, GLenum magf,
                             GLfloat bias)
{
   t->Setup[I810_TEXREG_MF] &= ~(MF_MIN_MASK|
				 MF_MAG_MASK|
				 MF_MIP_MASK);
   t->Setup[I810_TEXREG_MLC] &= ~(MLC_LOD_BIAS_MASK);

   switch (minf) {
   case GL_NEAREST:
      t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_NONE;
      break;
   case GL_LINEAR:
      t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_NONE;
      break;
   case GL_NEAREST_MIPMAP_NEAREST:
      t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_NEAREST;
      if (magf == GL_LINEAR) {
         /*bias -= 0.5;*/  /* this doesn't work too good */
      }
      break;
   case GL_LINEAR_MIPMAP_NEAREST:
      t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_NEAREST;
      break;
   case GL_NEAREST_MIPMAP_LINEAR:
      if (IS_I815(imesa)) 
	 t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_LINEAR;
      else 
	 t->Setup[I810_TEXREG_MF] |= MF_MIN_NEAREST | MF_MIP_DITHER;
      /*
      if (magf == GL_LINEAR) {
         bias -= 0.5;
      }
      */
      bias -= 0.5; /* always biasing here looks better */
      break;
   case GL_LINEAR_MIPMAP_LINEAR:
      if (IS_I815(imesa))
	 t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_LINEAR;
      else 
	 t->Setup[I810_TEXREG_MF] |= MF_MIN_LINEAR | MF_MIP_DITHER;
      break;
   default:
      return;
   }

   switch (magf) {
   case GL_NEAREST: 
      t->Setup[I810_TEXREG_MF] |= MF_MAG_NEAREST; 
      break;
   case GL_LINEAR: 
      t->Setup[I810_TEXREG_MF] |= MF_MAG_LINEAR; 
      break;
   default: 
      return;
   }

   t->Setup[I810_TEXREG_MLC] |= i810ComputeLodBias(bias);
}