summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50/nv50_program.c
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2013-04-17 15:55:47 -0500
committerMaarten Lankhorst <[email protected]>2014-01-27 16:40:42 +0100
commit02b317a0d601ab50cedad31f2b52da3bdc3a5aad (patch)
tree2ba25e338baf01a169466e9a043d5503526badcd /src/gallium/drivers/nouveau/nv50/nv50_program.c
parentb3f82e1a63e8a58f0e7ac297fc5e94ebe76c3339 (diff)
nv50: add support for geometry shaders
Layer output probably doesn't work yet, but other than that everything seems to be working. Signed-off-by: Bryan Cain <[email protected]> [calim: fix up minor bugs, code formatting] Signed-off-by: Christoph Bumiller <[email protected]> Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50/nv50_program.c')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_program.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_program.c b/src/gallium/drivers/nouveau/nv50/nv50_program.c
index 97857d7989f..78a12e3b010 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_program.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_program.c
@@ -358,6 +358,22 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset)
}
if (info->prop.fp.usesDiscard)
prog->fp.flags[0] |= NV50_3D_FP_CONTROL_USES_KIL;
+ } else
+ if (prog->type == PIPE_SHADER_GEOMETRY) {
+ switch (info->prop.gp.outputPrim) {
+ case PIPE_PRIM_LINE_STRIP:
+ prog->gp.prim_type = NV50_3D_GP_OUTPUT_PRIMITIVE_TYPE_LINE_STRIP;
+ break;
+ case PIPE_PRIM_TRIANGLE_STRIP:
+ prog->gp.prim_type = NV50_3D_GP_OUTPUT_PRIMITIVE_TYPE_TRIANGLE_STRIP;
+ break;
+ case PIPE_PRIM_POINTS:
+ default:
+ assert(info->prop.gp.outputPrim == PIPE_PRIM_POINTS);
+ prog->gp.prim_type = NV50_3D_GP_OUTPUT_PRIMITIVE_TYPE_POINTS;
+ break;
+ }
+ prog->gp.vert_count = info->prop.gp.maxVertices;
}
if (prog->pipe.stream_output.num_outputs)