summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/spirv2nir.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2019-05-19 00:22:17 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2019-05-29 10:34:35 -0700
commite45bf01940fa6692d4f1d9385c2d6466da06a9bb (patch)
tree4e8c8694747bb1d65374f878434c03020f8aec65 /src/compiler/spirv/spirv2nir.c
parenta3bfdacb6c9f992dd1933c163c2580049ffea11e (diff)
spirv: Change spirv_to_nir() to return a nir_shader
spirv_to_nir() returned the nir_function corresponding to the entrypoint, as a way to identify it. There's now a bool is_entrypoint in nir_function and also a helper function to get the entry_point from a nir_shader. The return type reflects better what the function name suggests. It also helps drivers avoid the mistake of reusing internal shader references after running NIR_PASS on it. When using NIR_TEST_CLONE or NIR_TEST_SERIALIZE, those would be invalidated right in the first pass executed. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/spirv/spirv2nir.c')
-rw-r--r--src/compiler/spirv/spirv2nir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/spirv/spirv2nir.c b/src/compiler/spirv/spirv2nir.c
index 5957f064b49..48d2694c963 100644
--- a/src/compiler/spirv/spirv2nir.c
+++ b/src/compiler/spirv/spirv2nir.c
@@ -74,10 +74,10 @@ int main(int argc, char **argv)
struct spirv_to_nir_options spirv_opts = {};
- nir_function *func = spirv_to_nir(map, word_count, NULL, 0,
- MESA_SHADER_FRAGMENT, "main",
- &spirv_opts, NULL);
- nir_print_shader(func->shader, stderr);
+ nir_shader *nir = spirv_to_nir(map, word_count, NULL, 0,
+ MESA_SHADER_FRAGMENT, "main",
+ &spirv_opts, NULL);
+ nir_print_shader(nir, stderr);
return 0;
}