gallium/util: add a utility to create geometry passthrough shader
[mesa.git] / src / gallium / auxiliary / util / u_simple_shaders.h
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
35
36 struct pipe_context;
37 struct pipe_shader_state;
38 struct pipe_stream_output_info;
39
40
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44
45
46 extern void *
47 util_make_vertex_passthrough_shader(struct pipe_context *pipe,
48 uint num_attribs,
49 const uint *semantic_names,
50 const uint *semantic_indexes,
51 bool window_space);
52
53 extern void *
54 util_make_vertex_passthrough_shader_with_so(struct pipe_context *pipe,
55 uint num_attribs,
56 const uint *semantic_names,
57 const uint *semantic_indexes,
58 bool window_space,
59 const struct pipe_stream_output_info *so);
60
61 extern void *
62 util_make_layered_clear_vertex_shader(struct pipe_context *pipe);
63
64 extern void *
65 util_make_layered_clear_helper_vertex_shader(struct pipe_context *pipe);
66
67 extern void *
68 util_make_layered_clear_geometry_shader(struct pipe_context *pipe);
69
70 extern void *
71 util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
72 unsigned tex_target,
73 unsigned interp_mode,
74 unsigned writemask,
75 enum tgsi_return_type stype);
76
77 extern void *
78 util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target,
79 unsigned interp_mode,
80 enum tgsi_return_type stype);
81
82 extern void *
83 util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe,
84 unsigned tex_target,
85 unsigned interp_mode);
86
87
88 extern void *
89 util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe,
90 unsigned tex_target,
91 unsigned interp_mode);
92
93
94 extern void *
95 util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe,
96 unsigned tex_target,
97 unsigned interp_mode);
98
99
100 extern void *
101 util_make_fragment_passthrough_shader(struct pipe_context *pipe,
102 int input_semantic,
103 int input_interpolate,
104 boolean write_all_cbufs);
105
106
107 extern void *
108 util_make_empty_fragment_shader(struct pipe_context *pipe);
109
110
111 extern void *
112 util_make_fragment_cloneinput_shader(struct pipe_context *pipe, int num_cbufs,
113 int input_semantic,
114 int input_interpolate);
115
116
117 extern void *
118 util_make_fs_blit_msaa_color(struct pipe_context *pipe,
119 unsigned tgsi_tex,
120 enum tgsi_return_type stype);
121
122
123 extern void *
124 util_make_fs_blit_msaa_depth(struct pipe_context *pipe,
125 unsigned tgsi_tex);
126
127
128 extern void *
129 util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
130 unsigned tgsi_tex);
131
132
133 void *
134 util_make_fs_blit_msaa_stencil(struct pipe_context *pipe,
135 unsigned tgsi_tex);
136
137
138 void *
139 util_make_fs_msaa_resolve(struct pipe_context *pipe,
140 unsigned tgsi_tex, unsigned nr_samples,
141 enum tgsi_return_type stype);
142
143
144 void *
145 util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
146 unsigned tgsi_tex, unsigned nr_samples,
147 enum tgsi_return_type stype);
148
149 extern void *
150 util_make_geometry_passthrough_shader(struct pipe_context *pipe,
151 uint num_attribs,
152 const ubyte *semantic_names,
153 const ubyte *semantic_indexes);
154
155 #ifdef __cplusplus
156 }
157 #endif
158
159
160 #endif