diff options
author | Brian Paul <[email protected]> | 2008-08-11 14:59:26 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-08-11 15:21:40 -0600 |
commit | 22604727e469f4a9881f722be319670d5cde4519 (patch) | |
tree | 2000fe1bec6138d756b9889c4dd5dad6b6c726cc /src/gallium/auxiliary/draw | |
parent | 5549d35db5323829702099af6e53a8dd7c451524 (diff) |
gallium: emit sprite coords (gl_PointCoord)
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pipe_wide_point.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c index d40a07f4aed..54590984c6b 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c +++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c @@ -50,6 +50,8 @@ struct widepoint_stage { uint num_texcoords; int psize_slot; + + int point_coord_fs_input; /**< input for pointcoord (and fog) */ }; @@ -84,6 +86,13 @@ static void set_texcoords(const struct widepoint_stage *wide, v->data[j][3] = tc[3]; } } + + if (wide->point_coord_fs_input >= 0) { + /* put gl_PointCoord into extra vertex output's zw components */ + uint k = wide->stage.draw->extra_vp_outputs.slot; + v->data[k][2] = tc[0]; + v->data[k][3] = tc[1]; + } } @@ -208,6 +217,18 @@ static void widepoint_first_point( struct draw_stage *stage, } } wide->num_texcoords = j; + + /* find fragment shader PointCoord/Fog input */ + wide->point_coord_fs_input = 0; /* XXX fix this! */ + + /* setup extra vp output */ + draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_FOG; + draw->extra_vp_outputs.semantic_index = 0; + draw->extra_vp_outputs.slot = draw->vs.num_vs_outputs; + } + else { + wide->point_coord_fs_input = -1; + draw->extra_vp_outputs.slot = 0; } wide->psize_slot = -1; |