2
2
* Copyright © 2021 Valve Corporation
4
* Permission is hereby granted, free of charge, to any person obtaining a
5
* copy of this software and associated documentation files (the "Software"),
6
* to deal in the Software without restriction, including without limitation
7
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
* and/or sell copies of the Software, and to permit persons to whom the
9
* Software is furnished to do so, subject to the following conditions:
11
* The above copyright notice and this permission notice (including the next
12
* paragraph) shall be included in all copies or substantial portions of the
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
4
* SPDX-License-Identifier: MIT
76
57
return ac_nir_load_arg_at_offset(b, ac_args, arg, 0);
60
void ac_nir_store_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
80
64
ac_nir_unpack_arg(nir_builder *b, const struct ac_shader_args *ac_args, struct ac_arg arg,
81
65
unsigned rshift, unsigned bitwidth);
304
290
unsigned color_is_int8;
305
291
unsigned color_is_int10;
293
bool bc_optimize_for_persp;
294
bool bc_optimize_for_linear;
295
bool force_persp_sample_interp;
296
bool force_linear_sample_interp;
297
bool force_persp_center_interp;
298
bool force_linear_center_interp;
299
unsigned ps_iter_samples;
307
301
/* OpenGL only */
308
302
bool clamp_color;
309
303
bool alpha_to_one;
310
enum pipe_compare_func alpha_func;
304
bool kill_samplemask;
305
enum compare_func alpha_func;
311
306
unsigned broadcast_last_cbuf;
313
308
/* Vulkan only */
314
309
unsigned enable_mrt_output_nan_fixup;
310
bool no_color_export;
315
311
} ac_nir_lower_ps_options;
318
314
ac_nir_lower_ps(nir_shader *nir, const ac_nir_lower_ps_options *options);
317
enum amd_gfx_level gfx_level;
319
/* If true, round the layer component of the coordinates source to the nearest
320
* integer for all array ops. This is always done for cube array ops.
322
bool lower_array_layer_round_even;
324
/* Fix derivatives of constants and FS inputs in control flow.
326
* Ignores interpolateAtSample()/interpolateAtOffset(), dynamically indexed input loads,
327
* pervertexEXT input loads, textureGather() with implicit LOD and 16-bit derivatives and
328
* texture samples with nir_tex_src_min_lod.
330
* The layer must also be a constant or FS input.
332
bool fix_derivs_in_divergent_cf;
333
unsigned max_wqm_vgprs;
334
} ac_nir_lower_tex_options;
337
ac_nir_lower_tex(nir_shader *nir, const ac_nir_lower_tex_options *options);
320
339
#ifdef __cplusplus