1bf215546Sopenharmony_ci/* 2bf215546Sopenharmony_ci * Copyright © Microsoft Corporation 3bf215546Sopenharmony_ci * 4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"), 6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation 7bf215546Sopenharmony_ci * on the rights to use, copy, modify, merge, publish, distribute, sub 8bf215546Sopenharmony_ci * license, and/or sell copies of the Software, and to permit persons to whom 9bf215546Sopenharmony_ci * the Software is furnished to do so, subject to the following conditions: 10bf215546Sopenharmony_ci * 11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next 12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the 13bf215546Sopenharmony_ci * Software. 14bf215546Sopenharmony_ci * 15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 18bf215546Sopenharmony_ci * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, 19bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 20bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 21bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. 22bf215546Sopenharmony_ci */ 23bf215546Sopenharmony_ci 24bf215546Sopenharmony_ci#ifndef D3D12_NIR_PASSES_H 25bf215546Sopenharmony_ci#define D3D12_NIR_PASSES_H 26bf215546Sopenharmony_ci 27bf215546Sopenharmony_ci#include "nir.h" 28bf215546Sopenharmony_ci#include "nir_builder.h" 29bf215546Sopenharmony_ci 30bf215546Sopenharmony_ci#ifdef __cplusplus 31bf215546Sopenharmony_ciextern "C" { 32bf215546Sopenharmony_ci#endif 33bf215546Sopenharmony_ci 34bf215546Sopenharmony_cistruct d3d12_shader; 35bf215546Sopenharmony_cistruct d3d12_image_format_conversion_info; 36bf215546Sopenharmony_cienum d3d12_state_var; 37bf215546Sopenharmony_ci 38bf215546Sopenharmony_cinir_ssa_def * 39bf215546Sopenharmony_cid3d12_get_state_var(nir_builder *b, 40bf215546Sopenharmony_ci enum d3d12_state_var var_enum, 41bf215546Sopenharmony_ci const char *var_name, 42bf215546Sopenharmony_ci const struct glsl_type *var_type, 43bf215546Sopenharmony_ci nir_variable **out_var); 44bf215546Sopenharmony_ci 45bf215546Sopenharmony_cinir_ssa_def * 46bf215546Sopenharmony_cid3d12_get_state_var(nir_builder *b, 47bf215546Sopenharmony_ci enum d3d12_state_var var_enum, 48bf215546Sopenharmony_ci const char *var_name, 49bf215546Sopenharmony_ci const struct glsl_type *var_type, 50bf215546Sopenharmony_ci nir_variable **out_var); 51bf215546Sopenharmony_ci 52bf215546Sopenharmony_cibool 53bf215546Sopenharmony_cid3d12_lower_point_sprite(nir_shader *shader, 54bf215546Sopenharmony_ci bool sprite_origin_lower_left, 55bf215546Sopenharmony_ci bool point_size_per_vertex, 56bf215546Sopenharmony_ci unsigned point_coord_enable, 57bf215546Sopenharmony_ci uint64_t next_inputs_read); 58bf215546Sopenharmony_ci 59bf215546Sopenharmony_cibool 60bf215546Sopenharmony_cid3d12_lower_state_vars(struct nir_shader *s, struct d3d12_shader *shader); 61bf215546Sopenharmony_ci 62bf215546Sopenharmony_civoid 63bf215546Sopenharmony_cid3d12_lower_yflip(nir_shader *s); 64bf215546Sopenharmony_ci 65bf215546Sopenharmony_civoid 66bf215546Sopenharmony_cid3d12_forward_front_face(nir_shader *nir); 67bf215546Sopenharmony_ci 68bf215546Sopenharmony_civoid 69bf215546Sopenharmony_cid3d12_lower_depth_range(nir_shader *nir); 70bf215546Sopenharmony_ci 71bf215546Sopenharmony_cibool 72bf215546Sopenharmony_cid3d12_lower_load_draw_params(nir_shader *nir); 73bf215546Sopenharmony_ci 74bf215546Sopenharmony_cibool 75bf215546Sopenharmony_cid3d12_lower_load_patch_vertices_in(nir_shader *nir); 76bf215546Sopenharmony_ci 77bf215546Sopenharmony_cibool 78bf215546Sopenharmony_cid3d12_lower_compute_state_vars(nir_shader *nir); 79bf215546Sopenharmony_ci 80bf215546Sopenharmony_civoid 81bf215546Sopenharmony_cid3d12_lower_uint_cast(nir_shader *nir, bool is_signed); 82bf215546Sopenharmony_ci 83bf215546Sopenharmony_civoid 84bf215546Sopenharmony_cid3d12_add_missing_dual_src_target(struct nir_shader *s, 85bf215546Sopenharmony_ci unsigned missing_mask); 86bf215546Sopenharmony_ci 87bf215546Sopenharmony_cibool 88bf215546Sopenharmony_cid3d12_fix_io_uint_type(struct nir_shader *s, uint64_t in_mask, uint64_t out_mask); 89bf215546Sopenharmony_ci 90bf215546Sopenharmony_civoid 91bf215546Sopenharmony_cid3d12_nir_invert_depth(nir_shader *s, unsigned viewport_mask, bool clip_halfz); 92bf215546Sopenharmony_ci 93bf215546Sopenharmony_cibool 94bf215546Sopenharmony_cinir_lower_packed_ubo_loads(struct nir_shader *nir); 95bf215546Sopenharmony_ci 96bf215546Sopenharmony_civoid 97bf215546Sopenharmony_cid3d12_lower_primitive_id(nir_shader *shader); 98bf215546Sopenharmony_ci 99bf215546Sopenharmony_civoid 100bf215546Sopenharmony_cid3d12_lower_triangle_strip(nir_shader *shader); 101bf215546Sopenharmony_ci 102bf215546Sopenharmony_cibool 103bf215546Sopenharmony_cid3d12_lower_image_casts(nir_shader *s, struct d3d12_image_format_conversion_info *info); 104bf215546Sopenharmony_ci 105bf215546Sopenharmony_cibool 106bf215546Sopenharmony_cid3d12_lower_sample_pos(nir_shader *s); 107bf215546Sopenharmony_ci 108bf215546Sopenharmony_cibool 109bf215546Sopenharmony_cid3d12_disable_multisampling(nir_shader *s); 110bf215546Sopenharmony_ci 111bf215546Sopenharmony_cibool 112bf215546Sopenharmony_cid3d12_split_multistream_varyings(nir_shader *s); 113bf215546Sopenharmony_ci 114bf215546Sopenharmony_civoid 115bf215546Sopenharmony_cid3d12_write_0_to_new_varying(nir_shader *s, nir_variable *var); 116bf215546Sopenharmony_ci 117bf215546Sopenharmony_ci#ifdef __cplusplus 118bf215546Sopenharmony_ci} 119bf215546Sopenharmony_ci#endif 120bf215546Sopenharmony_ci 121bf215546Sopenharmony_ci#endif // D3D12_NIR_PASSES_H 122