summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAapo Tahkola <aet@rasterburn.org>2005-02-19 16:30:56 +0000
committerAapo Tahkola <aet@rasterburn.org>2005-02-19 16:30:56 +0000
commit35bc4ac68062afeae17f96b8f4173a599cfc7f05 (patch)
tree6dd0824d71cd13a8bbad916259435fcafa141286
parentff3ce3dd96376d61e245cb5c34d320128b8f95a8 (diff)
Minor fix to border and blend color.
-rw-r--r--src/mesa/drivers/dri/r300/r300_context.h13
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c2
3 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index 18dc9d1910..ae9711d551 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -716,6 +716,19 @@ struct r300_context {
#define R300_CONTEXT(ctx) ((r300ContextPtr)(ctx->DriverCtx))
+static __inline GLuint r300PackColor( GLuint cpp,
+ GLubyte r, GLubyte g,
+ GLubyte b, GLubyte a )
+{
+ switch ( cpp ) {
+ case 2:
+ return PACK_COLOR_565( r, g, b );
+ case 4:
+ return PACK_COLOR_8888( r, g, b, a );
+ default:
+ return 0;
+ }
+}
extern void r300DestroyContext(__DRIcontextPrivate * driContextPriv);
extern GLboolean r300CreateContext(const __GLcontextModes * glVisual,
__DRIcontextPrivate * driContextPriv,
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index a386564f76..3646507c3f 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -119,7 +119,7 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4])
CLAMPED_FLOAT_TO_UBYTE(color[2], cf[2]);
CLAMPED_FLOAT_TO_UBYTE(color[3], cf[3]);
- rmesa->hw.unk4E10.cmd[1]=radeonPackColor(4, color[0], color[1], color[2], color[3]);
+ rmesa->hw.unk4E10.cmd[1]=r300PackColor(4, color[0], color[1], color[2], color[3]);
//fprintf(stderr, "%s:%s is not implemented yet. Fixme !\n", __FILE__, __FUNCTION__);
#if 0
R200_STATECHANGE(rmesa, ctx);
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index 000b7be0b0..c3010d3ceb 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -267,7 +267,7 @@ static void r300SetTexFilter(r300TexObjPtr t, GLenum minf, GLenum magf)
static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
{
- t->pp_border_color = radeonPackColor(4, c[3], c[2], c[1], c[0]);
+ t->pp_border_color = r300PackColor(4, c[0], c[1], c[2], c[3]);
}
/**