summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_wide_point.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_wide_point.c28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index 8dc50c0ab4..fdabce7d44 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -64,15 +64,14 @@ struct widepoint_stage {
struct draw_stage stage;
float half_point_size;
- float point_size_min;
- float point_size_max;
float xbias;
float ybias;
uint texcoord_slot[PIPE_MAX_SHADER_OUTPUTS];
- uint texcoord_mode[PIPE_MAX_SHADER_OUTPUTS];
+ uint texcoord_enable[PIPE_MAX_SHADER_OUTPUTS];
uint num_texcoords;
+ uint texcoord_mode;
int psize_slot;
@@ -98,10 +97,10 @@ static void set_texcoords(const struct widepoint_stage *wide,
{
uint i;
for (i = 0; i < wide->num_texcoords; i++) {
- if (wide->texcoord_mode[i] != PIPE_SPRITE_COORD_NONE) {
+ if (wide->texcoord_enable[i]) {
uint j = wide->texcoord_slot[i];
v->data[j][0] = tc[0];
- if (wide->texcoord_mode[i] == PIPE_SPRITE_COORD_LOWER_LEFT)
+ if (wide->texcoord_mode == PIPE_SPRITE_COORD_LOWER_LEFT)
v->data[j][1] = 1.0f - tc[1];
else
v->data[j][1] = tc[1];
@@ -129,9 +128,10 @@ static void set_texcoords(const struct widepoint_stage *wide,
static void widepoint_point( struct draw_stage *stage,
struct prim_header *header )
{
+ /* XXX should take point_quad_rasterization into account? */
const struct widepoint_stage *wide = widepoint_stage(stage);
const unsigned pos = draw_current_shader_position_output(stage->draw);
- const boolean sprite = (boolean) stage->draw->rasterizer->point_sprite;
+ const boolean sprite = (boolean) stage->draw->rasterizer->sprite_coord_enable;
float half_size;
float left_adj, right_adj, bot_adj, top_adj;
@@ -151,13 +151,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 +215,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;
@@ -233,21 +224,22 @@ static void widepoint_first_point( struct draw_stage *stage,
/* XXX we won't know the real size if it's computed by the vertex shader! */
if ((draw->rasterizer->point_size > draw->pipeline.wide_point_threshold) ||
- (draw->rasterizer->point_sprite && draw->pipeline.point_sprite)) {
+ (draw->rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)) {
stage->point = widepoint_point;
}
else {
stage->point = draw_pipe_passthrough_point;
}
- if (draw->rasterizer->point_sprite) {
+ if (draw->rasterizer->sprite_coord_enable) {
/* find vertex shader texcoord outputs */
const struct draw_vertex_shader *vs = draw->vs.vertex_shader;
uint i, j = 0;
+ wide->texcoord_mode = draw->rasterizer->sprite_coord_mode;
for (i = 0; i < vs->info.num_outputs; i++) {
if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_GENERIC) {
wide->texcoord_slot[j] = i;
- wide->texcoord_mode[j] = draw->rasterizer->sprite_coord_mode[j];
+ wide->texcoord_enable[j] = (draw->rasterizer->sprite_coord_enable >> j) & 1;
j++;
}
}