mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-23 19:28:11 +02:00
The issue here is that for draw indirect count variants, we want to
jump after the last generated draw call to the next location where
commands are. But if we have more than 67M draws (8k * 8k chunks), we
only know the location once we've generated each of the 8k * 8k
chunks.
This change adds a CPU side pointer in the push constant struct so
that we can create a single linked list of chunks to edit and go
through to write the correct jump address after all the generated
space has been allocated.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c950fe97a0 ("anv: implement generated (indexed) indirect draws")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
77 lines
2.5 KiB
C
77 lines
2.5 KiB
C
/*
|
|
* Copyright © 2022 Intel Corporation
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
* to deal in the Software without restriction, including without limitation
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice (including the next
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
* Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
* IN THE SOFTWARE.
|
|
*/
|
|
|
|
#ifndef ANV_GENERATED_INDIRECT_DRAWS_H
|
|
#define ANV_GENERATED_INDIRECT_DRAWS_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/* This needs to match generated_draws.glsl :
|
|
*
|
|
* layout(set = 0, binding = 2) uniform block
|
|
*/
|
|
struct anv_generated_indirect_draw_params {
|
|
uint32_t is_indexed;
|
|
uint32_t is_predicated;
|
|
uint32_t draw_base;
|
|
uint32_t draw_count;
|
|
uint32_t instance_multiplier;
|
|
uint32_t indirect_data_stride;
|
|
};
|
|
|
|
/* This needs to match generated_draws_count.glsl :
|
|
*
|
|
* layout(set = 0, binding = 2) uniform block
|
|
*/
|
|
struct anv_generated_indirect_draw_count_params {
|
|
uint32_t is_indexed;
|
|
uint32_t is_predicated;
|
|
uint32_t draw_base;
|
|
uint32_t item_count;
|
|
uint32_t draw_count;
|
|
uint32_t instance_multiplier;
|
|
uint32_t indirect_data_stride;
|
|
uint32_t end_addr_ldw;
|
|
uint32_t end_addr_udw;
|
|
};
|
|
|
|
struct anv_generate_indirect_params {
|
|
union {
|
|
struct anv_generated_indirect_draw_params draw;
|
|
struct anv_generated_indirect_draw_count_params draw_count;
|
|
};
|
|
|
|
/* Global address of binding 0 */
|
|
uint64_t indirect_data_addr;
|
|
|
|
/* Global address of binding 1 */
|
|
uint64_t generated_cmds_addr;
|
|
|
|
/* CPU side pointer to the previous item when number of draws has to be
|
|
* split into smaller chunks, see while loop in
|
|
* genX(cmd_buffer_emit_indirect_generated_draws)
|
|
*/
|
|
struct anv_generate_indirect_params *prev;
|
|
};
|
|
|
|
#endif /* ANV_GENERATED_INDIRECT_DRAWS_H */
|