X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fsis%2Fsis_texstate.c;h=daec2393211b3809cd0241aceebbfbbcab59032e;hb=cd6a31cd4a9ea6deef4778c2eaef2d47240c3a6e;hp=63f23fc01494ed4afa422cbca866a658087f83f9;hpb=87a6fe57e85ea5f273e808211a0e61d2b837b8e2;p=mesa.git diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 63f23fc0149..daec2393211 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -36,10 +36,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/colormac.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "sis_context.h" -#include "sis_state.h" #include "sis_tex.h" #include "sis_tris.h" #include "sis_alloc.h" @@ -48,7 +46,7 @@ static GLint TransferTexturePitch (GLint dwPitch); /* Handle texenv stuff, called from validate_texture (renderstart) */ static void -sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, +sis_set_texture_env0( struct gl_context *ctx, struct gl_texture_object *texObj, int unit ) { sisContextPtr smesa = SIS_CONTEXT(ctx); @@ -184,7 +182,7 @@ sis_set_texture_env0( GLcontext *ctx, struct gl_texture_object *texObj, /* Handle texenv stuff, called from validate_texture (renderstart) */ static void -sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, +sis_set_texture_env1( struct gl_context *ctx, struct gl_texture_object *texObj, int unit) { sisContextPtr smesa = SIS_CONTEXT(ctx); @@ -320,7 +318,7 @@ sis_set_texture_env1( GLcontext *ctx, struct gl_texture_object *texObj, /* Returns 0 if a software fallback is necessary */ static GLboolean -sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, +sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, int hw_unit ) { sisContextPtr smesa = SIS_CONTEXT(ctx); @@ -456,11 +454,16 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, break; } - current->texture[hw_unit].hwTextureBorderColor = - ((GLuint) texObj->_BorderChan[3] << 24) + - ((GLuint) texObj->_BorderChan[0] << 16) + - ((GLuint) texObj->_BorderChan[1] << 8) + - ((GLuint) texObj->_BorderChan[2]); + { + GLubyte c[4]; + CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor.f[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor.f[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]); + + current->texture[hw_unit].hwTextureBorderColor = + PACK_COLOR_8888(c[3], c[0], c[1], c[2]); + } if (current->texture[hw_unit].hwTextureBorderColor != prev->texture[hw_unit].hwTextureBorderColor) @@ -580,7 +583,7 @@ sis_set_texobj_parm( GLcontext *ctx, struct gl_texture_object *texObj, /* Disable a texture unit, called from validate_texture */ static void -sis_reset_texture_env (GLcontext *ctx, int hw_unit) +sis_reset_texture_env (struct gl_context *ctx, int hw_unit) { sisContextPtr smesa = SIS_CONTEXT(ctx); @@ -617,7 +620,7 @@ sis_reset_texture_env (GLcontext *ctx, int hw_unit) } } -static void updateTextureUnit( GLcontext *ctx, int unit ) +static void updateTextureUnit( struct gl_context *ctx, int unit ) { sisContextPtr smesa = SIS_CONTEXT( ctx ); const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; @@ -653,7 +656,7 @@ static void updateTextureUnit( GLcontext *ctx, int unit ) } -void sisUpdateTextureState( GLcontext *ctx ) +void sisUpdateTextureState( struct gl_context *ctx ) { sisContextPtr smesa = SIS_CONTEXT( ctx ); int i;