radv: add support for VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32750>
This commit is contained in:
committed by
Marge Bot
parent
de2cb4a7d3
commit
0f8d07d355
@@ -11007,7 +11007,7 @@ radv_bind_graphics_shaders(struct radv_cmd_buffer *cmd_buffer)
|
||||
if (cmd_buffer->state.active_stages &
|
||||
(VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT |
|
||||
VK_SHADER_STAGE_GEOMETRY_BIT | VK_SHADER_STAGE_MESH_BIT_EXT)) {
|
||||
cmd_buffer->state.rast_prim = radv_get_vgt_gs_out(cmd_buffer->state.shaders, 0);
|
||||
cmd_buffer->state.rast_prim = radv_get_vgt_gs_out(cmd_buffer->state.shaders, 0, false);
|
||||
}
|
||||
|
||||
const struct radv_shader *vs = radv_get_shader(cmd_buffer->state.shaders, MESA_SHADER_VERTEX);
|
||||
|
||||
@@ -3241,7 +3241,7 @@ radv_pipeline_init_shader_stages_state(const struct radv_device *device, struct
|
||||
}
|
||||
|
||||
uint32_t
|
||||
radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology)
|
||||
radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology, bool is_ngg)
|
||||
{
|
||||
uint32_t gs_out;
|
||||
|
||||
@@ -3256,7 +3256,7 @@ radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology)
|
||||
} else if (shaders[MESA_SHADER_MESH]) {
|
||||
gs_out = radv_conv_gl_prim_to_gs_out(shaders[MESA_SHADER_MESH]->info.ms.output_prim);
|
||||
} else {
|
||||
gs_out = radv_conv_prim_to_gs_out(primitive_topology, false);
|
||||
gs_out = radv_conv_prim_to_gs_out(primitive_topology, is_ngg);
|
||||
}
|
||||
|
||||
return gs_out;
|
||||
@@ -3265,12 +3265,13 @@ radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology)
|
||||
static uint32_t
|
||||
radv_pipeline_init_vgt_gs_out(struct radv_graphics_pipeline *pipeline, const struct vk_graphics_pipeline_state *state)
|
||||
{
|
||||
const bool is_ngg = pipeline->base.shaders[pipeline->last_vgt_api_stage]->info.is_ngg;
|
||||
uint32_t primitive_topology = 0;
|
||||
|
||||
if (pipeline->last_vgt_api_stage == MESA_SHADER_VERTEX)
|
||||
primitive_topology = radv_translate_prim(state->ia->primitive_topology);
|
||||
|
||||
return radv_get_vgt_gs_out(pipeline->base.shaders, primitive_topology);
|
||||
return radv_get_vgt_gs_out(pipeline->base.shaders, primitive_topology, is_ngg);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "radv_shader.h"
|
||||
|
||||
#include "vk_graphics_state.h"
|
||||
#include "vk_meta.h"
|
||||
|
||||
struct radv_sample_locations_state {
|
||||
VkSampleCountFlagBits per_pixel;
|
||||
@@ -237,6 +238,8 @@ radv_translate_prim(unsigned topology)
|
||||
return V_008958_DI_PT_TRISTRIP_ADJ;
|
||||
case VK_PRIMITIVE_TOPOLOGY_PATCH_LIST:
|
||||
return V_008958_DI_PT_PATCH;
|
||||
case VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA:
|
||||
return V_008958_DI_PT_RECTLIST;
|
||||
default:
|
||||
unreachable("unhandled primitive type");
|
||||
}
|
||||
@@ -613,7 +616,7 @@ struct radv_vgt_shader_key {
|
||||
struct radv_vgt_shader_key radv_get_vgt_shader_key(const struct radv_device *device, struct radv_shader **shaders,
|
||||
const struct radv_shader *gs_copy_shader);
|
||||
|
||||
uint32_t radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology);
|
||||
uint32_t radv_get_vgt_gs_out(struct radv_shader **shaders, uint32_t primitive_topology, bool is_ngg);
|
||||
|
||||
bool radv_needs_null_export_workaround(const struct radv_device *device, const struct radv_shader *ps,
|
||||
unsigned custom_blend_mode);
|
||||
|
||||
Reference in New Issue
Block a user