2 * Copyright © 2019 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
24 #include "ac_shader_args.h"
25 #include "radv_constants.h"
26 #include "util/list.h"
27 #include "compiler/shader_enums.h"
28 #include "amd_family.h"
30 struct radv_shader_args
{
31 struct ac_shader_args ac
;
32 struct radv_shader_info
*shader_info
;
33 const struct radv_nir_compiler_options
*options
;
35 struct ac_arg descriptor_sets
[MAX_SETS
];
36 struct ac_arg ring_offsets
;
37 struct ac_arg scratch_offset
;
39 struct ac_arg vertex_buffers
;
40 struct ac_arg rel_auto_id
;
41 struct ac_arg vs_prim_id
;
42 struct ac_arg es2gs_offset
;
45 struct ac_arg merged_wave_info
;
46 struct ac_arg tess_factor_offset
;
47 struct ac_arg tes_rel_patch_id
;
53 * - bits 0..11: ordered_wave_id
54 * - bits 12..20: number of vertices in group
55 * - bits 22..30: number of primitives in group
57 struct ac_arg gs_tg_info
;
58 struct ac_arg gs2vs_offset
;
59 struct ac_arg gs_wave_id
;
60 struct ac_arg gs_vtx_offset
[6];
63 struct ac_arg streamout_buffers
;
64 struct ac_arg streamout_write_idx
;
65 struct ac_arg streamout_config
;
66 struct ac_arg streamout_offset
[4];
69 struct ac_arg ngg_gs_state
;
71 bool is_gs_copy_shader
;
74 static inline struct radv_shader_args
*
75 radv_shader_args_from_ac(struct ac_shader_args
*args
)
77 struct radv_shader_args
*radv_args
= NULL
;
78 return (struct radv_shader_args
*) container_of(args
, radv_args
, ac
);
81 void radv_declare_shader_args(struct radv_shader_args
*args
,
82 gl_shader_stage stage
,
83 bool has_previous_stage
,
84 gl_shader_stage previous_stage
);