aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau
diff options
context:
space:
mode:
authorMatthieu Castet <[email protected]>2007-09-19 19:57:55 +0200
committerMatthieu Castet <[email protected]>2007-09-19 19:58:48 +0200
commit1310f02dee336048a0d3f94a9b34575c3f6e00a6 (patch)
tree12f267d424889e256ce7e643b81d16dd619ebec2 /src/mesa/drivers/dri/nouveau
parent45899a494c578d406b29e5ee17c0f1b6bf12c2de (diff)
nouveau : add GL_FOG_COLOR + fix a compil error
Diffstat (limited to 'src/mesa/drivers/dri/nouveau')
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state.c b/src/mesa/drivers/dri/nouveau/nv10_state.c
index 36084f3554e..99975c3d8ba 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state.c
@@ -430,11 +430,21 @@ static void nv10Enable(GLcontext *ctx, GLenum cap, GLboolean state)
static void nv10Fogfv(GLcontext *ctx, GLenum pname, const GLfloat *params)
{
nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+ GLubyte cf[4];
switch(pname)
{
case GL_FOG_MODE:
- //BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FOG_MODE, 1);
- //OUT_RING_CACHE (params);
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FOG_MODE, 1);
+ OUT_RING_CACHE (ctx->Fog.Mode); /* can we extract it from params ??? */
+ break;
+ case GL_FOG_COLOR:
+ CLAMPED_FLOAT_TO_UBYTE(cf[0], params[0]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[1], params[1]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[2], params[2]);
+ CLAMPED_FLOAT_TO_UBYTE(cf[3], params[3]);
+
+ BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_FOG_COLOR, 1);
+ OUT_RING_CACHE(PACK_COLOR_8888(cf[3], cf[1], cf[2], cf[0]));
break;
/* TODO: unsure about the rest.*/
default:
@@ -585,11 +595,12 @@ static void nv10LineWidth(GLcontext *ctx, GLfloat width)
static void nv10LogicOpcode(GLcontext *ctx, GLenum opcode)
{
+ nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
+
if (nmesa->screen->card->type < NV_11) {
return;
}
- nouveauContextPtr nmesa = NOUVEAU_CONTEXT(ctx);
BEGIN_RING_CACHE(NvSub3D, NV10_TCL_PRIMITIVE_3D_COLOR_LOGIC_OP_OP, 1);
OUT_RING_CACHE(opcode);
}