tu: Implement VK_EXT_attachment_feedback_loop_layout
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18064>
This commit is contained in:

committed by
Marge Bot

parent
b7601dd27e
commit
0bf2033e0d
@@ -532,6 +532,7 @@ Khronos extensions that are not part of any Vulkan version:
|
|||||||
VK_KHR_win32_surface DONE (dzn, lvp)
|
VK_KHR_win32_surface DONE (dzn, lvp)
|
||||||
VK_KHR_xcb_surface DONE (anv, dzn, lvp, radv, tu, v3dv, vn)
|
VK_KHR_xcb_surface DONE (anv, dzn, lvp, radv, tu, v3dv, vn)
|
||||||
VK_KHR_xlib_surface DONE (anv, dzn, lvp, radv, tu, v3dv, vn)
|
VK_KHR_xlib_surface DONE (anv, dzn, lvp, radv, tu, v3dv, vn)
|
||||||
|
VK_EXT_attachment_feedback_loop_layout DONE (radv, tu)
|
||||||
VK_EXT_border_color_swizzle DONE (anv, lvp, tu, radv/gfx10+)
|
VK_EXT_border_color_swizzle DONE (anv, lvp, tu, radv/gfx10+)
|
||||||
VK_EXT_buffer_device_address DONE (anv/gen8+, radv)
|
VK_EXT_buffer_device_address DONE (anv/gen8+, radv)
|
||||||
VK_EXT_calibrated_timestamps DONE (anv, lvp, radv, vn)
|
VK_EXT_calibrated_timestamps DONE (anv, lvp, radv, vn)
|
||||||
|
@@ -2561,6 +2561,25 @@ tu_CmdBindPipeline(VkCommandBuffer commandBuffer,
|
|||||||
cmd->state.dirty |= TU_CMD_DIRTY_DESC_SETS_LOAD | TU_CMD_DIRTY_SHADER_CONSTS |
|
cmd->state.dirty |= TU_CMD_DIRTY_DESC_SETS_LOAD | TU_CMD_DIRTY_SHADER_CONSTS |
|
||||||
TU_CMD_DIRTY_LRZ | TU_CMD_DIRTY_VS_PARAMS;
|
TU_CMD_DIRTY_LRZ | TU_CMD_DIRTY_VS_PARAMS;
|
||||||
|
|
||||||
|
if (pipeline->feedback_loop_may_involve_textures) {
|
||||||
|
/* VK_EXT_attachment_feedback_loop_layout allows feedback loop to involve
|
||||||
|
* not only input attachments but also sampled images or image resources.
|
||||||
|
* But we cannot just patch gmem for image in the descriptors.
|
||||||
|
*
|
||||||
|
* At the moment, in context of DXVK, it is expected that only a few
|
||||||
|
* drawcalls in a frame would use feedback loop and they would be wrapped
|
||||||
|
* in their own renderpasses, so it should be ok to force sysmem.
|
||||||
|
*
|
||||||
|
* However, there are two further possible optimizations if need would
|
||||||
|
* arise for other translation layer:
|
||||||
|
* - Tiling could be enabled if we ensure that there is no barrier in
|
||||||
|
* the renderpass;
|
||||||
|
* - Check that both pipeline and attachments agree that feedback loop
|
||||||
|
* is needed.
|
||||||
|
*/
|
||||||
|
cmd->state.rp.disable_gmem = true;
|
||||||
|
}
|
||||||
|
|
||||||
struct tu_cs *cs = &cmd->draw_cs;
|
struct tu_cs *cs = &cmd->draw_cs;
|
||||||
|
|
||||||
/* note: this also avoids emitting draw states before renderpass clears,
|
/* note: this also avoids emitting draw states before renderpass clears,
|
||||||
|
@@ -213,6 +213,7 @@ get_device_extensions(const struct tu_physical_device *device,
|
|||||||
.EXT_pipeline_creation_feedback = true,
|
.EXT_pipeline_creation_feedback = true,
|
||||||
.EXT_pipeline_creation_cache_control = true,
|
.EXT_pipeline_creation_cache_control = true,
|
||||||
.EXT_vertex_input_dynamic_state = true,
|
.EXT_vertex_input_dynamic_state = true,
|
||||||
|
.EXT_attachment_feedback_loop_layout = true,
|
||||||
#ifndef TU_USE_KGSL
|
#ifndef TU_USE_KGSL
|
||||||
.EXT_physical_device_drm = true,
|
.EXT_physical_device_drm = true,
|
||||||
#endif
|
#endif
|
||||||
@@ -926,6 +927,12 @@ tu_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice,
|
|||||||
features->nonSeamlessCubeMap = true;
|
features->nonSeamlessCubeMap = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT: {
|
||||||
|
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT *features =
|
||||||
|
(VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT*)ext;
|
||||||
|
features->attachmentFeedbackLoopLayout = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@@ -270,6 +270,7 @@ struct tu_pipeline_builder
|
|||||||
bool subpass_raster_order_attachment_access;
|
bool subpass_raster_order_attachment_access;
|
||||||
bool subpass_feedback_loop_color;
|
bool subpass_feedback_loop_color;
|
||||||
bool subpass_feedback_loop_ds;
|
bool subpass_feedback_loop_ds;
|
||||||
|
bool feedback_loop_may_involve_textures;
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
@@ -3438,6 +3439,9 @@ tu_pipeline_builder_parse_rasterization(struct tu_pipeline_builder *builder,
|
|||||||
const VkPipelineRasterizationStateCreateInfo *rast_info =
|
const VkPipelineRasterizationStateCreateInfo *rast_info =
|
||||||
builder->create_info->pRasterizationState;
|
builder->create_info->pRasterizationState;
|
||||||
|
|
||||||
|
pipeline->feedback_loop_may_involve_textures =
|
||||||
|
builder->feedback_loop_may_involve_textures;
|
||||||
|
|
||||||
enum a6xx_polygon_mode mode = tu6_polygon_mode(rast_info->polygonMode);
|
enum a6xx_polygon_mode mode = tu6_polygon_mode(rast_info->polygonMode);
|
||||||
|
|
||||||
builder->depth_clip_disable = rast_info->depthClampEnable;
|
builder->depth_clip_disable = rast_info->depthClampEnable;
|
||||||
@@ -4053,6 +4057,15 @@ tu_pipeline_builder_init_graphics(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builder->create_info->flags & VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT) {
|
||||||
|
builder->subpass_feedback_loop_color = true;
|
||||||
|
builder->feedback_loop_may_involve_textures = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (builder->create_info->flags & VK_PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT) {
|
||||||
|
builder->subpass_feedback_loop_ds = true;
|
||||||
|
builder->feedback_loop_may_involve_textures = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (builder->rasterizer_discard) {
|
if (builder->rasterizer_discard) {
|
||||||
builder->samples = VK_SAMPLE_COUNT_1_BIT;
|
builder->samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
@@ -191,6 +191,7 @@ struct tu_pipeline
|
|||||||
/* In other words - framebuffer fetch support */
|
/* In other words - framebuffer fetch support */
|
||||||
bool raster_order_attachment_access;
|
bool raster_order_attachment_access;
|
||||||
bool subpass_feedback_loop_ds;
|
bool subpass_feedback_loop_ds;
|
||||||
|
bool feedback_loop_may_involve_textures;
|
||||||
|
|
||||||
bool z_negative_one_to_one;
|
bool z_negative_one_to_one;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user