Exemplo n.º 1
0
void radeonInitSpanFuncs(struct gl_context * ctx)
{
	struct swrast_device_driver *swdd =
	    _swrast_GetDeviceDriverReference(ctx);
	swdd->SpanRenderStart = radeonSpanRenderStart;
	swdd->SpanRenderFinish = radeonSpanRenderFinish;
}
Exemplo n.º 2
0
void
intelInitSpanFuncs(GLcontext * ctx)
{
   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
   swdd->SpanRenderStart = intelSpanRenderStart;
   swdd->SpanRenderFinish = intelSpanRenderFinish;
}
Exemplo n.º 3
0
void
nouveau_span_functions_init(struct gl_context *ctx)
{
	struct swrast_device_driver *swdd =
		_swrast_GetDeviceDriverReference(ctx);

	swdd->SpanRenderStart = nouveau_span_start;
	swdd->SpanRenderFinish = nouveau_span_finish;
}
Exemplo n.º 4
0
void r128DDInitSpanFuncs( GLcontext *ctx )
{
   r128ContextPtr rmesa = R128_CONTEXT(ctx);
   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

   swdd->SetBuffer = r128DDSetBuffer;
   swdd->SpanRenderStart	= r128SpanRenderStart;
   swdd->SpanRenderFinish	= r128SpanRenderFinish;
}
Exemplo n.º 5
0
void MesaDriver::UpdateState( GLcontext *ctx, GLuint new_state )
{
	struct swrast_device_driver *	swdd = _swrast_GetDeviceDriverReference( ctx );

	_swrast_InvalidateState( ctx, new_state );
	_swsetup_InvalidateState( ctx, new_state );
	_vbo_InvalidateState( ctx, new_state );
	_tnl_InvalidateState( ctx, new_state );

	if (ctx->Color.DrawBuffer[0] == GL_FRONT) {
      /* read/write front buffer */
      swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanFront;
      swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanFront;
      swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsFront;
      swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanFront;
      swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsFront;
      swdd->WriteCI32Span = MesaDriver::WriteCI32SpanFront;
      swdd->WriteCI8Span = MesaDriver::WriteCI8SpanFront;
      swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanFront;
      swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsFront;
      swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsFront;
      swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanFront;
      swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsFront;
      swdd->ReadCI32Span = MesaDriver::ReadCI32SpanFront;
      swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsFront;
   }
   else {
      /* read/write back buffer */
      swdd->WriteRGBASpan = MesaDriver::WriteRGBASpanBack;
      swdd->WriteRGBSpan = MesaDriver::WriteRGBSpanBack;
      swdd->WriteRGBAPixels = MesaDriver::WriteRGBAPixelsBack;
      swdd->WriteMonoRGBASpan = MesaDriver::WriteMonoRGBASpanBack;
      swdd->WriteMonoRGBAPixels = MesaDriver::WriteMonoRGBAPixelsBack;
      swdd->WriteCI32Span = MesaDriver::WriteCI32SpanBack;
      swdd->WriteCI8Span = MesaDriver::WriteCI8SpanBack;
      swdd->WriteMonoCISpan = MesaDriver::WriteMonoCISpanBack;
      swdd->WriteCI32Pixels = MesaDriver::WriteCI32PixelsBack;
      swdd->WriteMonoCIPixels = MesaDriver::WriteMonoCIPixelsBack;
      swdd->ReadRGBASpan = MesaDriver::ReadRGBASpanBack;
      swdd->ReadRGBAPixels = MesaDriver::ReadRGBAPixelsBack;
      swdd->ReadCI32Span = MesaDriver::ReadCI32SpanBack;
      swdd->ReadCI32Pixels = MesaDriver::ReadCI32PixelsBack;
    }
}
Exemplo n.º 6
0
void MesaDriver::Init(BGLView * bglview, GLcontext * ctx, GLvisual * visual, GLframebuffer * framebuffer)
{
	m_bglview 		= bglview;
	m_glcontext 	= ctx;
	m_glvisual 		= visual;
	m_glframebuffer = framebuffer;

	MesaDriver * md = (MesaDriver *) ctx->DriverCtx;
	struct swrast_device_driver * swdd = _swrast_GetDeviceDriverReference( ctx );
	TNLcontext * tnl = TNL_CONTEXT(ctx);

	assert(md->m_glcontext == ctx );
	assert(tnl);
	assert(swdd);

	// Use default TCL pipeline
	tnl->Driver.RunPipeline = _tnl_run_pipeline;
 
	swdd->SetBuffer = this->SetBuffer;
}
Exemplo n.º 7
0
void savageDDInitSpanFuncs( GLcontext *ctx )
{
   savageContextPtr imesa = SAVAGE_CONTEXT(ctx);
   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

   swdd->SetBuffer = savageDDSetBuffer;
   
   switch (imesa->savageScreen->cpp) 
   {
   case 2:
      swdd->WriteRGBASpan = savageWriteRGBASpan_565;
      swdd->WriteRGBSpan = savageWriteRGBSpan_565;
      swdd->WriteMonoRGBASpan = savageWriteMonoRGBASpan_565;
      swdd->WriteRGBAPixels = savageWriteRGBAPixels_565;
      swdd->WriteMonoRGBAPixels = savageWriteMonoRGBAPixels_565;
      swdd->ReadRGBASpan = savageReadRGBASpan_565;
      swdd->ReadRGBAPixels = savageReadRGBAPixels_565;
   
      break;

   case 4:
      swdd->WriteRGBASpan = savageWriteRGBASpan_8888;
      swdd->WriteRGBSpan = savageWriteRGBSpan_8888;
      swdd->WriteMonoRGBASpan = savageWriteMonoRGBASpan_8888;
      swdd->WriteRGBAPixels = savageWriteRGBAPixels_8888;
      swdd->WriteMonoRGBAPixels = savageWriteMonoRGBAPixels_8888;
      swdd->ReadRGBASpan = savageReadRGBASpan_8888;
      swdd->ReadRGBAPixels = savageReadRGBAPixels_8888;
   }

   switch (imesa->savageScreen->zpp)
   {
   case 2: 
       swdd->ReadDepthSpan = savageReadDepthSpan_16;
       swdd->WriteDepthSpan = savageWriteDepthSpan_16;
       swdd->ReadDepthPixels = savageReadDepthPixels_16;
       swdd->WriteDepthPixels = savageWriteDepthPixels_16;
       
       break;
   case 4: 
       swdd->ReadDepthSpan = savageReadDepthSpan_8_24;
       swdd->WriteDepthSpan = savageWriteDepthSpan_8_24;
       swdd->ReadDepthPixels = savageReadDepthPixels_8_24;
       swdd->WriteDepthPixels = savageWriteDepthPixels_8_24;    
       swdd->ReadStencilSpan = savageReadStencilSpan_8_24;
       swdd->WriteStencilSpan = savageWriteStencilSpan_8_24;
       swdd->ReadStencilPixels = savageReadStencilPixels_8_24;
       swdd->WriteStencilPixels = savageWriteStencilPixels_8_24;
       break;   
   
   }
   swdd->WriteCI8Span        =NULL;
   swdd->WriteCI32Span       =NULL;
   swdd->WriteMonoCISpan     =NULL;
   swdd->WriteCI32Pixels     =NULL;
   swdd->WriteMonoCIPixels   =NULL;
   swdd->ReadCI32Span        =NULL;
   swdd->ReadCI32Pixels      =NULL;

   /* 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;
}
Exemplo n.º 8
0
void i830DDInitSpanFuncs( GLcontext *ctx )
{
   i830ContextPtr imesa = I830_CONTEXT(ctx);
   i830ScreenPrivate *i830Screen = imesa->i830Screen;

   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

   swdd->SetReadBuffer = i830SetReadBuffer;

   switch (i830Screen->fbFormat) {
   case DV_PF_555:
      swdd->WriteRGBASpan = i830WriteRGBASpan_555;
      swdd->WriteRGBSpan = i830WriteRGBSpan_555;
      swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_555;
      swdd->WriteRGBAPixels = i830WriteRGBAPixels_555;
      swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_555;
      swdd->ReadRGBASpan = i830ReadRGBASpan_555;
      swdd->ReadRGBAPixels = i830ReadRGBAPixels_555;

      swdd->ReadDepthSpan = i830ReadDepthSpan_16;
      swdd->WriteDepthSpan = i830WriteDepthSpan_16;
      swdd->ReadDepthPixels = i830ReadDepthPixels_16;
      swdd->WriteDepthPixels = i830WriteDepthPixels_16;
      break;

   case DV_PF_565:
      swdd->WriteRGBASpan = i830WriteRGBASpan_565;
      swdd->WriteRGBSpan = i830WriteRGBSpan_565;
      swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_565;
      swdd->WriteRGBAPixels = i830WriteRGBAPixels_565;
      swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_565; 
      swdd->ReadRGBASpan = i830ReadRGBASpan_565;
      swdd->ReadRGBAPixels = i830ReadRGBAPixels_565;

      swdd->ReadDepthSpan = i830ReadDepthSpan_16;
      swdd->WriteDepthSpan = i830WriteDepthSpan_16;
      swdd->ReadDepthPixels = i830ReadDepthPixels_16;
      swdd->WriteDepthPixels = i830WriteDepthPixels_16;
      break;

   case DV_PF_8888:
      swdd->WriteRGBASpan = i830WriteRGBASpan_8888;
      swdd->WriteRGBSpan = i830WriteRGBSpan_8888;
      swdd->WriteMonoRGBASpan = i830WriteMonoRGBASpan_8888;
      swdd->WriteRGBAPixels = i830WriteRGBAPixels_8888;
      swdd->WriteMonoRGBAPixels = i830WriteMonoRGBAPixels_8888;
      swdd->ReadRGBASpan = i830ReadRGBASpan_8888;
      swdd->ReadRGBAPixels = i830ReadRGBAPixels_8888;

      if(imesa->hw_stencil) {
	 swdd->ReadDepthSpan = i830ReadDepthSpan_24_8;
	 swdd->WriteDepthSpan = i830WriteDepthSpan_24_8;
	 swdd->ReadDepthPixels = i830ReadDepthPixels_24_8;
	 swdd->WriteDepthPixels = i830WriteDepthPixels_24_8;

	 swdd->WriteStencilSpan = i830WriteStencilSpan_24_8;
	 swdd->ReadStencilSpan = i830ReadStencilSpan_24_8;
	 swdd->WriteStencilPixels = i830WriteStencilPixels_24_8;
	 swdd->ReadStencilPixels = i830ReadStencilPixels_24_8;
      } else {
	 swdd->ReadDepthSpan = i830ReadDepthSpan_24;
	 swdd->WriteDepthSpan = i830WriteDepthSpan_24;
	 swdd->ReadDepthPixels = i830ReadDepthPixels_24;
	 swdd->WriteDepthPixels = i830WriteDepthPixels_24;
      }
      break;
   }

   swdd->SpanRenderStart = i830SpanRenderStart;
   swdd->SpanRenderFinish = i830SpanRenderFinish; 
}
Exemplo n.º 9
0
void intelInitSpanFuncs( GLcontext *ctx )
{
   intelContextPtr intel = INTEL_CONTEXT(ctx);
   intelScreenPrivate *intelScreen = intel->intelScreen;

   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

   swdd->SetBuffer = intelSetBuffer;

   switch (intelScreen->fbFormat) {
   case DV_PF_555:
#if 0
      swdd->WriteRGBASpan = intelWriteRGBASpan_555;
      swdd->WriteRGBSpan = intelWriteRGBSpan_555;
      swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_555;
      swdd->WriteRGBAPixels = intelWriteRGBAPixels_555;
      swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_555;
      swdd->ReadRGBASpan = intelReadRGBASpan_555;
      swdd->ReadRGBAPixels = intelReadRGBAPixels_555;
      swdd->ReadDepthSpan = intelReadDepthSpan_16;
      swdd->WriteDepthSpan = intelWriteDepthSpan_16;
      swdd->ReadDepthPixels = intelReadDepthPixels_16;
      swdd->WriteDepthPixels = intelWriteDepthPixels_16;
#endif
      break;

   case DV_PF_565:
#if 0
      swdd->WriteRGBASpan = intelWriteRGBASpan_565;
      swdd->WriteRGBSpan = intelWriteRGBSpan_565;
      swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_565;
      swdd->WriteRGBAPixels = intelWriteRGBAPixels_565;
      swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_565; 
      swdd->ReadRGBASpan = intelReadRGBASpan_565;
      swdd->ReadRGBAPixels = intelReadRGBAPixels_565;
      swdd->ReadDepthSpan = intelReadDepthSpan_16;
      swdd->WriteDepthSpan = intelWriteDepthSpan_16;
      swdd->ReadDepthPixels = intelReadDepthPixels_16;
      swdd->WriteDepthPixels = intelWriteDepthPixels_16;
#endif
      break;

   case DV_PF_8888:
#if 0
      swdd->WriteRGBASpan = intelWriteRGBASpan_8888;
      swdd->WriteRGBSpan = intelWriteRGBSpan_8888;
      swdd->WriteMonoRGBASpan = intelWriteMonoRGBASpan_8888;
      swdd->WriteRGBAPixels = intelWriteRGBAPixels_8888;
      swdd->WriteMonoRGBAPixels = intelWriteMonoRGBAPixels_8888;
      swdd->ReadRGBASpan = intelReadRGBASpan_8888;
      swdd->ReadRGBAPixels = intelReadRGBAPixels_8888;
      swdd->ReadDepthSpan = intelReadDepthSpan_24_8;
      swdd->WriteDepthSpan = intelWriteDepthSpan_24_8;
      swdd->ReadDepthPixels = intelReadDepthPixels_24_8;
      swdd->WriteDepthPixels = intelWriteDepthPixels_24_8;

      swdd->WriteStencilSpan = intelWriteStencilSpan_24_8;
      swdd->ReadStencilSpan = intelReadStencilSpan_24_8;
      swdd->WriteStencilPixels = intelWriteStencilPixels_24_8;
      swdd->ReadStencilPixels = intelReadStencilPixels_24_8;
#endif
      break;
   }

   swdd->SpanRenderStart = intelSpanRenderStart;
   swdd->SpanRenderFinish = intelSpanRenderFinish; 
}
Exemplo n.º 10
0
void viaInitSpanFuncs(GLcontext *ctx)
{
#if 0
    struct via_context *vmesa = VIA_CONTEXT(ctx);
#endif
    struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

    swdd->SetBuffer = viaSetBuffer;
#if 0
    if (vmesa->viaScreen->bitsPerPixel == 16) {
	viaInitPointers_565( swdd );
    }
    else if (vmesa->viaScreen->bitsPerPixel == 32) {
	viaInitPointers_8888( swdd );
    }
    else {
	assert(0);
    }
#endif
#if 0
    if (vmesa->glCtx->Visual.depthBits == 16) {
	swdd->ReadDepthSpan = viaReadDepthSpan_16;
	swdd->WriteDepthSpan = viaWriteDepthSpan_16;
	swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_16;
	swdd->ReadDepthPixels = viaReadDepthPixels_16;
	swdd->WriteDepthPixels = viaWriteDepthPixels_16;
    }
    else if (vmesa->glCtx->Visual.depthBits == 24) {
        swdd->ReadDepthSpan = viaReadDepthSpan_24_8;
	swdd->WriteDepthSpan = viaWriteDepthSpan_24_8;
	swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_24_8;
	swdd->ReadDepthPixels = viaReadDepthPixels_24_8;
	swdd->WriteDepthPixels = viaWriteDepthPixels_24_8;

	swdd->WriteStencilSpan = viaWriteStencilSpan_24_8;
	swdd->ReadStencilSpan = viaReadStencilSpan_24_8;
	swdd->WriteStencilPixels = viaWriteStencilPixels_24_8;
	swdd->ReadStencilPixels = viaReadStencilPixels_24_8;
    }
    else if (vmesa->glCtx->Visual.depthBits == 32) {
	swdd->ReadDepthSpan = viaReadDepthSpan_32;
	swdd->WriteDepthSpan = viaWriteDepthSpan_32;
	swdd->WriteMonoDepthSpan = viaWriteMonoDepthSpan_32;
	swdd->ReadDepthPixels = viaReadDepthPixels_32;
	swdd->WriteDepthPixels = viaWriteDepthPixels_32;
    }
#endif

    swdd->SpanRenderStart = viaSpanRenderStart;
    swdd->SpanRenderFinish = viaSpanRenderFinish; 

#if 0
    swdd->WriteCI8Span = NULL;
    swdd->WriteCI32Span = NULL;
    swdd->WriteMonoCISpan = NULL;
    swdd->WriteCI32Pixels = NULL;
    swdd->WriteMonoCIPixels = NULL;
    swdd->ReadCI32Span = NULL;
    swdd->ReadCI32Pixels = NULL;	
#endif
}
Exemplo n.º 11
0
void gammaDDInitSpanFuncs( GLcontext *ctx )
{
    gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
    struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);

    swdd->SetBuffer = gammaSetBuffer;

    switch ( gmesa->gammaScreen->cpp ) {
    case 2:
        swdd->WriteRGBASpan	= gammaWriteRGBASpan_RGB565;
        swdd->WriteRGBSpan	= gammaWriteRGBSpan_RGB565;
        swdd->WriteMonoRGBASpan	= gammaWriteMonoRGBASpan_RGB565;
        swdd->WriteRGBAPixels	= gammaWriteRGBAPixels_RGB565;
        swdd->WriteMonoRGBAPixels	= gammaWriteMonoRGBAPixels_RGB565;
        swdd->ReadRGBASpan	= gammaReadRGBASpan_RGB565;
        swdd->ReadRGBAPixels      = gammaReadRGBAPixels_RGB565;
        break;

    case 4:
        swdd->WriteRGBASpan	= gammaWriteRGBASpan_ARGB8888;
        swdd->WriteRGBSpan	= gammaWriteRGBSpan_ARGB8888;
        swdd->WriteMonoRGBASpan   = gammaWriteMonoRGBASpan_ARGB8888;
        swdd->WriteRGBAPixels     = gammaWriteRGBAPixels_ARGB8888;
        swdd->WriteMonoRGBAPixels = gammaWriteMonoRGBAPixels_ARGB8888;
#if 1
        swdd->ReadRGBASpan	= gammaReadRGBASpan_ARGB8888;
#else
        swdd->ReadRGBASpan	= gammaReadRGBASpan8888;
#endif
        swdd->ReadRGBAPixels      = gammaReadRGBAPixels_ARGB8888;
        break;

    default:
        break;
    }

    switch ( gmesa->glCtx->Visual.depthBits ) {
    case 16:
        swdd->ReadDepthSpan	= gammaReadDepthSpan_16;
        swdd->WriteDepthSpan	= gammaWriteDepthSpan_16;
        swdd->ReadDepthPixels	= gammaReadDepthPixels_16;
        swdd->WriteDepthPixels	= gammaWriteDepthPixels_16;
        break;

    case 24:
        swdd->ReadDepthSpan	= gammaReadDepthSpan_24_8;
        swdd->WriteDepthSpan	= gammaWriteDepthSpan_24_8;
        swdd->ReadDepthPixels	= gammaReadDepthPixels_24_8;
        swdd->WriteDepthPixels	= gammaWriteDepthPixels_24_8;

#if 0
        swdd->ReadStencilSpan	= gammaReadStencilSpan_24_8;
        swdd->WriteStencilSpan	= gammaWriteStencilSpan_24_8;
        swdd->ReadStencilPixels	= gammaReadStencilPixels_24_8;
        swdd->WriteStencilPixels	= gammaWriteStencilPixels_24_8;
#endif
        break;

    default:
        break;
    }
}
Exemplo n.º 12
0
void nouveauSpanInitFunctions( GLcontext *ctx )
{
   struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
   swdd->SpanRenderStart	= nouveauSpanRenderStart;
   swdd->SpanRenderFinish	= nouveauSpanRenderFinish;
}