X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmesa%2Fdrivers%2Fdri%2Funichrome%2Fvia_state.c;h=840e4e42da95d887e462da971b8bd155fff62ccf;hb=c7e46c1857b744a35c086dddb651f38df948a5fa;hp=5b0453423ef157204bdcad89810aed6193394bfa;hpb=b40ed6a0b54d1ba74799aeb3f529c4d298625aa1;p=mesa.git diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 5b0453423ef..840e4e42da9 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -24,14 +24,14 @@ #include -#include "glheader.h" -#include "context.h" -#include "macros.h" -#include "colormac.h" -#include "enums.h" -#include "dd.h" - -#include "mm.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/colormac.h" +#include "main/enums.h" +#include "main/dd.h" +#include "main/mm.h" + #include "via_context.h" #include "via_state.h" #include "via_tex.h" @@ -511,9 +511,9 @@ void viaEmitState(struct via_context *vmesa) } -static __inline__ GLuint viaPackColor(GLuint bpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a) +static INLINE GLuint viaPackColor(GLuint bpp, + GLubyte r, GLubyte g, + GLubyte b, GLubyte a) { switch (bpp) { case 16: @@ -656,13 +656,18 @@ static void viaDrawBuffer(GLcontext *ctx, GLenum mode) if (!ctx->DrawBuffer) return; - switch ( ctx->DrawBuffer->_ColorDrawBufferMask[0] ) { - case BUFFER_BIT_FRONT_LEFT: + if (ctx->DrawBuffer->_NumColorDrawBuffers != 1) { + FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_TRUE); + return; + } + + switch ( ctx->DrawBuffer->_ColorDrawBufferIndexes[0] ) { + case BUFFER_FRONT_LEFT: VIA_FLUSH_DMA(vmesa); vmesa->drawBuffer = &vmesa->front; FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_FALSE); break; - case BUFFER_BIT_BACK_LEFT: + case BUFFER_BACK_LEFT: VIA_FLUSH_DMA(vmesa); vmesa->drawBuffer = &vmesa->back; FALLBACK(vmesa, VIA_FALLBACK_DRAW_BUFFER, GL_FALSE); @@ -1337,7 +1342,7 @@ static void viaChooseStencilState(GLcontext *ctx) { struct via_context *vmesa = VIA_CONTEXT(ctx); - if (ctx->Stencil.Enabled) { + if (ctx->Stencil._Enabled) { GLuint temp; vmesa->regEnable |= HC_HenST_MASK;