5c4e558310764460e9783248a3ed2448094510d6
[mesa.git] / src / gallium / drivers / zink / nir_to_spirv / nir_to_spirv.h
1 /*
2 * Copyright 2018 Collabora Ltd.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24 #ifndef NIR_TO_SPIRV_H
25 #define NIR_TO_SPIRV_H
26
27 #include <stdlib.h>
28 #include <stdint.h>
29 #include <vulkan/vulkan.h>
30
31 #include "compiler/shader_enums.h"
32
33 struct spirv_shader {
34 uint32_t *words;
35 size_t num_words;
36 };
37
38 struct nir_shader;
39 struct pipe_stream_output_info;
40
41 struct spirv_shader *
42 nir_to_spirv(struct nir_shader *s, const struct pipe_stream_output_info *so_info, struct pipe_stream_output_info *local_so_info);
43
44 void
45 spirv_shader_delete(struct spirv_shader *s);
46
47 uint32_t
48 zink_binding(gl_shader_stage stage, VkDescriptorType type, int index);
49
50 struct nir_shader;
51
52 bool
53 zink_nir_lower_b2b(struct nir_shader *shader);
54
55 #endif