summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2018-06-30 16:22:17 +0200
committerKarol Herbst <[email protected]>2019-03-17 17:14:21 +0100
commit4ded1cdef9b488859e6aadb089eb3435ba73682f (patch)
treec397673366ef2202c8030a644677cf5053da645a /src/gallium/drivers/nouveau
parentb866012f7ba4bd83ad0e3904eae2116205bd256b (diff)
nv50/ir/nir: handle user clip planes for each emitted vertex
v9: convert to C++ style comments handle for tess eval shaders as well Signed-off-by: Karol Herbst <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
index 627848a457f..53102e485fe 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_nir.cpp
@@ -1561,7 +1561,9 @@ Converter::visit(nir_function *function)
bb->cfg.attach(&exit->cfg, Graph::Edge::TREE);
setPosition(exit, true);
- if (info->io.genUserClip > 0)
+ if ((prog->getType() == Program::TYPE_VERTEX ||
+ prog->getType() == Program::TYPE_TESSELLATION_EVAL)
+ && info->io.genUserClip > 0)
handleUserClipPlanes();
// TODO: for non main function this needs to be a OP_RETURN
@@ -1889,6 +1891,7 @@ Converter::visit(nir_intrinsic_instr *insn)
}
break;
}
+ case Program::TYPE_GEOMETRY:
case Program::TYPE_VERTEX: {
if (info->io.genUserClip > 0 && idx == clipVertexOutput) {
mkMov(clipVtx[i], src);
@@ -2187,6 +2190,9 @@ Converter::visit(nir_intrinsic_instr *insn)
break;
}
case nir_intrinsic_emit_vertex:
+ if (info->io.genUserClip > 0)
+ handleUserClipPlanes();
+ // fallthrough
case nir_intrinsic_end_primitive: {
uint32_t idx = nir_intrinsic_stream_id(insn);
mkOp1(getOperation(op), TYPE_U32, NULL, mkImm(idx))->fixed = 1;