1 /**************************************************************************
2  *
3  * Copyright 2008 VMware, Inc.
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the
8  * "Software"), to deal in the Software without restriction, including
9  * without limitation the rights to use, copy, modify, merge, publish,
10  * distribute, sub license, and/or sell copies of the Software, and to
11  * permit persons to whom the Software is furnished to do so, subject to
12  * the following conditions:
13  *
14  * The above copyright notice and this permission notice (including the
15  * next paragraph) shall be included in all copies or substantial portions
16  * of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21  * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25  *
26  **************************************************************************/
27 
28 
29 #ifndef U_SIMPLE_SHADERS_H
30 #define U_SIMPLE_SHADERS_H
31 
32 
33 #include "pipe/p_compiler.h"
34 #include "pipe/p_shader_tokens.h"
35 
36 
37 struct pipe_context;
38 struct pipe_shader_state;
39 struct pipe_stream_output_info;
40 
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 
47 extern void *
48 util_make_vertex_passthrough_shader(struct pipe_context *pipe,
49                                     uint num_attribs,
50                                     const uint *semantic_names,
51                                     const uint *semantic_indexes,
52                                     bool window_space);
53 
54 extern void *
55 util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe,
56                                     uint num_attribs,
57                                     const uint *semantic_names,
58                                     const uint *semantic_indexes,
59                                     bool window_space, bool layered,
60                                     const struct pipe_stream_output_info *so);
61 
62 extern void *
63 util_make_layered_clear_vertex_shader(struct pipe_context *pipe);
64 
65 extern void *
66 util_make_layered_clear_helper_vertex_shader(struct pipe_context *pipe);
67 
68 extern void *
69 util_make_layered_clear_geometry_shader(struct pipe_context *pipe);
70 
71 extern void *
72 util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
73                                         unsigned tex_target,
74                                         unsigned interp_mode,
75                                         unsigned writemask,
76                                         enum tgsi_return_type stype,
77                                         enum tgsi_return_type dtype,
78                                         bool load_level_zero,
79                                         bool use_txf);
80 
81 extern void *
82 util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
83                               unsigned interp_mode,
84                               enum tgsi_return_type stype,
85                               enum tgsi_return_type dtype,
86                               bool load_level_zero,
87                               bool use_txf);
88 
89 extern void *
90 util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe,
91                                          unsigned tex_target,
92                                          unsigned interp_mode,
93                                          bool load_level_zero,
94                                          bool use_txf);
95 
96 
97 extern void *
98 util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe,
99                                                 unsigned tex_target,
100                                                 unsigned interp_mode,
101                                                 bool load_level_zero,
102                                                 bool use_txf);
103 
104 
105 extern void *
106 util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
107                                            unsigned tex_target,
108                                            unsigned interp_mode,
109                                            bool load_level_zero,
110                                            bool use_txf);
111 
112 
113 extern void *
114 util_make_fragment_passthrough_shader(struct pipe_context *pipe,
115                                       int input_semantic,
116                                       int input_interpolate,
117                                       boolean write_all_cbufs);
118 
119 
120 extern void *
121 util_make_empty_fragment_shader(struct pipe_context *pipe);
122 
123 
124 extern void *
125 util_make_fragment_cloneinput_shader(struct pipe_context *pipe, int num_cbufs,
126                                      int input_semantic,
127                                      int input_interpolate);
128 
129 
130 extern void *
131 util_make_fs_blit_msaa_color(struct pipe_context *pipe,
132                              enum tgsi_texture_type tgsi_tex,
133                              enum tgsi_return_type stype,
134                              enum tgsi_return_type dtype);
135 
136 
137 extern void *
138 util_make_fs_blit_msaa_depth(struct pipe_context *pipe,
139                              enum tgsi_texture_type tgsi_tex);
140 
141 
142 extern void *
143 util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
144                                     enum tgsi_texture_type tgsi_tex);
145 
146 
147 void *
148 util_make_fs_blit_msaa_stencil(struct pipe_context *pipe,
149                                enum tgsi_texture_type tgsi_tex);
150 
151 
152 void *
153 util_make_fs_msaa_resolve(struct pipe_context *pipe,
154                           enum tgsi_texture_type tgsi_tex, unsigned nr_samples,
155                           enum tgsi_return_type stype);
156 
157 
158 void *
159 util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
160                                    enum tgsi_texture_type tgsi_tex,
161                                    unsigned nr_samples,
162                                    enum tgsi_return_type stype);
163 
164 extern void *
165 util_make_geometry_passthrough_shader(struct pipe_context *pipe,
166                                       uint num_attribs,
167                                       const ubyte *semantic_names,
168                                       const ubyte *semantic_indexes);
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 
175 #endif
176