glsl: Add builtin barrier() function
[jordan.l.justen@intel.com: Add CS support] Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
e7f628c2fc
commit
86855365b4
|
@ -410,6 +410,13 @@ fp64(const _mesa_glsl_parse_state *state)
|
||||||
return state->has_double();
|
return state->has_double();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool
|
||||||
|
barrier_supported(const _mesa_glsl_parse_state *state)
|
||||||
|
{
|
||||||
|
return state->stage == MESA_SHADER_COMPUTE;
|
||||||
|
/* TODO: || stage->state == MESA_SHADER_TESS_CTRL; */
|
||||||
|
}
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
@ -654,6 +661,7 @@ private:
|
||||||
const glsl_type *stream_type);
|
const glsl_type *stream_type);
|
||||||
ir_function_signature *_EndStreamPrimitive(builtin_available_predicate avail,
|
ir_function_signature *_EndStreamPrimitive(builtin_available_predicate avail,
|
||||||
const glsl_type *stream_type);
|
const glsl_type *stream_type);
|
||||||
|
B0(barrier)
|
||||||
|
|
||||||
B2(textureQueryLod);
|
B2(textureQueryLod);
|
||||||
B1(textureQueryLevels);
|
B1(textureQueryLevels);
|
||||||
|
@ -1933,6 +1941,7 @@ builtin_builder::create_builtins()
|
||||||
_EndStreamPrimitive(gs_streams, glsl_type::uint_type),
|
_EndStreamPrimitive(gs_streams, glsl_type::uint_type),
|
||||||
_EndStreamPrimitive(gs_streams, glsl_type::int_type),
|
_EndStreamPrimitive(gs_streams, glsl_type::int_type),
|
||||||
NULL);
|
NULL);
|
||||||
|
add_function("barrier", _barrier(), NULL);
|
||||||
|
|
||||||
add_function("textureQueryLOD",
|
add_function("textureQueryLOD",
|
||||||
_textureQueryLod(glsl_type::sampler1D_type, glsl_type::float_type),
|
_textureQueryLod(glsl_type::sampler1D_type, glsl_type::float_type),
|
||||||
|
@ -4295,6 +4304,15 @@ builtin_builder::_EndStreamPrimitive(builtin_available_predicate avail,
|
||||||
return sig;
|
return sig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ir_function_signature *
|
||||||
|
builtin_builder::_barrier()
|
||||||
|
{
|
||||||
|
MAKE_SIG(glsl_type::void_type, barrier_supported, 0);
|
||||||
|
|
||||||
|
body.emit(new(mem_ctx) ir_barrier());
|
||||||
|
return sig;
|
||||||
|
}
|
||||||
|
|
||||||
ir_function_signature *
|
ir_function_signature *
|
||||||
builtin_builder::_textureQueryLod(const glsl_type *sampler_type,
|
builtin_builder::_textureQueryLod(const glsl_type *sampler_type,
|
||||||
const glsl_type *coord_type)
|
const glsl_type *coord_type)
|
||||||
|
|
Loading…
Reference in New Issue