On Saturday, April 25, 2015 09:45:51 PM Jordan Justen wrote: > From: Chris Forbes <chr...@ijw.co.nz> > > [jordan.l.jus...@intel.com: Add CS support] > Signed-off-by: Jordan Justen <jordan.l.jus...@intel.com> > Reviewed-by: Ben Widawsky <b...@bwidawsk.net> > --- > src/glsl/builtin_functions.cpp | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp > index 524b8d6..778470d 100644 > --- a/src/glsl/builtin_functions.cpp > +++ b/src/glsl/builtin_functions.cpp > @@ -99,6 +99,18 @@ gs_only(const _mesa_glsl_parse_state *state) > } > > static bool > +tcs_only(const _mesa_glsl_parse_state *state) > +{ > + return false; /* TODO: state->stage == MESA_SHADER_TESS_CTRL; */ > +} > + > +static bool > +cs_only(const _mesa_glsl_parse_state *state) > +{ > + return state->stage == MESA_SHADER_COMPUTE; > +} > + > +static bool > v110(const _mesa_glsl_parse_state *state) > { > return !state->es_shader; > @@ -387,6 +399,12 @@ fp64(const _mesa_glsl_parse_state *state) > return state->has_double(); > } > > +static bool > +barrier_supported(const _mesa_glsl_parse_state *state) > +{ > + return tcs_only(state) || cs_only(state); > +} > +
I'd probably drop the cs_only/tcs_only functions unless you're going to use them as a built-in predicate directly. Writing this as: static bool barrier_supported(const _mesa_glsl_parse_state *state) { return state->stage == MESA_SHADER_COMPUTE; /* TODO: || stage->state == MESA_SHADER_TESS_CTRL; */ } seems simpler to me. With that change, (or either way I guess), Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev