diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/spirv/nir_spirv.h | 12 | ||||
-rw-r--r-- | src/compiler/spirv/spirv2nir.c | 8 | ||||
-rw-r--r-- | src/compiler/spirv/spirv_to_nir.c | 5 |
3 files changed, 13 insertions, 12 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 } 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; } diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index d877077fa3b..c273e9e9fee 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4552,7 +4552,7 @@ vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b, return main_entry_point; } -nir_function * +nir_shader * spirv_to_nir(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, @@ -4669,7 +4669,8 @@ spirv_to_nir(const uint32_t *words, size_t word_count, /* Unparent the shader from the vtn_builder before we delete the builder */ ralloc_steal(NULL, b->shader); + nir_shader *shader = b->shader; ralloc_free(b); - return entry_point; + return shader; } |