summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-03-26 08:21:17 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-03-26 08:21:17 -0600
commit8cb85807d3bd42cb0e511970e4b409c542d2716b (patch)
tree0e9dbaaff8cc1db3e3e96dcbe7e3663346f9ed87 /src/gallium
parent4abe1eb980ed76d2b2d3383eaab520d0aa2ae6f4 (diff)
gallium: as for aapoints, make the extra texcoord per-shader state
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_aaline.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gallium/auxiliary/draw/draw_aaline.c b/src/gallium/auxiliary/draw/draw_aaline.c
index a999ef1227..e8d2a45102 100644
--- a/src/gallium/auxiliary/draw/draw_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_aaline.c
@@ -62,6 +62,7 @@ struct aaline_fragment_shader
void *aapoint_fs; /* not yet */
void *sprite_fs; /* not yet */
uint sampler_unit;
+ int generic_attrib; /**< texcoord/generic used for texture */
};
@@ -336,7 +337,7 @@ static void
generate_aaline_fs(struct aaline_stage *aaline)
{
const struct pipe_shader_state *orig_fs = &aaline->fs->state;
- struct draw_context *draw = aaline->stage.draw;
+ //struct draw_context *draw = aaline->stage.draw;
struct pipe_shader_state aaline_fs;
struct aa_transform_context transform;
@@ -369,11 +370,7 @@ generate_aaline_fs(struct aaline_stage *aaline)
aaline->fs->aaline_fs
= aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
- /* advertise the extra post-transform vertex attributes which will have
- * the texcoords.
- */
- draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
- draw->extra_vp_outputs.semantic_index = transform.maxGeneric + 1;
+ aaline->fs->generic_attrib = transform.maxGeneric + 1;
}
@@ -637,15 +634,20 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
else
aaline->half_line_width = 0.5f * draw->rasterizer->line_width;
- aaline->tex_slot = draw->num_vs_outputs;
- assert(aaline->tex_slot > 0); /* output[0] is vertex pos */
- draw->extra_vp_outputs.slot = aaline->tex_slot;
-
/*
- * Bind our fragprog, sampler and texture
+ * Bind (generate) our fragprog, sampler and texture
*/
bind_aaline_fragment_shader(aaline);
+ /* update vertex attrib info */
+ aaline->tex_slot = draw->num_vs_outputs;
+ assert(aaline->tex_slot > 0); /* output[0] is vertex pos */
+
+ /* advertise the extra post-transformed vertex attribute */
+ draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
+ draw->extra_vp_outputs.semantic_index = aaline->fs->generic_attrib;
+ draw->extra_vp_outputs.slot = aaline->tex_slot;
+
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
num_samplers = MAX2(aaline->num_textures, aaline->num_samplers);