~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/intel/vulkan/anv_generated_indirect_draws.h

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright © 2022 Intel Corporation
3
 
 *
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:
10
 
 *
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
13
 
 * Software.
14
 
 *
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
21
 
 * IN THE SOFTWARE.
22
 
 */
23
 
 
24
 
#ifndef ANV_GENERATED_INDIRECT_DRAWS_H
25
 
#define ANV_GENERATED_INDIRECT_DRAWS_H
26
 
 
27
 
#include <stdint.h>
28
 
 
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)
33
 
 
34
 
/* This needs to match common_generated_draws.glsl :
35
 
 *
36
 
 *    layout(set = 0, binding = 2) uniform block
37
 
 */
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
47
 
    * gl_FragCoord
48
 
    */
49
 
   uint32_t draw_base;
50
 
 
51
 
   /* Number of draws to generate */
52
 
   uint32_t draw_count;
53
 
 
54
 
   /* Maximum number of draws (equals to draw_count for indirect draws without
55
 
    * an indirect count)
56
 
    */
57
 
   uint32_t max_draw_count;
58
 
 
59
 
   /* Instance multiplier for multi view */
60
 
   uint32_t instance_multiplier;
61
 
 
62
 
   /* Address where to jump at after the generated draw (only used with
63
 
    * indirect draw count variants)
64
 
    */
65
 
   uint64_t end_addr;
66
 
};
67
 
 
68
 
struct anv_generated_indirect_params {
69
 
   struct anv_generated_indirect_draw_params draw;
70
 
 
71
 
   /* Global address of binding 0 */
72
 
   uint64_t indirect_data_addr;
73
 
 
74
 
   /* Global address of binding 1 */
75
 
   uint64_t generated_cmds_addr;
76
 
 
77
 
   /* Global address of binding 2 */
78
 
   uint64_t draw_ids_addr;
79
 
 
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)
83
 
    */
84
 
   struct anv_generated_indirect_params *prev;
85
 
};
86
 
 
87
 
#endif /* ANV_GENERATED_INDIRECT_DRAWS_H */