1/*
2 * Copyright © Microsoft Corporation
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 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * 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 NONINFRINGEMENT.  IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 * IN THE SOFTWARE.
22 */
23
24#ifndef NIR_TO_DXIL_H
25#define NIR_TO_DXIL_H
26
27#include <stdbool.h>
28
29#include "nir.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35struct blob;
36
37enum dxil_sysvalue_type {
38   DXIL_NO_SYSVALUE = 0,
39   DXIL_SYSVALUE,
40   DXIL_GENERATED_SYSVALUE
41};
42
43enum dxil_sysvalue_type
44nir_var_to_dxil_sysvalue_type(nir_variable *var, uint64_t other_stage_mask);
45
46struct nir_to_dxil_options {
47   bool interpolate_at_vertex;
48   bool lower_int16;
49   bool disable_math_refactoring;
50   unsigned ubo_binding_offset;
51   unsigned provoking_vertex;
52   unsigned num_kernel_globals;
53   bool vulkan_environment;
54};
55
56bool
57nir_to_dxil(struct nir_shader *s, const struct nir_to_dxil_options *opts,
58            struct blob *blob);
59
60const nir_shader_compiler_options*
61dxil_get_nir_compiler_options(void);
62
63#ifdef __cplusplus
64}
65#endif
66
67#endif
68