-/* $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
CHECK_EXTENSION(NV_vertex_program);
if (ctx->VertexProgram.Enabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM | _NEW_PROGRAM); /* XXX OK? */
ctx->VertexProgram.Enabled = state;
break;
case GL_VERTEX_PROGRAM_POINT_SIZE_NV:
CHECK_EXTENSION(NV_vertex_program);
if (ctx->VertexProgram.PointSizeEnabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
+ FLUSH_VERTICES(ctx, _NEW_POINT | _NEW_PROGRAM);
ctx->VertexProgram.PointSizeEnabled = state;
break;
case GL_VERTEX_PROGRAM_TWO_SIDE_NV:
CHECK_EXTENSION(NV_vertex_program);
if (ctx->VertexProgram.TwoSideEnabled == state)
return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM); /* XXX OK? */
+ FLUSH_VERTICES(ctx, _NEW_PROGRAM); /* XXX OK? */
ctx->VertexProgram.TwoSideEnabled = state;
break;
case GL_MAP1_VERTEX_ATTRIB0_4_NV:
-/* $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
GLint ErrorPos; /* Position in string where error was detected */
GLint RefCount; /* Since programs can be shared among contexts */
GLboolean Resident;
+ GLbitfield InputsRead; /* Bitmask of which input regs are read */
+ GLbitfield OutputsWritten; /* Bitmask of which output regs are written to */
};
#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
#define _NEW_TRACK_MATRIX 0x4000000 /* ctx->VertexProgram */
+#define _NEW_PROGRAM 0x8000000 /* ctx->VertexProgram */
#define _NEW_ALL ~0
-/* $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
else if (ctx->Point.SmoothFlag) {
/* Smooth points */
if (rgbMode) {
- if (ctx->Point._Attenuated) {
+ if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
USE(atten_antialiased_rgba_point);
}
else if (ctx->Texture._ReallyEnabled) {
USE(antialiased_ci_point);
}
}
- else if (ctx->Point._Attenuated) {
+ else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
if (rgbMode) {
if (ctx->Texture._ReallyEnabled) {
if (ctx->Point.SmoothFlag) {
-/* $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
funcindex = INDEX;
}
- if (ctx->Point._Attenuated)
+ if (ctx->Point._Attenuated ||
+ (ctx->VertexProgram.Enabled && ctx->VertexProgram.PointSizeEnabled))
funcindex |= POINT;
if (ctx->Fog.Enabled)
-/* $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
*/
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,
-/* $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
struct vp_stage_data *store = VP_STAGE_DATA(stage);
struct vertex_buffer *VB = &tnl->vb;
struct vp_machine *machine = &(ctx->VertexProgram.Machine);
+ struct vp_program *program = ctx->VertexProgram.Current;
GLint i;
_mesa_init_tracked_matrices(ctx);
_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++) {
GLuint attr;
}
/* execute the program */
- ASSERT(ctx->VertexProgram.Current);
- _mesa_exec_program(ctx, ctx->VertexProgram.Current);
+ ASSERT(program);
+ _mesa_exec_program(ctx, program);
#if 0
printf("Output %d: %f, %f, %f, %f\n", i,
machine->Registers[VP_OUT_COL0][1],
machine->Registers[VP_OUT_COL0][2],
machine->Registers[VP_OUT_COL0][3]);
+ printf("PointSize[%d]: %g\n", i,
+ machine->Registers[VP_OUTPUT_REG_START + VERT_RESULT_PSIZ][0]);
#endif
/* copy the output registers into the VB->attribs arrays */