• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 enum tgsi_semantic *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 enum tgsi_semantic *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 void *
72 util_make_fragment_tex_shader_xrbias(struct pipe_context *pipe,
73                                      enum tgsi_texture_type tex_target);
74 
75 extern void *
76 util_make_fragment_tex_shader_writemask(struct pipe_context *pipe,
77                                         enum tgsi_texture_type tex_target,
78                                         enum tgsi_interpolate_mode interp_mode,
79                                         unsigned writemask,
80                                         enum tgsi_return_type stype,
81                                         enum tgsi_return_type dtype,
82                                         bool load_level_zero,
83                                         bool use_txf);
84 
85 extern void *
86 util_make_fragment_tex_shader(struct pipe_context *pipe,
87                               enum tgsi_texture_type tex_target,
88                               enum tgsi_interpolate_mode interp_mode,
89                               enum tgsi_return_type stype,
90                               enum tgsi_return_type dtype,
91                               bool load_level_zero,
92                               bool use_txf);
93 
94 extern void *
95 util_make_fs_blit_zs(struct pipe_context *pipe, unsigned zs_mask,
96                      enum tgsi_texture_type tex_target,
97                      bool load_level_zero, bool use_txf);
98 
99 extern void *
100 util_make_fragment_passthrough_shader(struct pipe_context *pipe,
101                                       int input_semantic,
102                                       int input_interpolate,
103                                       boolean write_all_cbufs);
104 
105 
106 extern void *
107 util_make_empty_fragment_shader(struct pipe_context *pipe);
108 
109 
110 extern void *
111 util_make_fragment_cloneinput_shader(struct pipe_context *pipe, int num_cbufs,
112                                      int input_semantic,
113                                      int input_interpolate);
114 
115 
116 extern void *
117 util_make_fs_blit_msaa_color(struct pipe_context *pipe,
118                              enum tgsi_texture_type tgsi_tex,
119                              enum tgsi_return_type stype,
120                              enum tgsi_return_type dtype,
121                              bool sample_shading);
122 
123 
124 extern void *
125 util_make_fs_blit_msaa_depth(struct pipe_context *pipe,
126                              enum tgsi_texture_type tgsi_tex,
127                              bool sample_shading);
128 
129 
130 extern void *
131 util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
132                                     enum tgsi_texture_type tgsi_tex,
133                                     bool sample_shading);
134 
135 
136 void *
137 util_make_fs_blit_msaa_stencil(struct pipe_context *pipe,
138                                enum tgsi_texture_type tgsi_tex,
139                                bool sample_shading);
140 
141 
142 void *
143 util_make_fs_msaa_resolve(struct pipe_context *pipe,
144                           enum tgsi_texture_type tgsi_tex, unsigned nr_samples,
145                           enum tgsi_return_type stype);
146 
147 
148 void *
149 util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe,
150                                    enum tgsi_texture_type tgsi_tex,
151                                    unsigned nr_samples,
152                                    enum tgsi_return_type stype);
153 
154 extern void *
155 util_make_geometry_passthrough_shader(struct pipe_context *pipe,
156                                       uint num_attribs,
157                                       const ubyte *semantic_names,
158                                       const ubyte *semantic_indexes);
159 
160 void *
161 util_make_fs_pack_color_zs(struct pipe_context *pipe,
162                            enum tgsi_texture_type tex_target,
163                            enum pipe_format zs_format,
164                            bool dst_is_color);
165 
166 extern void *
167 util_make_tess_ctrl_passthrough_shader(struct pipe_context *pipe,
168                                        uint num_vs_outputs,
169                                        uint num_tes_inputs,
170                                        const ubyte *vs_semantic_names,
171                                        const ubyte *vs_semantic_indexes,
172                                        const ubyte *tes_semantic_names,
173                                        const ubyte *tes_semantic_indexes,
174                                        const unsigned vertices_per_patch);
175 
176 void *
177 util_make_fs_stencil_blit(struct pipe_context *pipe, bool msaa_src);
178 
179 void *
180 util_make_fs_clear_all_cbufs(struct pipe_context *pipe);
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 
187 #endif
188