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 37struct pipe_context; 38struct pipe_shader_state; 39struct pipe_stream_output_info; 40 41 42#ifdef __cplusplus 43extern "C" { 44#endif 45 46 47extern void * 48util_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 54extern void * 55util_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 62extern void * 63util_make_layered_clear_vertex_shader(struct pipe_context *pipe); 64 65extern void * 66util_make_layered_clear_helper_vertex_shader(struct pipe_context *pipe); 67 68extern void * 69util_make_layered_clear_geometry_shader(struct pipe_context *pipe); 70 71void * 72util_make_fragment_tex_shader_xrbias(struct pipe_context *pipe, 73 enum tgsi_texture_type tex_target); 74 75extern void * 76util_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 85extern void * 86util_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 94extern void * 95util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe, 96 enum tgsi_texture_type tex_target, 97 enum tgsi_interpolate_mode interp_mode, 98 bool load_level_zero, 99 bool use_txf); 100 101 102extern void * 103util_make_fragment_tex_shader_writedepthstencil(struct pipe_context *pipe, 104 enum tgsi_texture_type tex_target, 105 enum tgsi_interpolate_mode interp_mode, 106 bool load_level_zero, 107 bool use_txf); 108 109 110extern void * 111util_make_fragment_tex_shader_writestencil(struct pipe_context *pipe, 112 enum tgsi_texture_type tex_target, 113 enum tgsi_interpolate_mode interp_mode, 114 bool load_level_zero, 115 bool use_txf); 116 117 118extern void * 119util_make_fragment_passthrough_shader(struct pipe_context *pipe, 120 int input_semantic, 121 int input_interpolate, 122 boolean write_all_cbufs); 123 124 125extern void * 126util_make_empty_fragment_shader(struct pipe_context *pipe); 127 128 129extern void * 130util_make_fragment_cloneinput_shader(struct pipe_context *pipe, int num_cbufs, 131 int input_semantic, 132 int input_interpolate); 133 134 135extern void * 136util_make_fs_blit_msaa_color(struct pipe_context *pipe, 137 enum tgsi_texture_type tgsi_tex, 138 enum tgsi_return_type stype, 139 enum tgsi_return_type dtype); 140 141 142extern void * 143util_make_fs_blit_msaa_depth(struct pipe_context *pipe, 144 enum tgsi_texture_type tgsi_tex); 145 146 147extern void * 148util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe, 149 enum tgsi_texture_type tgsi_tex); 150 151 152void * 153util_make_fs_blit_msaa_stencil(struct pipe_context *pipe, 154 enum tgsi_texture_type tgsi_tex); 155 156 157void * 158util_make_fs_msaa_resolve(struct pipe_context *pipe, 159 enum tgsi_texture_type tgsi_tex, unsigned nr_samples, 160 enum tgsi_return_type stype); 161 162 163void * 164util_make_fs_msaa_resolve_bilinear(struct pipe_context *pipe, 165 enum tgsi_texture_type tgsi_tex, 166 unsigned nr_samples, 167 enum tgsi_return_type stype); 168 169extern void * 170util_make_geometry_passthrough_shader(struct pipe_context *pipe, 171 uint num_attribs, 172 const ubyte *semantic_names, 173 const ubyte *semantic_indexes); 174 175#ifdef __cplusplus 176} 177#endif 178 179 180#endif 181