summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
diff options
context:
space:
mode:
authorIago Toral Quiroga <itoral@igalia.com>2014-07-16 09:10:35 +0200
committerIago Toral Quiroga <itoral@igalia.com>2014-09-19 15:01:15 +0200
commit8411bf2c69136efcae594529f16e70ea0a22e271 (patch)
tree41ecfaf06aeb5d64786d5aa02a9436459b031220 /src/mesa/drivers/dri/i965/gen6_gs_visitor.h
parent5c30da184514f7d20c033a0c4d1f99626adaddd4 (diff)
downloadexternal_mesa3d-8411bf2c69136efcae594529f16e70ea0a22e271.zip
external_mesa3d-8411bf2c69136efcae594529f16e70ea0a22e271.tar.gz
external_mesa3d-8411bf2c69136efcae594529f16e70ea0a22e271.tar.bz2
i965/gen6/gs: Add initial implementation for a gen6 geometry shader visitor.
Geometry shaders in gen6 are significantly different from gen7+ so it is better to have them implemented in a different file rather than adding gen6 branching paths all over brw_vec4_gs_visitor.cpp. This commit adds an initial implementation that only handles point output, which is the simplest case. Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen6_gs_visitor.h')
-rw-r--r--src/mesa/drivers/dri/i965/gen6_gs_visitor.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_visitor.h b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
new file mode 100644
index 0000000..6dd3a19
--- /dev/null
+++ b/src/mesa/drivers/dri/i965/gen6_gs_visitor.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#ifndef GEN6_GS_VISITOR_H
+#define GEN6_GS_VISITOR_H
+
+#include "brw_vec4.h"
+#include "brw_vec4_gs_visitor.h"
+
+#ifdef __cplusplus
+
+namespace brw {
+
+class gen6_gs_visitor : public vec4_gs_visitor
+{
+public:
+ gen6_gs_visitor(struct brw_context *brw,
+ struct brw_gs_compile *c,
+ struct gl_shader_program *prog,
+ void *mem_ctx,
+ bool no_spills) :
+ vec4_gs_visitor(brw, c, prog, mem_ctx, no_spills) {}
+
+protected:
+ virtual void emit_prolog();
+ virtual void emit_thread_end();
+ virtual void visit(ir_emit_vertex *);
+ virtual void visit(ir_end_primitive *);
+ virtual void emit_urb_write_header(int mrf);
+ virtual void emit_urb_write_opcode(bool complete,
+ src_reg vertex,
+ int base_mrf,
+ int mlen,
+ int urb_offset);
+
+private:
+ src_reg vertex_output;
+ src_reg vertex_output_offset;
+ src_reg temp;
+};
+
+} /* namespace brw */
+
+#endif /* __cplusplus */
+
+#endif /* GEN6_GS_VISITOR_H */