summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_tcl.c
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2006-10-13 22:10:05 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2006-10-13 22:10:05 +0000
commitcb977ae5f4c9fab5753c04bfdd8736978ad4feee (patch)
tree1f38b694427bb1021da66f6dee020af67b880c3d /src/mesa/drivers/dri/r200/r200_tcl.c
parent40b88fd1f3dedd0137b170a7272854e2bf4c3210 (diff)
implement ARB_point_parameters and ARB_point_sprite on r200. The code is nearly the same as outlined in bug #4707, except it disables perspective correction for point sprites to make them actually work. And, separate the state atom into two as the tcl parameters would overwrite vertex program parameters when active. Also implement the GL_VERTEX_PROGRAM_POINT_SIZE_ARB option to make vertex programs outputting a point size work correctly (untested). Smooth points will still always be size 1. While here, enable gouraud shading for fog when using fog coord.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_tcl.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_tcl.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 18b5458a97..8f50cd99ad 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -68,7 +68,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define HAVE_ELTS 1
-#define HW_POINTS ((ctx->_TriangleCaps & DD_POINT_SIZE) ? \
+#define HW_POINTS ((ctx->Point.PointSprite || \
+ ((ctx->_TriangleCaps & (DD_POINT_SIZE | DD_POINT_ATTEN)) && \
+ !(ctx->_TriangleCaps & (DD_POINT_SMOOTH)))) ? \
R200_VF_PRIM_POINT_SPRITES : R200_VF_PRIM_POINTS)
#define HW_LINES R200_VF_PRIM_LINES
#define HW_LINE_LOOP 0
@@ -268,6 +270,17 @@ void r200TclPrimitive( GLcontext *ctx,
if (newprim != rmesa->tcl.hw_primitive ||
!discrete_prim[hw_prim&0xf]) {
+ /* need to disable perspective-correct texturing for point sprites */
+ if ((prim & PRIM_MODE_MASK) == GL_POINTS && ctx->Point.PointSprite) {
+ if (rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] &= ~R200_PERSPECTIVE_ENABLE;
+ }
+ }
+ else if (!(rmesa->hw.set.cmd[SET_RE_CNTL] & R200_PERSPECTIVE_ENABLE)) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] |= R200_PERSPECTIVE_ENABLE;
+ }
R200_NEWPRIM( rmesa );
rmesa->tcl.hw_primitive = newprim;
}
@@ -447,7 +460,7 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx,
out_vtxfmt0 |= R200_VTX_FP_RGBA << R200_VTX_COLOR_1_SHIFT;
out_compsel |= R200_OUTPUT_COLOR_1;
}
- /* FIXME: probably not everything is set up for fogc and psiz to work correctly */
+ /* FIXME: probably not everything is set up for fogc to work correctly */
if (vp_out & (1 << VERT_RESULT_FOGC)) {
out_vtxfmt0 |= R200_VTX_DISCRETE_FOG;
out_compsel |= R200_OUTPUT_DISCRETE_FOG;