implemented vertex program point size control
This commit is contained in:
parent
363049160d
commit
571a1ac6ee
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: enable.c,v 1.53 2002/01/05 21:53:20 brianp Exp $ */
|
/* $Id: enable.c,v 1.54 2002/01/06 20:39:19 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -802,21 +802,21 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
|
||||||
CHECK_EXTENSION(NV_vertex_program);
|
CHECK_EXTENSION(NV_vertex_program);
|
||||||
if (ctx->VertexProgram.Enabled == state)
|
if (ctx->VertexProgram.Enabled == state)
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
|
FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_PROGRAM); /* XXX OK? */
|
||||||
ctx->VertexProgram.Enabled = state;
|
ctx->VertexProgram.Enabled = state;
|
||||||
break;
|
break;
|
||||||
case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
|
case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
|
||||||
CHECK_EXTENSION(NV_vertex_program);
|
CHECK_EXTENSION(NV_vertex_program);
|
||||||
if (ctx->VertexProgram.PointSizeEnabled == state)
|
if (ctx->VertexProgram.PointSizeEnabled == state)
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
|
FLUSH_VERTICES(ctx, _NEW_POINT | _NEW_PROGRAM);
|
||||||
ctx->VertexProgram.PointSizeEnabled = state;
|
ctx->VertexProgram.PointSizeEnabled = state;
|
||||||
break;
|
break;
|
||||||
case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
|
case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
|
||||||
CHECK_EXTENSION(NV_vertex_program);
|
CHECK_EXTENSION(NV_vertex_program);
|
||||||
if (ctx->VertexProgram.TwoSideEnabled == state)
|
if (ctx->VertexProgram.TwoSideEnabled == state)
|
||||||
return;
|
return;
|
||||||
FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
|
FLUSH_VERTICES(ctx, _NEW_PROGRAM); /* XXX OK? */
|
||||||
ctx->VertexProgram.TwoSideEnabled = state;
|
ctx->VertexProgram.TwoSideEnabled = state;
|
||||||
break;
|
break;
|
||||||
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
|
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: mtypes.h,v 1.59 2002/01/06 03:54:12 brianp Exp $ */
|
/* $Id: mtypes.h,v 1.60 2002/01/06 20:39:19 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -1225,6 +1225,8 @@ struct vp_program
|
||||||
GLint ErrorPos; /* Position in string where error was detected */
|
GLint ErrorPos; /* Position in string where error was detected */
|
||||||
GLint RefCount; /* Since programs can be shared among contexts */
|
GLint RefCount; /* Since programs can be shared among contexts */
|
||||||
GLboolean Resident;
|
GLboolean Resident;
|
||||||
|
GLbitfield InputsRead; /* Bitmask of which input regs are read */
|
||||||
|
GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1478,6 +1480,7 @@ struct matrix_stack
|
||||||
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
|
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
|
||||||
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
|
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
|
||||||
#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
|
#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
|
||||||
|
#define _NEW_PROGRAM 0x8000000 /* ctx->VertexProgram */
|
||||||
#define _NEW_ALL ~0
|
#define _NEW_ALL ~0
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: s_points.c,v 1.15 2001/03/12 00:48:42 gareth Exp $ */
|
/* $Id: s_points.c,v 1.16 2002/01/06 20:39:19 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -212,7 +212,7 @@ _swrast_choose_point( GLcontext *ctx )
|
||||||
else if (ctx->Point.SmoothFlag) {
|
else if (ctx->Point.SmoothFlag) {
|
||||||
/* Smooth points */
|
/* Smooth points */
|
||||||
if (rgbMode) {
|
if (rgbMode) {
|
||||||
if (ctx->Point._Attenuated) {
|
if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
|
||||||
USE(atten_antialiased_rgba_point);
|
USE(atten_antialiased_rgba_point);
|
||||||
}
|
}
|
||||||
else if (ctx->Texture._ReallyEnabled) {
|
else if (ctx->Texture._ReallyEnabled) {
|
||||||
|
@ -226,7 +226,7 @@ _swrast_choose_point( GLcontext *ctx )
|
||||||
USE(antialiased_ci_point);
|
USE(antialiased_ci_point);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ctx->Point._Attenuated) {
|
else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
|
||||||
if (rgbMode) {
|
if (rgbMode) {
|
||||||
if (ctx->Texture._ReallyEnabled) {
|
if (ctx->Texture._ReallyEnabled) {
|
||||||
if (ctx->Point.SmoothFlag) {
|
if (ctx->Point.SmoothFlag) {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: ss_vb.c,v 1.14 2001/07/17 19:39:32 keithw Exp $ */
|
/* $Id: ss_vb.c,v 1.15 2002/01/06 20:39:03 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -398,7 +398,8 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx)
|
||||||
funcindex = INDEX;
|
funcindex = INDEX;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->Point._Attenuated)
|
if (ctx->Point._Attenuated ||
|
||||||
|
(ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled))
|
||||||
funcindex |= POINT;
|
funcindex |= POINT;
|
||||||
|
|
||||||
if (ctx->Fog.Enabled)
|
if (ctx->Fog.Enabled)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: t_vb_points.c,v 1.6 2002/01/06 03:54:12 brianp Exp $ */
|
/* $Id: t_vb_points.c,v 1.7 2002/01/06 20:39:19 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -76,7 +76,7 @@ static GLboolean run_point_stage( GLcontext *ctx,
|
||||||
*/
|
*/
|
||||||
static void check_point_size( GLcontext *ctx, struct gl_pipeline_stage *d )
|
static void check_point_size( GLcontext *ctx, struct gl_pipeline_stage *d )
|
||||||
{
|
{
|
||||||
d->active = ctx->Point._Attenuated;
|
d->active = ctx->Point._Attenuated && !ctx->VertexProgram.Enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GLboolean alloc_point_data( GLcontext *ctx,
|
static GLboolean alloc_point_data( GLcontext *ctx,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: t_vb_program.c,v 1.7 2002/01/06 03:54:12 brianp Exp $ */
|
/* $Id: t_vb_program.c,v 1.8 2002/01/06 20:39:20 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
@ -141,10 +141,17 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
|
||||||
struct vp_stage_data *store = VP_STAGE_DATA(stage);
|
struct vp_stage_data *store = VP_STAGE_DATA(stage);
|
||||||
struct vertex_buffer *VB = &tnl->vb;
|
struct vertex_buffer *VB = &tnl->vb;
|
||||||
struct vp_machine *machine = &(ctx->VertexProgram.Machine);
|
struct vp_machine *machine = &(ctx->VertexProgram.Machine);
|
||||||
|
struct vp_program *program = ctx->VertexProgram.Current;
|
||||||
GLint i;
|
GLint i;
|
||||||
|
|
||||||
_mesa_init_tracked_matrices(ctx);
|
_mesa_init_tracked_matrices(ctx);
|
||||||
_mesa_init_vp_registers(ctx); /* init temp and result regs */
|
_mesa_init_vp_registers(ctx); /* init temp and result regs */
|
||||||
|
/* XXX if GL_FOG is enabled but the program doesn't write to the
|
||||||
|
* o[FOGC] register, set the fog result to 1.0
|
||||||
|
*/
|
||||||
|
/* XXX if GL_VERTEX_PROGRAM_POINT_SIZE_NV is enabled but the program
|
||||||
|
* doesn't write the PSIZ variable then use ctx->Point.Size
|
||||||
|
*/
|
||||||
|
|
||||||
for (i = 0; i < VB->Count; i++) {
|
for (i = 0; i < VB->Count; i++) {
|
||||||
GLuint attr;
|
GLuint attr;
|
||||||
|
@ -176,8 +183,8 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* execute the program */
|
/* execute the program */
|
||||||
ASSERT(ctx->VertexProgram.Current);
|
ASSERT(program);
|
||||||
_mesa_exec_program(ctx, ctx->VertexProgram.Current);
|
_mesa_exec_program(ctx, program);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printf("Output %d: %f, %f, %f, %f\n", i,
|
printf("Output %d: %f, %f, %f, %f\n", i,
|
||||||
|
@ -190,6 +197,8 @@ static GLboolean run_vp( GLcontext *ctx, struct gl_pipeline_stage *stage )
|
||||||
machine->Registers[VP_OUT_COL0][1],
|
machine->Registers[VP_OUT_COL0][1],
|
||||||
machine->Registers[VP_OUT_COL0][2],
|
machine->Registers[VP_OUT_COL0][2],
|
||||||
machine->Registers[VP_OUT_COL0][3]);
|
machine->Registers[VP_OUT_COL0][3]);
|
||||||
|
printf("PointSize[%d]: %g\n", i,
|
||||||
|
machine->Registers[VP_OUTPUT_REG_START + VERT_RESULT_PSIZ][0]);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* copy the output registers into the VB->attribs arrays */
|
/* copy the output registers into the VB->attribs arrays */
|
||||||
|
|
Loading…
Reference in New Issue