mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-10-06 14:09:58 +00:00
Adjust cuts on depth draws
This commit is contained in:
@@ -264,6 +264,8 @@ void RasterizerVulkan::PrepareDraw(bool is_indexed, bool skip_empty, Func&& draw
|
||||
pipeline->SetEngine(maxwell3d, gpu_memory);
|
||||
if (!pipeline->Configure(is_indexed))
|
||||
return;
|
||||
scheduler.MarkDepthWrites(maxwell3d->regs.depth_test_enable != 0 &&
|
||||
maxwell3d->regs.depth_write_enabled != 0);
|
||||
|
||||
UpdateDynamicStates(pipeline->HasDynamicVertexInput());
|
||||
|
||||
@@ -583,6 +585,7 @@ void RasterizerVulkan::Clear(u32 layer_count) {
|
||||
if (aspect_flags == 0) {
|
||||
return;
|
||||
}
|
||||
scheduler.MarkDepthWrites(!can_defer_clear && (aspect_flags & VK_IMAGE_ASPECT_DEPTH_BIT) != 0);
|
||||
|
||||
if (use_stencil && framebuffer->HasAspectStencilBit() && regs.stencil_front_mask != 0xFF &&
|
||||
regs.stencil_front_mask != 0) {
|
||||
|
||||
@@ -99,6 +99,7 @@ void Scheduler::BeginRenderPassImpl(const Framebuffer* framebuffer, VkRenderPass
|
||||
state.framebuffer = framebuffer_handle;
|
||||
state.render_area = render_area;
|
||||
++renderpass_serial;
|
||||
renderpass_depth_writes = false;
|
||||
|
||||
if (GPU::Logging::IsActive() && Settings::values.gpu_log_vulkan_calls.GetValue()) {
|
||||
const std::string render_pass_info =
|
||||
@@ -161,6 +162,7 @@ void Scheduler::RealizeDeferredClear() {
|
||||
dc.color_clear_mask, dc.depth_stencil, color_discard_mask, depth_stencil_discard);
|
||||
EndRenderPass();
|
||||
BeginRenderPassImpl(dc.framebuffer, renderpass, clear_values.data(), count);
|
||||
renderpass_depth_writes = dc.depth_stencil;
|
||||
}
|
||||
|
||||
bool Scheduler::DeferColorClear(const Framebuffer* framebuffer, u32 rt_slot,
|
||||
|
||||
@@ -97,6 +97,14 @@ public:
|
||||
renderpass_writes = true;
|
||||
}
|
||||
|
||||
void MarkDepthWrites(bool writes) noexcept {
|
||||
renderpass_depth_writes |= writes;
|
||||
}
|
||||
|
||||
bool HasDepthWrites() const noexcept {
|
||||
return renderpass_depth_writes;
|
||||
}
|
||||
|
||||
/// Update the pipeline to the current execution context.
|
||||
bool UpdateGraphicsPipeline(GraphicsPipeline* pipeline);
|
||||
|
||||
@@ -334,6 +342,7 @@ private:
|
||||
u64 renderpass_serial = 0;
|
||||
u64 wfi_serial = 0;
|
||||
bool renderpass_writes = false;
|
||||
bool renderpass_depth_writes = false;
|
||||
u32 num_renderpass_images = 0;
|
||||
std::array<VkImage, 9> renderpass_images{};
|
||||
std::array<VkImageSubresourceRange, 9> renderpass_image_ranges{};
|
||||
|
||||
@@ -1210,7 +1210,9 @@ void TextureCacheRuntime::EraseResolveShadow(VkImage msaa_image) {
|
||||
}
|
||||
|
||||
void TextureCacheRuntime::BarrierFeedbackLoop() {
|
||||
scheduler.RequestOutsideRenderPassOperationContext();
|
||||
if (scheduler.HasDepthWrites()) {
|
||||
scheduler.RequestOutsideRenderPassOperationContext();
|
||||
}
|
||||
}
|
||||
|
||||
void TextureCacheRuntime::ReinterpretImage(Image& dst, Image& src,
|
||||
|
||||
Reference in New Issue
Block a user