-/* $Id: glapi.c,v 1.53 2001/03/28 17:39:12 brianp Exp $ */
+/* $Id: glapi.c,v 1.54 2001/05/29 15:23:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
#else
#define NAME(X) (GLvoid *) NotImplemented
#endif
- { "glSamplePassARB", NAME(glSamplePassARB), _gloffset_SamplePassARB },
{ "glSampleCoverageARB", NAME(glSampleCoverageARB), _gloffset_SampleCoverageARB },
#undef NAME
-/* $Id: attrib.c,v 1.50 2001/05/03 14:11:18 brianp Exp $ */
+/* $Id: attrib.c,v 1.51 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
attr->RescaleNormals = ctx->Transform.RescaleNormals;
attr->Scissor = ctx->Scissor.Enabled;
attr->Stencil = ctx->Stencil.Enabled;
+ attr->MultisampleEnabled = ctx->Multisample.Enabled;
+ attr->SampleAlphaToCoverage = ctx->Multisample.SampleAlphaToCoverage;
+ attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne;
+ attr->SampleCoverage = ctx->Multisample.SampleCoverage;
+ attr->SampleCoverageInvert = ctx->Multisample.SampleCoverageInvert;
for (i=0; i<MAX_TEXTURE_UNITS; i++) {
attr->Texture[i] = ctx->Texture.Unit[i].Enabled;
attr->TexGen[i] = ctx->Texture.Unit[i].TexGenEnabled;
head = newnode;
}
+ /* GL_ARB_multisample */
+ if (mask & GL_MULTISAMPLE_BIT_ARB) {
+ struct gl_multisample_attrib *attr;
+ attr = MALLOC_STRUCT( gl_multisample_attrib );
+ MEMCPY( attr, &ctx->Multisample, sizeof(struct gl_multisample_attrib) );
+ newnode = new_attrib_node( GL_MULTISAMPLE_BIT_ARB );
+ newnode->data = attr;
+ newnode->next = head;
+ head = newnode;
+ }
+
ctx->AttribStack[ctx->AttribStackDepth] = head;
ctx->AttribStackDepth++;
}
GL_POLYGON_STIPPLE);
TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST);
TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST);
+ TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled,
+ GL_MULTISAMPLE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage,
+ enable->SampleAlphaToCoverage,
+ GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToOne,
+ enable->SampleAlphaToOne,
+ GL_SAMPLE_ALPHA_TO_ONE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleCoverage,
+ enable->SampleCoverage,
+ GL_SAMPLE_COVERAGE_ARB);
+ TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
+ enable->SampleCoverageInvert,
+ GL_SAMPLE_COVERAGE_INVERT_ARB);
#undef TEST_AND_UPDATE
/* texture unit enables */
case GL_VIEWPORT_BIT:
{
const struct gl_viewport_attrib *vp;
- vp = (const struct gl_viewport_attrib *)attr->data;
+ vp = (const struct gl_viewport_attrib *) attr->data;
_mesa_Viewport(vp->X, vp->Y, vp->Width, vp->Height);
_mesa_DepthRange(vp->Near, vp->Far);
}
break;
+ case GL_MULTISAMPLE_BIT_ARB:
+ {
+ const struct gl_multisample_attrib *ms;
+ ms = (const struct gl_multisample_attrib *) attr->data;
+ _mesa_SampleCoverageARB(ms->SampleCoverageValue,
+ ms->SampleCoverageInvert);
+ }
+ break;
+
default:
_mesa_problem( ctx, "Bad attrib flag in PopAttrib");
break;
-/* $Id: buffers.c,v 1.28 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: buffers.c,v 1.29 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Driver.ResizeBuffersMESA( ctx );
}
+
+
+/*
+ * XXX move somewhere else someday?
+ */
+void
+_mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
+{
+ GLcontext *ctx = _mesa_get_current_context();
+
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glSampleCoverageARB");
+ return;
+ }
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
+ ctx->Multisample.SampleCoverageValue = CLAMP(value, 0.0, 1.0);
+ ctx->Multisample.SampleCoverageInvert = invert;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+}
+
-/* $Id: buffers.h,v 1.3 2001/03/12 00:48:37 gareth Exp $ */
+/* $Id: buffers.h,v 1.4 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
extern void
_mesa_ResizeBuffersMESA( void );
+extern void
+_mesa_SampleCoverageARB(GLclampf value, GLboolean invert);
+
#endif
-/* $Id: context.c,v 1.138 2001/05/21 16:41:03 brianp Exp $ */
+/* $Id: context.c,v 1.139 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Display List group */
ctx->List.ListBase = 0;
+ /* Multisample */
+ ctx->Multisample.Enabled = GL_FALSE;
+ ctx->Multisample.SampleAlphaToCoverage = GL_FALSE;
+ ctx->Multisample.SampleAlphaToOne = GL_FALSE;
+ ctx->Multisample.SampleCoverage = GL_FALSE;
+ ctx->Multisample.SampleCoverageValue = 1.0;
+ ctx->Multisample.SampleCoverageInvert = GL_FALSE;
+
/* Pixel group */
ctx->Pixel.RedBias = 0.0;
ctx->Pixel.RedScale = 1.0;
-/* $Id: dlist.c,v 1.71 2001/05/14 08:57:36 keithw Exp $ */
+/* $Id: dlist.c,v 1.72 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
+ /* GL_ARB_multisample */
+ OPCODE_SAMPLE_COVERAGE,
/* The following three are meta instructions */
OPCODE_ERROR, /* raise compiled-in error */
OPCODE_CONTINUE,
InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D] = 8;
InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D] = 10;
InstSize[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D] = 12;
+ /* GL_ARB_multisample */
+ InstSize[OPCODE_SAMPLE_COVERAGE] = 3;
/* GL_ARB_multitexture */
InstSize[OPCODE_ACTIVE_TEXTURE] = 2;
InstSize[OPCODE_CLIENT_ACTIVE_TEXTURE] = 2;
}
+/* GL_ARB_multisample */
+static void
+save_SampleCoverageARB(GLclampf value, GLboolean invert)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ Node *n;
+ ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
+ n = ALLOC_INSTRUCTION( ctx, OPCODE_SAMPLE_COVERAGE, 2 );
+ if (n) {
+ n[1].f = value;
+ n[2].b = invert;
+ }
+ if (ctx->ExecuteFlag) {
+ (*ctx->Exec->SampleCoverageARB)( value, invert );
+ }
+}
+
+
/* GL_SGIS_pixel_texture */
static void
n[4].i, n[5].i, n[6].i, n[7].i, n[8].i,
n[9].e, n[10].i, n[11].data);
break;
+ case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
+ (*ctx->Exec->SampleCoverageARB)(n[1].f, n[2].b);
+ break;
case OPCODE_CONTINUE:
n = (Node *) n[1].next;
break;
table->MultTransposeMatrixdARB = save_MultTransposeMatrixdARB;
table->MultTransposeMatrixfARB = save_MultTransposeMatrixfARB;
+ /* GL_ARB_multisample */
+ table->SampleCoverageARB = save_SampleCoverageARB;
+
/* ARB 12. GL_ARB_texture_compression */
table->CompressedTexImage3DARB = save_CompressedTexImage3DARB;
table->CompressedTexImage2DARB = save_CompressedTexImage2DARB;
-/* $Id: enable.c,v 1.48 2001/03/29 21:16:25 keithw Exp $ */
+/* $Id: enable.c,v 1.49 2001/05/29 15:23:48 brianp Exp $ */
/*
* Mesa 3-D graphics library
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.Enabled == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.Enabled = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleAlphaToCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToCoverage = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleAlphaToOne == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleAlphaToOne = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleCoverage == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverage = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (!ctx->Extensions.ARB_multisample) {
+ _mesa_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
+ return;
+ }
+ if (ctx->Multisample.SampleCoverageInvert == state)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
+ ctx->Multisample.SampleCoverageInvert = state;
+ ctx->NewState |= _NEW_MULTISAMPLE;
+ break;
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (!ctx->Extensions.MESA_sprite_point) {
return GL_FALSE;
}
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ return ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");
+ return GL_FALSE;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
return ctx->Point.SpriteMode;
-/* $Id: extensions.c,v 1.60 2001/05/24 14:47:56 brianp Exp $ */
+/* $Id: extensions.c,v 1.61 2001/05/29 15:23:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
int flag_offset;
} default_extensions[] = {
{ OFF, "GL_ARB_imaging", F(ARB_imaging) },
+ { OFF, "GL_ARB_multisample", F(ARB_multisample) },
{ OFF, "GL_ARB_multitexture", F(ARB_multitexture) },
{ OFF, "GL_ARB_texture_border_clamp", F(ARB_texture_border_clamp) },
{ OFF, "GL_ARB_texture_compression", F(ARB_texture_compression) },
-/* $Id: get.c,v 1.60 2001/05/21 16:41:03 brianp Exp $ */
+/* $Id: get.c,v 1.61 2001/05/29 15:23:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = FLOAT_TO_BOOL(ctx->Multisample.SampleCoverageValue);
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLE_BUFFERS_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+ case GL_SAMPLES_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetBooleanv");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
}
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLdouble) ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLdouble) ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLdouble) ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleCoverageValue;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLdouble) ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLE_BUFFERS_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0.0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+ case GL_SAMPLES_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0.0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetDoublev");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
}
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLfloat) ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLfloat) ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLfloat) ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = ctx->Multisample.SampleCoverageValue;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLfloat) ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLE_BUFFERS_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0.0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+ case GL_SAMPLES_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0.0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetFloatv");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
}
break;
+ /* GL_ARB_multisample */
+ case GL_MULTISAMPLE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.Enabled;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.SampleAlphaToCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_ALPHA_TO_ONE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.SampleAlphaToOne;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.SampleCoverage;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_VALUE_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.SampleCoverageValue;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_COVERAGE_INVERT_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = (GLint) ctx->Multisample.SampleCoverageInvert;
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLE_BUFFERS_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+ case GL_SAMPLES_ARB:
+ if (ctx->Extensions.ARB_multisample) {
+ *params = 0; /* XXX fix someday */
+ }
+ else {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glGetIntegerv");
+ return;
+ }
+
/* GL_MESA_sprite_point */
case GL_SPRITE_POINT_MESA:
if (ctx->Extensions.MESA_sprite_point) {
-/* $Id: mtypes.h,v 1.42 2001/05/21 16:41:03 brianp Exp $ */
+/* $Id: mtypes.h,v 1.43 2001/05/29 15:23:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLboolean RescaleNormals;
GLboolean Scissor;
GLboolean Stencil;
+ GLboolean MultisampleEnabled; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */
+ GLboolean SampleAlphaToOne; /* GL_ARB_multisample */
+ GLboolean SampleCoverage; /* GL_ARB_multisample */
+ GLboolean SampleCoverageInvert; /* GL_ARB_multisample */
GLuint Texture[MAX_TEXTURE_UNITS];
GLuint TexGen[MAX_TEXTURE_UNITS];
};
GLuint nr_opcodes;
};
+
+struct gl_multisample_attrib {
+ GLboolean Enabled;
+ GLboolean SampleAlphaToCoverage;
+ GLboolean SampleAlphaToOne;
+ GLboolean SampleCoverage;
+ GLfloat SampleCoverageValue;
+ GLboolean SampleCoverageInvert;
+};
+
+
struct gl_pixel_attrib {
GLenum ReadBuffer; /* src buffer for glRead/CopyPixels */
GLenum DriverReadBuffer; /* Driver's current source buffer */
* Not every extension needs to have such a flag, but it's encouraged.
*/
GLboolean ARB_imaging;
+ GLboolean ARB_multisample;
GLboolean ARB_multitexture;
GLboolean ARB_texture_border_clamp;
GLboolean ARB_texture_compression;
#define _NEW_FOG 0x100 /* ctx->Fog */
#define _NEW_HINT 0x200 /* ctx->Hint */
#define _NEW_LIGHT 0x400 /* ctx->Light */
-#define _NEW_LINE 0x800 /* ctx->Line */
+#define _NEW_LINE 0x800 /* ctx->Line */
#define _NEW_PIXEL 0x1000 /* ctx->Pixel */
-#define _NEW_POINT 0x2000 /* ctx->Point */
-#define _NEW_POLYGON 0x4000 /* ctx->Polygon */
-#define _NEW_POLYGONSTIPPLE 0x8000 /* ctx->PolygonStipple */
+#define _NEW_POINT 0x2000 /* ctx->Point */
+#define _NEW_POLYGON 0x4000 /* ctx->Polygon */
+#define _NEW_POLYGONSTIPPLE 0x8000 /* ctx->PolygonStipple */
#define _NEW_SCISSOR 0x10000 /* ctx->Scissor */
-#define _NEW_STENCIL 0x20000 /* ctx->Stencil */
-#define _NEW_TEXTURE 0x40000 /* ctx->Texture */
-#define _NEW_TRANSFORM 0x80000 /* ctx->Transform */
+#define _NEW_STENCIL 0x20000 /* ctx->Stencil */
+#define _NEW_TEXTURE 0x40000 /* ctx->Texture */
+#define _NEW_TRANSFORM 0x80000 /* ctx->Transform */
#define _NEW_VIEWPORT 0x100000 /* ctx->Viewport */
-#define _NEW_PACKUNPACK 0x200000 /* ctx->Pack, ctx->Unpack */
-#define _NEW_ARRAY 0x400000 /* ctx->Array */
-#define _NEW_RENDERMODE 0x800000 /* RenderMode, Feedback, Select */
-#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
-
+#define _NEW_PACKUNPACK 0x200000 /* ctx->Pack, ctx->Unpack */
+#define _NEW_ARRAY 0x400000 /* ctx->Array */
+#define _NEW_RENDERMODE 0x800000 /* RenderMode, Feedback, Select */
+#define _NEW_BUFFERS 0x1000000 /* ctx->Visual, ctx->DrawBuffer, */
+#define _NEW_MULTISAMPLE 0x2000000 /* ctx->Multisample */
#define _NEW_ALL ~0
struct gl_light_attrib Light;
struct gl_line_attrib Line;
struct gl_list_attrib List;
+ struct gl_multisample_attrib Multisample;
struct gl_pixel_attrib Pixel;
struct gl_point_attrib Point;
struct gl_polygon_attrib Polygon;
-/* $Id: state.c,v 1.65 2001/05/10 15:42:43 keithw Exp $ */
+/* $Id: state.c,v 1.66 2001/05/29 15:23:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
exec->MultTransposeMatrixdARB = _mesa_MultTransposeMatrixdARB;
exec->MultTransposeMatrixfARB = _mesa_MultTransposeMatrixfARB;
+ /* ARB 5. GL_ARB_multisample */
+ exec->SampleCoverageARB = _mesa_SampleCoverageARB;
+
/* ARB 12. GL_ARB_texture_compression */
exec->CompressedTexImage3DARB = _mesa_CompressedTexImage3DARB;
exec->CompressedTexImage2DARB = _mesa_CompressedTexImage2DARB;