From b7a5eac1f3723a369885bad369a04c456bdf1565 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 20 Sep 2010 13:26:27 -0600 Subject: [PATCH] llvmpipe: clean-up, comments in setup_point_coefficient() --- src/gallium/drivers/llvmpipe/lp_setup_point.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_setup_point.c b/src/gallium/drivers/llvmpipe/lp_setup_point.c index 5521cbbe876..fb4fb2c436b 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_point.c +++ b/src/gallium/drivers/llvmpipe/lp_setup_point.c @@ -152,6 +152,7 @@ setup_point_coefficients( struct lp_setup_context *setup, struct lp_rast_triangle *point, const struct point_info *info) { + const struct lp_fragment_shader *shader = setup->fs.current.variant->shader; unsigned fragcoord_usage_mask = TGSI_WRITEMASK_XYZ; unsigned slot; @@ -172,12 +173,16 @@ setup_point_coefficients( struct lp_setup_context *setup, fragcoord_usage_mask |= usage_mask; break; + case LP_INTERP_LINEAR: + /* Sprite tex coords may use linear interpolation someday */ + /* fall-through */ + case LP_INTERP_PERSPECTIVE: - /* For point sprite textures */ - if (setup->fs.current.variant->shader->info.input_semantic_name[slot] - == TGSI_SEMANTIC_GENERIC) - { - int index = setup->fs.current.variant->shader->info.input_semantic_index[slot]; + /* check if the sprite coord flag is set for this attribute. + * If so, set it up so it up so x any y vary from 0 to 1. + */ + if (shader->info.input_semantic_name[slot] == TGSI_SEMANTIC_GENERIC) { + const int index = shader->info.input_semantic_index[slot]; if (setup->sprite & (1 << index)) { for (i = 0; i < NUM_CHANNELS; i++) -- 2.30.2