diff options
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_state.c | 14 | ||||
-rw-r--r-- | src/mesa/drivers/dri/unichrome/via_texstate.c | 18 |
2 files changed, 18 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 88eb011d5c9..61000f228aa 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -88,13 +88,17 @@ static void viaAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref) vmesa = vmesa; } -static void viaBlendEquation(GLcontext *ctx, GLenum mode) +static void viaBlendEquationSeparate(GLcontext *ctx, GLenum rgbMode, GLenum aMode) { #ifdef DEBUG if (VIA_DEBUG) fprintf(stderr, "%s in\n", __FUNCTION__); #endif + + /* GL_EXT_blend_equation_separate not supported */ + ASSERT(rgbMode == aMode); + /* Can only do GL_ADD equation in hardware */ - FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_BLEND_EQ, mode != GL_FUNC_ADD_EXT); + FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_BLEND_EQ, rgbMode != GL_FUNC_ADD_EXT); /* BlendEquation sets ColorLogicOpEnabled in an unexpected * manner. @@ -522,7 +526,7 @@ void viaChooseTextureState(GLcontext *ctx) if (texUnit0->_ReallyEnabled) { struct gl_texture_object *texObj = texUnit0->_Current; - struct gl_texture_image *texImage = texObj->Image[0]; + struct gl_texture_image *texImage = texObj->Image[0][0]; GLint r, g, b, a; #ifdef DEBUG if (VIA_DEBUG) fprintf(stderr, "texUnit0->_ReallyEnabled\n"); @@ -3079,7 +3083,7 @@ void viaChooseTextureState(GLcontext *ctx) if (texUnit1->_ReallyEnabled) { struct gl_texture_object *texObj = texUnit1->_Current; - struct gl_texture_image *texImage = texObj->Image[0]; + struct gl_texture_image *texImage = texObj->Image[0][0]; GLint r, g, b, a; if (texImage->Border) { @@ -6334,7 +6338,7 @@ void viaInitStateFuncs(GLcontext *ctx) /* API callbacks */ ctx->Driver.AlphaFunc = viaAlphaFunc; - ctx->Driver.BlendEquation = viaBlendEquation; + ctx->Driver.BlendEquationSeparate = viaBlendEquationSeparate; //ctx->Driver.BlendFunc = viaBlendFunc; ctx->Driver.BlendFuncSeparate = viaBlendFuncSeparate; ctx->Driver.ClearColor = viaClearColor; diff --git a/src/mesa/drivers/dri/unichrome/via_texstate.c b/src/mesa/drivers/dri/unichrome/via_texstate.c index fb83fcfe612..4e2c49e59d8 100644 --- a/src/mesa/drivers/dri/unichrome/via_texstate.c +++ b/src/mesa/drivers/dri/unichrome/via_texstate.c @@ -159,7 +159,7 @@ static void viaSetTexImages(viaContextPtr vmesa, { GLuint texFormat; viaTextureObjectPtr t = (viaTextureObjectPtr)tObj->DriverData; - const struct gl_texture_image *baseImage = tObj->Image[tObj->BaseLevel]; + const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel]; GLint firstLevel, lastLevel, numLevels; GLint log2Width, log2Height, log2Pitch; GLint (*texSize)[12][12]; @@ -240,13 +240,13 @@ static void viaSetTexImages(viaContextPtr vmesa, t->lastLevel = firstLevel + 9; } - log2Width = tObj->Image[firstLevel]->WidthLog2; - log2Height = tObj->Image[firstLevel]->HeightLog2; - log2Pitch = logbase2(tObj->Image[firstLevel]->Width * baseImage->TexFormat->TexelBytes); + log2Width = tObj->Image[0][firstLevel]->WidthLog2; + log2Height = tObj->Image[0][firstLevel]->HeightLog2; + log2Pitch = logbase2(tObj->Image[0][firstLevel]->Width * baseImage->TexFormat->TexelBytes); for (i = 0; i < numLevels; i++) { - t->image[i].image = tObj->Image[i]; + t->image[i].image = tObj->Image[0][i]; t->image[i].internalFormat = baseImage->Format; } @@ -539,7 +539,7 @@ static void viaUpdateTexEnv(GLcontext *ctx, GLuint unit) { const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; const struct gl_texture_object *tObj = texUnit->_Current; - const GLuint format = tObj->Image[tObj->BaseLevel]->Format; + const GLuint format = tObj->Image[0][tObj->BaseLevel]->Format; GLuint color_combine, alpha_combine; #ifdef DEBUG if (VIA_DEBUG) fprintf(stderr, "%s - in\n", __FUNCTION__); @@ -676,7 +676,7 @@ static void viaUpdateTexUnit(GLcontext *ctx, GLuint unit) } } - if (tObj->Image[tObj->BaseLevel]->Border > 0) { + if (tObj->Image[0][tObj->BaseLevel]->Border > 0) { FALLBACK(vmesa, VIA_FALLBACK_TEXTURE, GL_TRUE); return; } @@ -693,8 +693,8 @@ static void viaUpdateTexUnit(GLcontext *ctx, GLuint unit) /* Update texture environment if texture object image format or * texture environment state has changed. */ - if (tObj->Image[tObj->BaseLevel]->Format != vmesa->TexEnvImageFmt[unit]) { - vmesa->TexEnvImageFmt[unit] = tObj->Image[tObj->BaseLevel]->Format; + if (tObj->Image[0][tObj->BaseLevel]->Format != vmesa->TexEnvImageFmt[unit]) { + vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->Format; viaUpdateTexEnv(ctx, unit); } } |