glsl: Basic support for built-in intrinsics.

Fix the linker to deal with intrinsic functions which are undefined
all the way down to the driver back-end, and introduce intrinsic
definition helpers in the built-in generator.

We still need to figure out what kind of interface we want for drivers
to communicate to the GLSL front-end which of the supported intrinsics
should use a default GLSL implementation and which should use a
hardware-specific override.  As there's no default GLSL implementation
for atomic ops, this seems like something we can worry about later on.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

v2: Define local helper function to generate ir_call nodes in the
    builtin generator.
This commit is contained in:
Francisco Jerez
2013-09-25 11:55:06 -07:00
parent cc744a0947
commit 9562922376
4 changed files with 64 additions and 11 deletions

View File

@@ -1647,8 +1647,8 @@ ir_variable::determine_interpolation_mode(bool flat_shade)
ir_function_signature::ir_function_signature(const glsl_type *return_type,
builtin_available_predicate b)
: return_type(return_type), is_defined(false), builtin_avail(b),
_function(NULL)
: return_type(return_type), is_defined(false), is_intrinsic(false),
builtin_avail(b), _function(NULL)
{
this->ir_type = ir_type_function_signature;
this->origin = NULL;