gallium: remove point_size_min and point_size_max from rasterizer state
authorRoland Scheidegger <sroland@vmware.com>
Tue, 12 Jan 2010 14:54:13 +0000 (15:54 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Tue, 12 Jan 2010 14:54:13 +0000 (15:54 +0100)
The state tracker is responsible for clamping to any graphics API enforced
size min/max limits for both the static point_size setting as well as per
vertex point size (in the vertex shader).
Note that mesa state tracker didn't actually use these values.

src/gallium/auxiliary/draw/draw_pipe_wide_point.c
src/gallium/docs/source/cso/rasterizer.rst
src/gallium/drivers/i965/brw_sf_state.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/svga/svga_context.h
src/gallium/drivers/svga/svga_pipe_rasterizer.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/drivers/svga/svga_state_rss.c
src/gallium/drivers/trace/tr_dump_state.c
src/gallium/include/pipe/p_state.h
src/mesa/state_tracker/st_atom_rasterizer.c

index 8dc50c0ab431b7fc1f6d4a04db5b06bcc12a96b9..f723e658e1a3172f589772b4245b5cdeedc7b015 100644 (file)
@@ -64,8 +64,6 @@ struct widepoint_stage {
    struct draw_stage stage;
 
    float half_point_size;
-   float point_size_min;
-   float point_size_max;
 
    float xbias;
    float ybias;
@@ -151,13 +149,6 @@ static void widepoint_point( struct draw_stage *stage,
    /* point size is either per-vertex or fixed size */
    if (wide->psize_slot >= 0) {
       half_size = header->v[0]->data[wide->psize_slot][0];
-
-      /* XXX: temporary -- do this in the vertex shader??
-       */
-      half_size = CLAMP(half_size,
-                        wide->point_size_min,
-                        wide->point_size_max);
-      
       half_size *= 0.5f; 
    }
    else {
@@ -222,8 +213,6 @@ static void widepoint_first_point( struct draw_stage *stage,
    struct draw_context *draw = stage->draw;
 
    wide->half_point_size = 0.5f * draw->rasterizer->point_size;
-   wide->point_size_min = draw->rasterizer->point_size_min;
-   wide->point_size_max = draw->rasterizer->point_size_max;
    wide->xbias = 0.0;
    wide->ybias = 0.0;
 
index 4d8e1708e7cac24cbfa38de23d546dabecaf0ba2..5ffd6007be735f06179568869568cdb1a961413c 100644 (file)
@@ -82,10 +82,6 @@ point_size_per_vertex
     Whether vertices have a point size element.
 point_size
     The size of points, if not specified per-vertex.
-point_size_min
-    The minimum size of points.
-point_size_max
-    The maximum size of points.
 point_sprite
     Whether points are drawn as sprites (textured quads)
 sprite_coord_mode
index 25dc2b52e078afed42b96cefb94e4443b4154ec2..663a688772c8100684ce650463a9a4fec87d4988 100644 (file)
@@ -126,9 +126,7 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key)
    key->point_sprite = rast->point_sprite;
    key->point_attenuated = rast->point_size_per_vertex;
 
-   key->point_size = CLAMP(rast->point_size, 
-                          rast->point_size_min, 
-                          rast->point_size_max);
+   key->point_size = rast->point_size;
 }
 
 static enum pipe_error
index 78764ddc98e74f8e6a6e91699cc01bfb7ce8f9cf..435e613ddf13575f99cfd47f1d11aa5d9ead30dc 100644 (file)
@@ -618,10 +618,12 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
     rs->point_size = pack_float_16_6x(state->point_size) |
         (pack_float_16_6x(state->point_size) << R300_POINTSIZE_X_SHIFT);
 
-    rs->point_minmax =
-        ((int)(state->point_size_min * 6.0) <<
+        /* set hw limits - clamping done by state tracker in vs or point_size
+           XXX always need to emit this? */
+        rs->point_minmax =
+        ((int)(0.0 * 6.0) <<
          R300_GA_POINT_MINMAX_MIN_SHIFT) |
-        ((int)(state->point_size_max * 6.0) <<
+        ((int)(4096.0 * 6.0) <<
          R300_GA_POINT_MINMAX_MAX_SHIFT);
 
     rs->line_control = pack_float_16_6x(state->line_width) |
index 66259fd01034a1fc9f81b247361a579e7ca7c417..e2a96034d1696fbddd416c6aab57dbed8d30abfe 100644 (file)
@@ -37,6 +37,7 @@
 
 
 #define SVGA_TEX_UNITS 8
+#define SVGA_MAX_POINTSIZE 80.0
 
 struct draw_vertex_shader;
 struct svga_shader_result;
@@ -145,8 +146,6 @@ struct svga_rasterizer_state {
    float slopescaledepthbias;
    float depthbias;
    float pointsize;
-   float pointsize_min;
-   float pointsize_max;
    
    unsigned hw_unfilled:16;         /* PIPE_POLYGON_MODE_x */
    unsigned need_pipeline:16;    /* which prims do we need help for? */
index b03f8eb9cf36a8b9ef887b41065ef4f850edfcb9..b5ecc4c56cae10f2e0145ab945190ae58b120b93 100644 (file)
@@ -88,8 +88,6 @@ svga_create_rasterizer_state(struct pipe_context *pipe,
    rast->antialiasedlineenable = templ->line_smooth;
    rast->lastpixel = templ->line_last_pixel;
    rast->pointsize = templ->point_size;
-   rast->pointsize_min = templ->point_size_min;
-   rast->pointsize_max = templ->point_size_max;
    rast->hw_unfilled = PIPE_POLYGON_MODE_FILL;
 
    /* Use swtnl + decomposition implement these:
index fc1b3c980efe2a9ea3225caf1182c7b75d9b597b..45b5d85ae22d2b4fadc74b13a42a2c6573a2071a 100644 (file)
@@ -103,7 +103,7 @@ svga_get_paramf(struct pipe_screen *screen, int param)
       /* Keep this to a reasonable size to avoid failures in
        * conform/pntaa.c:
        */
-      return 80.0;
+      return SVGA_MAX_POINTSIZE;
 
    case PIPE_CAP_MAX_TEXTURE_ANISOTROPY:
       return 4.0;
index 8b6803a285af09756d659bd4db76914844341c3f..c582e4452453c208c832f2e7ce8fe5f53c71a435 100644 (file)
@@ -196,8 +196,9 @@ static int emit_rss( struct svga_context *svga,
       EMIT_RS( svga, curr->lastpixel, LASTPIXEL, fail );
       EMIT_RS( svga, curr->linepattern, LINEPATTERN, fail );
       EMIT_RS_FLOAT( svga, curr->pointsize, POINTSIZE, fail );
-      EMIT_RS_FLOAT( svga, curr->pointsize_min, POINTSIZEMIN, fail );
-      EMIT_RS_FLOAT( svga, curr->pointsize_max, POINTSIZEMAX, fail );
+      /* XXX still need to set this? */
+      EMIT_RS_FLOAT( svga, 0.0, POINTSIZEMIN, fail );
+      EMIT_RS_FLOAT( svga, SVGA_MAX_POINTSIZE, POINTSIZEMAX, fail );
    }
 
    if (dirty & (SVGA_NEW_RAST | SVGA_NEW_FRAME_BUFFER | SVGA_NEW_NEED_PIPELINE))
index 86237e03bcc0410bd4c3c524e69dadd486866593..0e7b7ec123fe9898783657c3bbc71847602c1e1f 100644 (file)
@@ -126,8 +126,6 @@ void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state)
 
    trace_dump_member(float, state, line_width);
    trace_dump_member(float, state, point_size);
-   trace_dump_member(float, state, point_size_min);
-   trace_dump_member(float, state, point_size_max);
    trace_dump_member(float, state, offset_units);
    trace_dump_member(float, state, offset_scale);
 
index 60e96b98debb3d90690e3f5e125933285e9d5c1e..ea3ec201eaa224b74cba726f99d9d60c5421a81a 100644 (file)
@@ -141,8 +141,6 @@ struct pipe_rasterizer_state
 
    float line_width;
    float point_size;           /**< used when no per-vertex size */
-   float point_size_min;        /* XXX - temporary, will go away */
-   float point_size_max;        /* XXX - temporary, will go away */
    float offset_units;
    float offset_scale;
    ubyte sprite_coord_mode[PIPE_MAX_SHADER_OUTPUTS]; /**< PIPE_SPRITE_COORD_ */
index 36b28cb4df9dcd30d4dbf8c8916fc49b4c58b7fa..710574f3618983f6245bd549f0d9a0fd312d36e9 100644 (file)
@@ -188,9 +188,6 @@ static void update_raster_state( struct st_context *st )
     */
    raster->point_size = ctx->Point.Size;
 
-   raster->point_size_min = 0;    /* temporary, will go away */
-   raster->point_size_max = 1000; /* temporary, will go away */
-
    raster->point_smooth = ctx->Point.SmoothFlag;
    raster->point_sprite = ctx->Point.PointSprite;
    for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {