1 /**************************************************************************
3 * Copyright 2008 VMware, Inc.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
29 #ifndef U_SIMPLE_SHADERS_H
30 #define U_SIMPLE_SHADERS_H
33 #include "pipe/p_compiler.h"
34 #include "pipe/p_shader_tokens.h"
38 struct pipe_shader_state
;
39 struct pipe_stream_output_info
;
48 util_make_vertex_passthrough_shader(struct pipe_context
*pipe
,
50 const enum tgsi_semantic
*semantic_names
,
51 const uint
*semantic_indexes
,
55 util_make_vertex_passthrough_shader_with_so(struct pipe_context
*pipe
,
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
);
63 util_make_layered_clear_vertex_shader(struct pipe_context
*pipe
);
66 util_make_layered_clear_helper_vertex_shader(struct pipe_context
*pipe
);
69 util_make_layered_clear_geometry_shader(struct pipe_context
*pipe
);
72 util_make_fragment_tex_shader_xrbias(struct pipe_context
*pipe
,
73 enum tgsi_texture_type tex_target
);
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
,
80 enum tgsi_return_type stype
,
81 enum tgsi_return_type dtype
,
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
,
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
);
100 util_make_fragment_passthrough_shader(struct pipe_context
*pipe
,
102 int input_interpolate
,
103 boolean write_all_cbufs
);
107 util_make_empty_fragment_shader(struct pipe_context
*pipe
);
111 util_make_fragment_cloneinput_shader(struct pipe_context
*pipe
, int num_cbufs
,
113 int input_interpolate
);
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
);
124 util_make_fs_blit_msaa_depth(struct pipe_context
*pipe
,
125 enum tgsi_texture_type tgsi_tex
);
129 util_make_fs_blit_msaa_depthstencil(struct pipe_context
*pipe
,
130 enum tgsi_texture_type tgsi_tex
);
134 util_make_fs_blit_msaa_stencil(struct pipe_context
*pipe
,
135 enum tgsi_texture_type tgsi_tex
);
139 util_make_fs_msaa_resolve(struct pipe_context
*pipe
,
140 enum tgsi_texture_type tgsi_tex
, unsigned nr_samples
,
141 enum tgsi_return_type stype
);
145 util_make_fs_msaa_resolve_bilinear(struct pipe_context
*pipe
,
146 enum tgsi_texture_type tgsi_tex
,
148 enum tgsi_return_type stype
);
151 util_make_geometry_passthrough_shader(struct pipe_context
*pipe
,
153 const ubyte
*semantic_names
,
154 const ubyte
*semantic_indexes
);