From d1adbf0e53f368aa4339bcc3f9446dc37747b062 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 2 Apr 2024 14:10:24 +0200 Subject: [PATCH] radv: add radv_cp_reg_shadowing.h Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/meson.build | 1 + src/amd/vulkan/radv_cp_reg_shadowing.c | 1 + src/amd/vulkan/radv_cp_reg_shadowing.h | 47 ++++++++++++++++++++++++++ src/amd/vulkan/radv_private.h | 6 ---- src/amd/vulkan/radv_queue.c | 1 + 5 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 src/amd/vulkan/radv_cp_reg_shadowing.h diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build index 289e6f91719..ca8f9ec8184 100644 --- a/src/amd/vulkan/meson.build +++ b/src/amd/vulkan/meson.build @@ -112,6 +112,7 @@ libradv_files = files( 'radv_cmd_buffer.c', 'radv_cmd_buffer.h', 'radv_cp_reg_shadowing.c', + 'radv_cp_reg_shadowing.h', 'radv_cs.h', 'radv_debug.c', 'radv_debug.h', diff --git a/src/amd/vulkan/radv_cp_reg_shadowing.c b/src/amd/vulkan/radv_cp_reg_shadowing.c index e4874813fc5..b35913a8787 100644 --- a/src/amd/vulkan/radv_cp_reg_shadowing.c +++ b/src/amd/vulkan/radv_cp_reg_shadowing.c @@ -22,6 +22,7 @@ * USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#include "radv_cp_reg_shadowing.h" #include "ac_shadowed_regs.h" #include "radv_buffer.h" #include "radv_cs.h" diff --git a/src/amd/vulkan/radv_cp_reg_shadowing.h b/src/amd/vulkan/radv_cp_reg_shadowing.h new file mode 100644 index 00000000000..dc585fde0ac --- /dev/null +++ b/src/amd/vulkan/radv_cp_reg_shadowing.h @@ -0,0 +1,47 @@ +/* + * Copyright © 2016 Red Hat. + * Copyright © 2016 Bas Nieuwenhuizen + * + * based in part on anv driver which is: + * Copyright © 2015 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 RADV_CP_REG_SHADOWING_H +#define RADV_CP_REG_SHADOWING_H + +#include "radv_radeon_winsys.h" + +struct radv_device; +struct radv_queue_state; +struct radv_queue; + +VkResult radv_create_shadow_regs_preamble(struct radv_device *device, struct radv_queue_state *queue_state); + +void radv_destroy_shadow_regs_preamble(struct radv_device *device, struct radv_queue_state *queue_state, + struct radeon_winsys *ws); + +void radv_emit_shadow_regs_preamble(struct radeon_cmdbuf *cs, const struct radv_device *device, + struct radv_queue_state *queue_state); + +VkResult radv_init_shadowed_regs_buffer_state(const struct radv_device *device, struct radv_queue *queue); + +#endif /* RADV_CP_REG_SHADOWING_H */ diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 4eef1e0e509..05cc97c8438 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -250,12 +250,6 @@ void radv_write_scissors(struct radeon_cmdbuf *cs, int count, const VkRect2D *sc void radv_write_guardband(struct radeon_cmdbuf *cs, int count, const VkViewport *viewports, unsigned rast_prim, unsigned polygon_mode, float line_width); -VkResult radv_create_shadow_regs_preamble(struct radv_device *device, struct radv_queue_state *queue_state); -void radv_destroy_shadow_regs_preamble(struct radv_device *device, struct radv_queue_state *queue_state, - struct radeon_winsys *ws); -void radv_emit_shadow_regs_preamble(struct radeon_cmdbuf *cs, const struct radv_device *device, - struct radv_queue_state *queue_state); -VkResult radv_init_shadowed_regs_buffer_state(const struct radv_device *device, struct radv_queue *queue); uint32_t radv_get_ia_multi_vgt_param(struct radv_cmd_buffer *cmd_buffer, bool instanced_draw, bool indirect_draw, bool count_from_stream_output, uint32_t draw_vertex_count, unsigned topology, diff --git a/src/amd/vulkan/radv_queue.c b/src/amd/vulkan/radv_queue.c index 02568d0829c..57df85ad084 100644 --- a/src/amd/vulkan/radv_queue.c +++ b/src/amd/vulkan/radv_queue.c @@ -27,6 +27,7 @@ #include "radv_queue.h" #include "radv_buffer.h" +#include "radv_cp_reg_shadowing.h" #include "radv_cs.h" #include "radv_debug.h" #include "radv_device_memory.h"