summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/d3d12/d3d12_nir_passes.h
blob: 818b12abf318749727a90b6865b8993b5f03598f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * Copyright © Microsoft Corporation
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * on the rights to use, copy, modify, merge, publish, distribute, sub
 * license, and/or sell copies of the Software, and to permit persons to whom
 * the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifndef D3D12_NIR_PASSES_H
#define D3D12_NIR_PASSES_H

#include "nir.h"
#include "nir_builder.h"

#ifdef __cplusplus
extern "C" {
#endif

struct d3d12_shader;
struct d3d12_image_format_conversion_info;
enum d3d12_state_var;

nir_ssa_def *
d3d12_get_state_var(nir_builder *b,
                    enum d3d12_state_var var_enum,
                    const char *var_name,
                    const struct glsl_type *var_type,
                    nir_variable **out_var);

nir_ssa_def *
d3d12_get_state_var(nir_builder *b,
                    enum d3d12_state_var var_enum,
                    const char *var_name,
                    const struct glsl_type *var_type,
                    nir_variable **out_var);

bool
d3d12_lower_point_sprite(nir_shader *shader,
                         bool sprite_origin_lower_left,
                         bool point_size_per_vertex,
                         unsigned point_coord_enable,
                         uint64_t next_inputs_read);

bool
d3d12_lower_state_vars(struct nir_shader *s, struct d3d12_shader *shader);

void
d3d12_lower_yflip(nir_shader *s);

void
d3d12_forward_front_face(nir_shader *nir);

void
d3d12_lower_depth_range(nir_shader *nir);

bool
d3d12_lower_load_draw_params(nir_shader *nir);

bool
d3d12_lower_load_patch_vertices_in(nir_shader *nir);

bool
d3d12_lower_compute_state_vars(nir_shader *nir);

void
d3d12_lower_uint_cast(nir_shader *nir, bool is_signed);

void
d3d12_add_missing_dual_src_target(struct nir_shader *s,
                                  unsigned missing_mask);

bool
d3d12_fix_io_uint_type(struct nir_shader *s, uint64_t in_mask, uint64_t out_mask);

void
d3d12_nir_invert_depth(nir_shader *s, unsigned viewport_mask);

bool
nir_lower_packed_ubo_loads(struct nir_shader *nir);

void
d3d12_lower_primitive_id(nir_shader *shader);

void
d3d12_lower_triangle_strip(nir_shader *shader);

bool
d3d12_lower_image_casts(nir_shader *s, struct d3d12_image_format_conversion_info *info);

bool
d3d12_lower_sample_pos(nir_shader *s);

bool
d3d12_disable_multisampling(nir_shader *s);

bool
d3d12_split_multistream_varyings(nir_shader *s);

void
d3d12_write_0_to_new_varying(nir_shader *s, nir_variable *var);

#ifdef __cplusplus
}
#endif

#endif // D3D12_NIR_PASSES_H