VulkanDevice: Set rasterization order attachment access bit on blend state

This commit is contained in:
Stenzek
2025-12-16 21:17:42 +10:00
parent 7a539ba693
commit fe8d2e0329
5 changed files with 29 additions and 5 deletions

View File

@@ -1464,9 +1464,22 @@ bool GPU_HW::CompilePipelines(Error* error)
plconfig.SetTargetFormats(use_rov ? GPUTexture::Format::Unknown : VRAM_RT_FORMAT,
needs_rov_depth ? GPUTexture::Format::Unknown : depth_buffer_format);
plconfig.color_formats[1] = needs_rov_depth ? VRAM_DS_COLOR_FORMAT : GPUTexture::Format::Unknown;
plconfig.render_pass_flags =
use_rov ? GPUPipeline::BindRenderTargetsAsImages :
(needs_feedback_loop ? GPUPipeline::ColorFeedbackLoop : GPUPipeline::NoRenderPassFlags);
// Don't enable feedback loop bit if it's not needed.
if (use_rov)
{
plconfig.render_pass_flags = GPUPipeline::BindRenderTargetsAsImages;
}
else if (needs_feedback_loop)
{
plconfig.render_pass_flags = static_cast<GPUPipeline::RenderPassFlag>(
use_shader_blending ? (GPUPipeline::ColorFeedbackLoop | GPUPipeline::ColorFeedbackLoopActive) :
GPUPipeline::ColorFeedbackLoop);
}
else
{
plconfig.render_pass_flags = GPUPipeline::NoRenderPassFlags;
}
plconfig.blend = GPUPipeline::BlendState::GetNoBlendingState();

View File

@@ -229,8 +229,9 @@ public:
{
NoRenderPassFlags = 0,
ColorFeedbackLoop = (1 << 0),
SampleDepthBuffer = (1 << 1),
BindRenderTargetsAsImages = (1 << 2),
ColorFeedbackLoopActive = (1 << 1),
SampleDepthBuffer = (1 << 2),
BindRenderTargetsAsImages = (1 << 3),
};
enum class Primitive : u8

View File

@@ -4146,6 +4146,8 @@ void VulkanDevice::DrawIndexedWithBarrierWithPushConstants(u32 index_count, u32
void VulkanDevice::SubmitDrawIndexedWithBarrier(u32 index_count, u32 base_index, u32 base_vertex, DrawBarrier type)
{
DebugAssert(m_current_pipeline->GetRenderPassFlags() & GPUPipeline::ColorFeedbackLoopActive);
switch (type)
{
case GPUDevice::DrawBarrier::None:

View File

@@ -244,6 +244,13 @@ std::unique_ptr<GPUPipeline> VulkanDevice::CreatePipeline(const GPUPipeline::Gra
gpb.SetPipelineLayout(m_pipeline_layouts[static_cast<size_t>(GetPipelineLayoutType(config.render_pass_flags))]
[static_cast<size_t>(config.layout)]);
if ((config.render_pass_flags & GPUPipeline::ColorFeedbackLoopActive) &&
m_optional_extensions.vk_ext_rasterization_order_attachment_access)
{
DebugAssert(config.render_pass_flags & GPUPipeline::ColorFeedbackLoop);
gpb.AddBlendFlags(VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT);
}
if (m_optional_extensions.vk_khr_dynamic_rendering && (m_optional_extensions.vk_khr_dynamic_rendering_local_read ||
!(config.render_pass_flags & GPUPipeline::ColorFeedbackLoop)))
{

View File

@@ -35,6 +35,7 @@ public:
ALWAYS_INLINE VkPipeline GetPipeline() const { return m_pipeline; }
ALWAYS_INLINE Layout GetLayout() const { return m_layout; }
ALWAYS_INLINE u8 GetVerticesPerPrimitive() const { return m_vertices_per_primitive; }
ALWAYS_INLINE RenderPassFlag GetRenderPassFlags() const { return m_render_pass_flags; }
#ifdef ENABLE_GPU_OBJECT_NAMES
void SetDebugName(std::string_view name) override;