glsl: add ir_emit_vertex and ir_end_primitive instruction types

These correspond to the EmitVertex and EndPrimitive functions in GLSL.

v2 (Paul Berry <stereotype441@gmail.com>): Add stub implementations of
new pure visitor functions to i965's vec4_visitor and fs_visitor
classes.

v3 (Paul Berry <stereotype441@gmail.com>): Rename classes to be more
consistent with the names used in the GL spec.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Bryan Cain
2013-02-15 09:26:35 -06:00
committed by Paul Berry
parent c6be77ee6f
commit ae6eba3e32
16 changed files with 217 additions and 1 deletions
+17
View File
@@ -114,6 +114,23 @@ public:
return visit_continue_with_parent;
}
virtual ir_visitor_status visit(ir_emit_vertex *ir)
{
/* For the purpose of dead code elimination, emitting a vertex counts as
* "reading" all of the currently assigned output variables.
*/
foreach_iter(exec_list_iterator, iter, *this->assignments) {
assignment_entry *entry = (assignment_entry *)iter.get();
if (entry->lhs->mode == ir_var_shader_out) {
if (debug)
printf("kill %s\n", entry->lhs->name);
entry->remove();
}
}
return visit_continue;
}
private:
exec_list *assignments;
};