mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 11:10:27 +01:00
radv: add radv_device_generated_commands.h
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28510>
This commit is contained in:
parent
c4e83026af
commit
89182faee8
5 changed files with 88 additions and 45 deletions
|
|
@ -119,6 +119,7 @@ libradv_files = files(
|
|||
'radv_descriptor_set.c',
|
||||
'radv_descriptor_set.h',
|
||||
'radv_device_generated_commands.c',
|
||||
'radv_device_generated_commands.h',
|
||||
'radv_event.c',
|
||||
'radv_event.h',
|
||||
'radv_formats.c',
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "meta/radv_meta.h"
|
||||
#include "radv_cs.h"
|
||||
#include "radv_debug.h"
|
||||
#include "radv_device_generated_commands.h"
|
||||
#include "radv_event.h"
|
||||
#include "radv_private.h"
|
||||
#include "radv_radeon_winsys.h"
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "radv_device_generated_commands.h"
|
||||
#include "meta/radv_meta.h"
|
||||
#include "radv_private.h"
|
||||
|
||||
|
|
|
|||
85
src/amd/vulkan/radv_device_generated_commands.h
Normal file
85
src/amd/vulkan/radv_device_generated_commands.h
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
* 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_DEVICE_GENERATED_COMMANDS_H
|
||||
#define RADV_DEVICE_GENERATED_COMMANDS_H
|
||||
|
||||
#include "vk_object.h"
|
||||
|
||||
#include "radv_constants.h"
|
||||
|
||||
struct radv_cmd_buffer;
|
||||
struct radv_pipeline;
|
||||
|
||||
struct radv_indirect_command_layout {
|
||||
struct vk_object_base base;
|
||||
|
||||
VkIndirectCommandsLayoutUsageFlagsNV flags;
|
||||
VkPipelineBindPoint pipeline_bind_point;
|
||||
|
||||
uint32_t input_stride;
|
||||
uint32_t token_count;
|
||||
|
||||
bool indexed;
|
||||
bool binds_index_buffer;
|
||||
bool draw_mesh_tasks;
|
||||
uint16_t draw_params_offset;
|
||||
uint16_t index_buffer_offset;
|
||||
|
||||
uint16_t dispatch_params_offset;
|
||||
|
||||
bool bind_pipeline;
|
||||
uint16_t pipeline_params_offset;
|
||||
|
||||
uint32_t bind_vbo_mask;
|
||||
uint32_t vbo_offsets[MAX_VBS];
|
||||
|
||||
uint64_t push_constant_mask;
|
||||
uint32_t push_constant_offsets[MAX_PUSH_CONSTANTS_SIZE / 4];
|
||||
uint32_t push_constant_size;
|
||||
uint32_t dynamic_offset_count;
|
||||
|
||||
uint32_t ibo_type_32;
|
||||
uint32_t ibo_type_8;
|
||||
|
||||
VkIndirectCommandsLayoutTokenNV tokens[0];
|
||||
};
|
||||
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_indirect_command_layout, base, VkIndirectCommandsLayoutNV,
|
||||
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV)
|
||||
|
||||
uint32_t radv_get_indirect_cmdbuf_size(const VkGeneratedCommandsInfoNV *cmd_info);
|
||||
|
||||
bool radv_use_dgc_predication(struct radv_cmd_buffer *cmd_buffer,
|
||||
const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo);
|
||||
|
||||
bool radv_dgc_can_preprocess(const struct radv_indirect_command_layout *layout, struct radv_pipeline *pipeline);
|
||||
|
||||
void radv_prepare_dgc(struct radv_cmd_buffer *cmd_buffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo,
|
||||
bool cond_render_enabled);
|
||||
|
||||
#endif /* RADV_DEVICE_GENERATED_COMMANDS_H */
|
||||
|
|
@ -2773,49 +2773,6 @@ void radv_sqtt_emit_relocated_shaders(struct radv_cmd_buffer *cmd_buffer, struct
|
|||
void radv_write_user_event_marker(struct radv_cmd_buffer *cmd_buffer, enum rgp_sqtt_marker_user_event_type type,
|
||||
const char *str);
|
||||
|
||||
struct radv_indirect_command_layout {
|
||||
struct vk_object_base base;
|
||||
|
||||
VkIndirectCommandsLayoutUsageFlagsNV flags;
|
||||
VkPipelineBindPoint pipeline_bind_point;
|
||||
|
||||
uint32_t input_stride;
|
||||
uint32_t token_count;
|
||||
|
||||
bool indexed;
|
||||
bool binds_index_buffer;
|
||||
bool draw_mesh_tasks;
|
||||
uint16_t draw_params_offset;
|
||||
uint16_t index_buffer_offset;
|
||||
|
||||
uint16_t dispatch_params_offset;
|
||||
|
||||
bool bind_pipeline;
|
||||
uint16_t pipeline_params_offset;
|
||||
|
||||
uint32_t bind_vbo_mask;
|
||||
uint32_t vbo_offsets[MAX_VBS];
|
||||
|
||||
uint64_t push_constant_mask;
|
||||
uint32_t push_constant_offsets[MAX_PUSH_CONSTANTS_SIZE / 4];
|
||||
uint32_t push_constant_size;
|
||||
uint32_t dynamic_offset_count;
|
||||
|
||||
uint32_t ibo_type_32;
|
||||
uint32_t ibo_type_8;
|
||||
|
||||
VkIndirectCommandsLayoutTokenNV tokens[0];
|
||||
};
|
||||
|
||||
uint32_t radv_get_indirect_cmdbuf_size(const VkGeneratedCommandsInfoNV *cmd_info);
|
||||
|
||||
bool radv_use_dgc_predication(struct radv_cmd_buffer *cmd_buffer,
|
||||
const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo);
|
||||
void radv_prepare_dgc(struct radv_cmd_buffer *cmd_buffer, const VkGeneratedCommandsInfoNV *pGeneratedCommandsInfo,
|
||||
bool cond_render_enabled);
|
||||
|
||||
bool radv_dgc_can_preprocess(const struct radv_indirect_command_layout *layout, struct radv_pipeline *pipeline);
|
||||
|
||||
static inline uint32_t
|
||||
radv_conv_prim_to_gs_out(uint32_t topology, bool is_ngg)
|
||||
{
|
||||
|
|
@ -3307,8 +3264,6 @@ VK_DEFINE_HANDLE_CASTS(radv_instance, vk.base, VkInstance, VK_OBJECT_TYPE_INSTAN
|
|||
VK_DEFINE_HANDLE_CASTS(radv_physical_device, vk.base, VkPhysicalDevice, VK_OBJECT_TYPE_PHYSICAL_DEVICE)
|
||||
VK_DEFINE_HANDLE_CASTS(radv_queue, vk.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_device_memory, base, VkDeviceMemory, VK_OBJECT_TYPE_DEVICE_MEMORY)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_indirect_command_layout, base, VkIndirectCommandsLayoutNV,
|
||||
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_pipeline, base, VkPipeline, VK_OBJECT_TYPE_PIPELINE)
|
||||
VK_DEFINE_NONDISP_HANDLE_CASTS(radv_shader_object, base, VkShaderEXT, VK_OBJECT_TYPE_SHADER_EXT);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue