diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-09-20 09:27:00 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-09-30 12:44:30 -0700 |
commit | af1a6f0f770ae7432fd506f5f33fbe9e00e253af (patch) | |
tree | dc2216dfc44b1dbd1bbce05f27b7fd0bbc146ed1 /src/compiler/glsl/ir_hv_accept.cpp | |
parent | c81b912eb7adff326070fc18353d51ef6dec0dcb (diff) |
glsl: Add ir_demote
To represent the new `demote` keyword when using
EXT_demote_to_helper_invocation extension. Most of the changes are to
include it in the visitors.
Demote is not considered a control flow, so also include an empty
visit member function in ir_control_flow_visitor.
Only NIR actually supports `demote`, so assert the translations for
TGSI and Mesa's gl_program -- since the demote is not expected to
appear for those.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_hv_accept.cpp')
-rw-r--r-- | src/compiler/glsl/ir_hv_accept.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/ir_hv_accept.cpp b/src/compiler/glsl/ir_hv_accept.cpp index f04a5b6fd19..6e5e25378e1 100644 --- a/src/compiler/glsl/ir_hv_accept.cpp +++ b/src/compiler/glsl/ir_hv_accept.cpp @@ -379,6 +379,18 @@ ir_discard::accept(ir_hierarchical_visitor *v) ir_visitor_status +ir_demote::accept(ir_hierarchical_visitor *v) +{ + ir_visitor_status s = v->visit_enter(this); + + if (s != visit_continue) + return (s == visit_continue_with_parent) ? visit_continue : s; + + return v->visit_leave(this); +} + + +ir_visitor_status ir_if::accept(ir_hierarchical_visitor *v) { ir_visitor_status s = v->visit_enter(this); |