summaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/nir_spirv.h
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/nir_spirv.h
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/nir_spirv.h')
-rw-r--r--src/compiler/spirv/nir_spirv.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/spirv/nir_spirv.h b/src/compiler/spirv/nir_spirv.h
index 1e9e0727b63..c4381bdf62e 100644
--- a/src/compiler/spirv/nir_spirv.h
+++ b/src/compiler/spirv/nir_spirv.h
@@ -94,12 +94,12 @@ bool gl_spirv_validation(const uint32_t *words, size_t word_count,
struct nir_spirv_specialization *spec, unsigned num_spec,
gl_shader_stage stage, const char *entry_point_name);
-nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,
- struct nir_spirv_specialization *specializations,
- unsigned num_specializations,
- gl_shader_stage stage, const char *entry_point_name,
- const struct spirv_to_nir_options *options,
- const nir_shader_compiler_options *nir_options);
+nir_shader *spirv_to_nir(const uint32_t *words, size_t word_count,
+ struct nir_spirv_specialization *specializations,
+ unsigned num_specializations,
+ gl_shader_stage stage, const char *entry_point_name,
+ const struct spirv_to_nir_options *options,
+ const nir_shader_compiler_options *nir_options);
#ifdef __cplusplus
}