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