summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_gs.c
diff options
context:
space:
mode:
authorZack Rusin <zackr@vmware.com>2013-05-24 16:17:26 -0400
committerZack Rusin <zackr@vmware.com>2013-05-25 09:49:20 -0400
commit7756aae815a26c533948081c2c319c20bcf5962c (patch)
tree36ca7a4f867101633387215925ce3e0d123f7e94 /src/gallium/auxiliary/draw/draw_gs.c
parenteaabb4ead07ae043ecc789024028e225ebd0f318 (diff)
downloadexternal_mesa3d-7756aae815a26c533948081c2c319c20bcf5962c.zip
external_mesa3d-7756aae815a26c533948081c2c319c20bcf5962c.tar.gz
external_mesa3d-7756aae815a26c533948081c2c319c20bcf5962c.tar.bz2
draw: implement support for multiple viewports
This adds support for multiple viewports to the draw module. Multiple viewports depend on the presence of geometry shaders which can write the viewport index. Signed-off-by: Zack Rusin <zackr@vmware.com> Reviewed-by: José Fonseca<jfonseca@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index fa0981e..67e5117 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -335,8 +335,13 @@ llvm_fetch_gs_outputs(struct draw_geometry_shader *shader,
int i;
for (i = 0; i < total_verts; ++i) {
struct vertex_header *vh = (struct vertex_header *)(output_ptr + shader->vertex_size * i);
- debug_printf("%d) [%f, %f, %f, %f]\n", i,
- vh->data[0][0], vh->data[0][1], vh->data[0][2], vh->data[0][3]);
+ debug_printf("%d) Vertex:\n", i);
+ for (j = 0; j < shader->info.num_outputs; ++j) {
+ unsigned *udata = (unsigned*)vh->data[j];
+ debug_printf(" %d) [%f, %f, %f, %f] [%d, %d, %d, %d]\n", j,
+ vh->data[j][0], vh->data[j][1], vh->data[j][2], vh->data[j][3],
+ udata[0], udata[1], udata[2], udata[3]);
+ }
}
}
@@ -784,6 +789,8 @@ draw_create_geometry_shader(struct draw_context *draw,
if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_POSITION &&
gs->info.output_semantic_index[i] == 0)
gs->position_output = i;
+ if (gs->info.output_semantic_name[i] == TGSI_SEMANTIC_VIEWPORT_INDEX)
+ gs->viewport_index_output = i;
}
gs->machine = draw->gs.tgsi.machine;