2
* Copyright © 2022 Intel 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
#ifndef ANV_GENERATED_INDIRECT_DRAWS_H
25
#define ANV_GENERATED_INDIRECT_DRAWS_H
29
#define ANV_GENERATED_FLAG_INDEXED BITFIELD_BIT(0)
30
#define ANV_GENERATED_FLAG_PREDICATED BITFIELD_BIT(1)
31
#define ANV_GENERATED_FLAG_DRAWID BITFIELD_BIT(2)
32
#define ANV_GENERATED_FLAG_BASE BITFIELD_BIT(3)
34
/* This needs to match common_generated_draws.glsl :
36
* layout(set = 0, binding = 2) uniform block
38
struct anv_generated_indirect_draw_params {
39
/* Draw ID buffer address (only used on Gfx9) */
40
uint64_t draw_id_addr;
41
/* Indirect data buffer address (only used on Gfx9) */
42
uint64_t indirect_data_addr;
43
/* Stride between each elements of the indirect data buffer */
44
uint32_t indirect_data_stride;
45
uint32_t flags; /* 0-7: bits, 8-15: mocs, 16-23: cmd_dws */
46
/* Base number of the draw ID, it is added to the index computed from the
51
/* Number of draws to generate */
54
/* Maximum number of draws (equals to draw_count for indirect draws without
57
uint32_t max_draw_count;
59
/* Instance multiplier for multi view */
60
uint32_t instance_multiplier;
62
/* Address where to jump at after the generated draw (only used with
63
* indirect draw count variants)
68
struct anv_generated_indirect_params {
69
struct anv_generated_indirect_draw_params draw;
71
/* Global address of binding 0 */
72
uint64_t indirect_data_addr;
74
/* Global address of binding 1 */
75
uint64_t generated_cmds_addr;
77
/* Global address of binding 2 */
78
uint64_t draw_ids_addr;
80
/* CPU side pointer to the previous item when number of draws has to be
81
* split into smaller chunks, see while loop in
82
* genX(cmd_buffer_emit_indirect_generated_draws)
84
struct anv_generated_indirect_params *prev;
87
#endif /* ANV_GENERATED_INDIRECT_DRAWS_H */