mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-27 22:18:57 +02:00
[vk] Depth State Refresh Update.
This commit is contained in:
parent
0a23704fb8
commit
f504328e3b
4 changed files with 28 additions and 0 deletions
|
|
@ -89,6 +89,10 @@ public:
|
||||||
bool SupportsAlphaToOne() const noexcept {
|
bool SupportsAlphaToOne() const noexcept {
|
||||||
return fragment_has_color0_output;
|
return fragment_has_color0_output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool UsesExtendedDynamicState() const noexcept {
|
||||||
|
return key.state.extended_dynamic_state != 0;
|
||||||
|
}
|
||||||
GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete;
|
GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete;
|
||||||
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;
|
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
#include "video_core/renderer_vulkan/vk_command_pool.h"
|
#include "video_core/renderer_vulkan/vk_command_pool.h"
|
||||||
|
#include "video_core/renderer_vulkan/vk_graphics_pipeline.h"
|
||||||
#include "video_core/renderer_vulkan/vk_master_semaphore.h"
|
#include "video_core/renderer_vulkan/vk_master_semaphore.h"
|
||||||
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
#include "video_core/renderer_vulkan/vk_scheduler.h"
|
||||||
#include "video_core/renderer_vulkan/vk_state_tracker.h"
|
#include "video_core/renderer_vulkan/vk_state_tracker.h"
|
||||||
|
|
@ -130,9 +131,27 @@ void Scheduler::RequestOutsideRenderPassOperationContext() {
|
||||||
|
|
||||||
bool Scheduler::UpdateGraphicsPipeline(GraphicsPipeline* pipeline) {
|
bool Scheduler::UpdateGraphicsPipeline(GraphicsPipeline* pipeline) {
|
||||||
if (state.graphics_pipeline == pipeline) {
|
if (state.graphics_pipeline == pipeline) {
|
||||||
|
if (pipeline && pipeline->UsesExtendedDynamicState() &&
|
||||||
|
state.needs_state_enable_refresh) {
|
||||||
|
state_tracker.InvalidateStateEnableFlag();
|
||||||
|
state.needs_state_enable_refresh = false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
state.graphics_pipeline = pipeline;
|
state.graphics_pipeline = pipeline;
|
||||||
|
|
||||||
|
if (!pipeline) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pipeline->UsesExtendedDynamicState()) {
|
||||||
|
state.needs_state_enable_refresh = true;
|
||||||
|
} else if (state.needs_state_enable_refresh) {
|
||||||
|
state_tracker.InvalidateStateEnableFlag();
|
||||||
|
state.needs_state_enable_refresh = false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -214,6 +214,7 @@ private:
|
||||||
GraphicsPipeline* graphics_pipeline = nullptr;
|
GraphicsPipeline* graphics_pipeline = nullptr;
|
||||||
bool is_rescaling = false;
|
bool is_rescaling = false;
|
||||||
bool rescaling_defined = false;
|
bool rescaling_defined = false;
|
||||||
|
bool needs_state_enable_refresh = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
void WorkerThread(std::stop_token stop_token);
|
void WorkerThread(std::stop_token stop_token);
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,10 @@ public:
|
||||||
(*flags)[Dirty::Scissors] = true;
|
(*flags)[Dirty::Scissors] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InvalidateStateEnableFlag() {
|
||||||
|
(*flags)[Dirty::StateEnable] = true;
|
||||||
|
}
|
||||||
|
|
||||||
bool TouchViewports() {
|
bool TouchViewports() {
|
||||||
const bool dirty_viewports = Exchange(Dirty::Viewports, false);
|
const bool dirty_viewports = Exchange(Dirty::Viewports, false);
|
||||||
const bool rescale_viewports = Exchange(VideoCommon::Dirty::RescaleViewports, false);
|
const bool rescale_viewports = Exchange(VideoCommon::Dirty::RescaleViewports, false);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue