mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-08-21 00:53:22 +02:00
vk_state_tracker: Implement dirty flags for blend constants
This commit is contained in:
parent
a33870996b
commit
cd0e28c9ec
@ -1026,6 +1026,9 @@ void RasterizerVulkan::UpdateDepthBias(Tegra::Engines::Maxwell3D& gpu) {
|
||||
}
|
||||
|
||||
void RasterizerVulkan::UpdateBlendConstants(Tegra::Engines::Maxwell3D& gpu) {
|
||||
if (!state_tracker.TouchBlendConstants()) {
|
||||
return;
|
||||
}
|
||||
const std::array blend_color = {gpu.regs.blend_color.r, gpu.regs.blend_color.g,
|
||||
gpu.regs.blend_color.b, gpu.regs.blend_color.a};
|
||||
scheduler.Record([blend_color](auto cmdbuf, auto& dld) {
|
||||
|
@ -31,6 +31,7 @@ Flags MakeInvalidationFlags() {
|
||||
flags[Viewports] = true;
|
||||
flags[Scissors] = true;
|
||||
flags[DepthBias] = true;
|
||||
flags[BlendConstants] = true;
|
||||
return flags;
|
||||
}
|
||||
|
||||
@ -84,6 +85,10 @@ void SetupDirtyDepthBias(Tables& tables) {
|
||||
table[OFF(polygon_offset_factor)] = DepthBias;
|
||||
}
|
||||
|
||||
void SetupDirtyBlendConstants(Tables& tables) {
|
||||
FillBlock(tables[0], OFF(blend_color), NUM(blend_color), BlendConstants);
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
StateTracker::StateTracker(Core::System& system)
|
||||
@ -96,6 +101,7 @@ void StateTracker::Initialize() {
|
||||
SetupDirtyViewports(tables);
|
||||
SetupDirtyScissors(tables);
|
||||
SetupDirtyDepthBias(tables);
|
||||
SetupDirtyBlendConstants(tables);
|
||||
|
||||
auto& store = dirty.on_write_stores;
|
||||
store[RenderTargets] = true;
|
||||
|
@ -22,6 +22,7 @@ enum : u8 {
|
||||
Viewports,
|
||||
Scissors,
|
||||
DepthBias,
|
||||
BlendConstants,
|
||||
};
|
||||
|
||||
} // namespace Dirty
|
||||
@ -46,6 +47,10 @@ public:
|
||||
return Exchange(Dirty::DepthBias, false);
|
||||
}
|
||||
|
||||
bool TouchBlendConstants() {
|
||||
return Exchange(Dirty::BlendConstants, false);
|
||||
}
|
||||
|
||||
private:
|
||||
using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user