summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_state.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2008-06-30 11:12:51 -0700
committerCorbin Simpson <[email protected]>2008-06-30 11:12:51 -0700
commitbb1744970d74432692f2e109fca1dc31593605af (patch)
tree7f1bf6cef2ebb0292ae1ea3e2a4ffcecdb2d756f /src/mesa/drivers/dri/r300/r300_state.c
parent23e9b43ce4a6ad5875f69363dec7d2baa8afa2ea (diff)
r3xx/r5xx: Enable ARB_point_parameters.
This isn't complete yet. It does cover the two most common usage cases, though, and at least the third one (POINT_DISTANCE_ATTENUATION) is possible, so I'll do that later.
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_state.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index f6f0c390662..592ee9ccc10 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -827,6 +827,31 @@ static void r300PointSize(GLcontext * ctx, GLfloat size)
((int)(size * 6) << R300_POINTSIZE_Y_SHIFT);
}
+static void r300PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * param)
+{
+ r300ContextPtr r300 = R300_CONTEXT(ctx);
+
+ switch (pname) {
+ case GL_POINT_SIZE_MIN:
+ R300_STATECHANGE(r300, ga_point_minmax);
+ r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MIN_MASK;
+ r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MinSize * 16.0);
+ break;
+ case GL_POINT_SIZE_MAX:
+ R300_STATECHANGE(r300, ga_point_minmax);
+ r300->hw.ga_point_minmax.cmd[1] &= ~R300_GA_POINT_MINMAX_MAX_MASK;
+ r300->hw.ga_point_minmax.cmd[1] |= (GLuint)(ctx->Point.MaxSize * 16.0)
+ << R300_GA_POINT_MINMAX_MAX_SHIFT;
+ break;
+ case GL_POINT_DISTANCE_ATTENUATION:
+ break;
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+ break;
+ default:
+ break;
+ }
+}
+
/* =============================================================
* Line state
*/
@@ -2706,6 +2731,9 @@ void r300InitStateFuncs(struct dd_function_table *functions)
functions->FrontFace = r300FrontFace;
functions->ShadeModel = r300ShadeModel;
+ /* ARB_point_parameters */
+ functions->PointParameterfv = r300PointParameter;
+
/* Stencil related */
functions->StencilFuncSeparate = r300StencilFuncSeparate;
functions->StencilMaskSeparate = r300StencilMaskSeparate;