mirror of
https://github.com/stenzek/duckstation.git
synced 2026-02-04 05:04:33 +00:00
VulkanDevice: Set rasterization order attachment access bit on blend state
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user