nir: Change nir_shader_get_entrypoint to return an impl.

Jason suggested adding an assert(function->impl) here.  All callers
of this function actually want ->impl, so I decided just to change
the API.

We also change the nir_lower_io_to_temporaries API here.  All but one
caller passed nir_shader_get_entrypoint(), and with the previous commit,
it now uses a nir_function_impl internally.  Folding this change in
avoids the need to change it and change it back.

v2: Fix one call I missed in ir3_compiler (caught by Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
Kenneth Graunke
2016-08-24 19:09:57 -07:00
parent 8479b03c58
commit 93bfa1d7a2
7 changed files with 14 additions and 18 deletions

View File

@@ -128,12 +128,7 @@ void
nir_lower_bitmap(nir_shader *shader,
const nir_lower_bitmap_options *options)
{
nir_function *function;
assert(shader->stage == MESA_SHADER_FRAGMENT);
function = nir_shader_get_entrypoint(shader);
if (function->impl)
lower_bitmap_impl(function->impl, options);
lower_bitmap_impl(nir_shader_get_entrypoint(shader), options);
}