#include "mtypes.h"
+#include "buffers.h"
#include "colormac.h"
#include "dd.h"
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
-static void mgaDDBlendEquation(GLcontext *ctx, GLenum mode)
+static void mgaDDBlendEquationSeparate(GLcontext *ctx,
+ GLenum modeRGB, GLenum modeA)
{
+ assert( modeRGB == modeA );
updateBlendLogicOp( ctx );
}
-static void mgaDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor)
+static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
+ GLenum dfactorRGB, GLenum sfactorA,
+ GLenum dfactorA )
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
GLuint src;
mmesa->hw.blend_func == (AC_src_src_alpha_sat | AC_dst_zero) );
}
-static void mgaDDBlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB,
- GLenum dfactorRGB, GLenum sfactorA,
- GLenum dfactorA )
-{
- mgaDDBlendFunc( ctx, sfactorRGB, dfactorRGB );
-}
-
/* =============================================================
* Depth testing
*/
int x1 = mmesa->driDrawable->x + ctx->Scissor.X;
int y1 = mmesa->driDrawable->y + mmesa->driDrawable->h
- (ctx->Scissor.Y + ctx->Scissor.Height);
- int x2 = x1 + ctx->Scissor.Width - 1;
- int y2 = y1 + ctx->Scissor.Height - 1;
+ int x2 = x1 + ctx->Scissor.Width;
+ int y2 = y1 + ctx->Scissor.Height;
if (x1 < 0) x1 = 0;
if (y1 < 0) y1 = 0;
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
unsigned int specen;
- specen = (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) ? TMC_specen_enable : 0;
+ specen = NEED_SECONDARY_COLOR(ctx) ? TMC_specen_enable : 0;
if ( specen != mmesa->hw.specen ) {
mmesa->hw.specen = specen;
GLint x, GLint y,
GLsizei width, GLsizei height )
{
+ /* update size of Mesa/software ancillary buffers */
+ _mesa_ResizeBuffersMESA();
mgaCalcViewport( ctx );
}
__DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
if (driDrawable->numClipRects == 0) {
- static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0};
+ static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
mmesa->numClipRects = 1;
mmesa->pClipRects = &zeroareacliprect;
} else {
if (driDrawable->numBackClipRects == 0)
{
if (driDrawable->numClipRects == 0) {
- static XF86DRIClipRectRec zeroareacliprect = {0,0,0,0};
+ static drm_clip_rect_t zeroareacliprect = {0,0,0,0};
mmesa->numClipRects = 1;
mmesa->pClipRects = &zeroareacliprect;
} else {
void mgaUpdateRects( mgaContextPtr mmesa, GLuint buffers )
{
__DRIdrawablePrivate *driDrawable = mmesa->driDrawable;
- MGASAREAPrivPtr sarea = mmesa->sarea;
+ drm_mga_sarea_t *sarea = mmesa->sarea;
DRI_VALIDATE_DRAWABLE_INFO(mmesa->driScreen, driDrawable);
else
mgaXMesaSetBackClipRects( mmesa );
-#ifndef _SOLO
sarea->req_drawable = driDrawable->draw;
sarea->req_draw_buffer = mmesa->draw_buffer;
-#endif
+
mgaUpdateClipping( mmesa->glCtx );
mgaCalcViewport( mmesa->glCtx );
/*
* _DrawDestMask is easier to cope with than <mode>.
*/
- switch ( ctx->Color._DrawDestMask ) {
- case FRONT_LEFT_BIT:
+ 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 BACK_LEFT_BIT:
+ case BUFFER_BIT_BACK_LEFT:
mmesa->setup.dstorg = mmesa->mgaScreen->backOffset;
mmesa->draw_buffer = MGA_BACK;
mmesa->dirty |= MGA_UPLOAD_CONTEXT;
*/
void mgaEmitHwStateLocked( mgaContextPtr mmesa )
{
- MGASAREAPrivPtr sarea = mmesa->sarea;
+ drm_mga_sarea_t *sarea = mmesa->sarea;
GLcontext * ctx = mmesa->glCtx;
if (MGA_DEBUG & DEBUG_VERBOSE_MSG)
((AC_src_one | AC_dst_zero) & ~mmesa->hw.blend_func_enable) |
mmesa->hw.alpha_sel;
- memcpy( &sarea->ContextState, &mmesa->setup, sizeof(mmesa->setup));
+ memcpy( &sarea->context_state, &mmesa->setup, sizeof(mmesa->setup));
}
if ((mmesa->dirty & MGA_UPLOAD_TEX0) && mmesa->CurrentTexObj[0]) {
- memcpy(&sarea->TexState[0],
+ memcpy(&sarea->tex_state[0],
&mmesa->CurrentTexObj[0]->setup,
- sizeof(sarea->TexState[0]));
+ sizeof(sarea->tex_state[0]));
}
if ((mmesa->dirty & MGA_UPLOAD_TEX1) && mmesa->CurrentTexObj[1]) {
- memcpy(&sarea->TexState[1],
+ memcpy(&sarea->tex_state[1],
&mmesa->CurrentTexObj[1]->setup,
- sizeof(sarea->TexState[1]));
+ sizeof(sarea->tex_state[1]));
}
if (mmesa->dirty & (MGA_UPLOAD_TEX0 | MGA_UPLOAD_TEX1)) {
- sarea->TexState[0].texctl2 &= ~TMC_specen_enable;
- sarea->TexState[1].texctl2 &= ~TMC_specen_enable;
- sarea->TexState[0].texctl2 |= mmesa->hw.specen;
- sarea->TexState[1].texctl2 |= mmesa->hw.specen;
+ sarea->tex_state[0].texctl2 &= ~TMC_specen_enable;
+ sarea->tex_state[1].texctl2 &= ~TMC_specen_enable;
+ sarea->tex_state[0].texctl2 |= mmesa->hw.specen;
+ sarea->tex_state[1].texctl2 |= mmesa->hw.specen;
}
if (mmesa->dirty & MGA_UPLOAD_PIPE) {
/* mmesa->sarea->wacceptseq = mmesa->hw_primitive; */
- mmesa->sarea->WarpPipe = mmesa->vertex_format;
+ mmesa->sarea->warp_pipe = mmesa->vertex_format;
mmesa->sarea->vertsize = mmesa->vertex_size;
}
ctx->Driver.Enable = mgaDDEnable;
ctx->Driver.LightModelfv = mgaDDLightModelfv;
ctx->Driver.AlphaFunc = mgaDDAlphaFunc;
- ctx->Driver.BlendEquation = mgaDDBlendEquation;
- ctx->Driver.BlendFunc = mgaDDBlendFunc;
+ ctx->Driver.BlendEquationSeparate = mgaDDBlendEquationSeparate;
ctx->Driver.BlendFuncSeparate = mgaDDBlendFuncSeparate;
ctx->Driver.DepthFunc = mgaDDDepthFunc;
ctx->Driver.DepthMask = mgaDDDepthMask;