mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
vk_state_tracker: Implement dirty flags for stencil properties
This commit is contained in:
parent
f9df2c6bcd
commit
6ac3eb4d87
3 changed files with 21 additions and 0 deletions
|
@ -1046,6 +1046,9 @@ void RasterizerVulkan::UpdateDepthBounds(Tegra::Engines::Maxwell3D& gpu) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerVulkan::UpdateStencilFaces(Tegra::Engines::Maxwell3D& gpu) {
|
void RasterizerVulkan::UpdateStencilFaces(Tegra::Engines::Maxwell3D& gpu) {
|
||||||
|
if (!state_tracker.TouchStencilProperties()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const auto& regs = gpu.regs;
|
const auto& regs = gpu.regs;
|
||||||
if (regs.stencil_two_side_enable) {
|
if (regs.stencil_two_side_enable) {
|
||||||
// Separate values per face
|
// Separate values per face
|
||||||
|
|
|
@ -33,6 +33,7 @@ Flags MakeInvalidationFlags() {
|
||||||
flags[DepthBias] = true;
|
flags[DepthBias] = true;
|
||||||
flags[BlendConstants] = true;
|
flags[BlendConstants] = true;
|
||||||
flags[DepthBounds] = true;
|
flags[DepthBounds] = true;
|
||||||
|
flags[StencilProperties] = true;
|
||||||
return flags;
|
return flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +95,17 @@ void SetupDirtyDepthBounds(Tables& tables) {
|
||||||
FillBlock(tables[0], OFF(depth_bounds), NUM(depth_bounds), DepthBounds);
|
FillBlock(tables[0], OFF(depth_bounds), NUM(depth_bounds), DepthBounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupDirtyStencilProperties(Tables& tables) {
|
||||||
|
auto& table = tables[0];
|
||||||
|
table[OFF(stencil_two_side_enable)] = StencilProperties;
|
||||||
|
table[OFF(stencil_front_func_ref)] = StencilProperties;
|
||||||
|
table[OFF(stencil_front_mask)] = StencilProperties;
|
||||||
|
table[OFF(stencil_front_func_mask)] = StencilProperties;
|
||||||
|
table[OFF(stencil_back_func_ref)] = StencilProperties;
|
||||||
|
table[OFF(stencil_back_mask)] = StencilProperties;
|
||||||
|
table[OFF(stencil_back_func_mask)] = StencilProperties;
|
||||||
|
}
|
||||||
|
|
||||||
} // Anonymous namespace
|
} // Anonymous namespace
|
||||||
|
|
||||||
StateTracker::StateTracker(Core::System& system)
|
StateTracker::StateTracker(Core::System& system)
|
||||||
|
@ -108,6 +120,7 @@ void StateTracker::Initialize() {
|
||||||
SetupDirtyDepthBias(tables);
|
SetupDirtyDepthBias(tables);
|
||||||
SetupDirtyBlendConstants(tables);
|
SetupDirtyBlendConstants(tables);
|
||||||
SetupDirtyDepthBounds(tables);
|
SetupDirtyDepthBounds(tables);
|
||||||
|
SetupDirtyStencilProperties(tables);
|
||||||
|
|
||||||
auto& store = dirty.on_write_stores;
|
auto& store = dirty.on_write_stores;
|
||||||
store[RenderTargets] = true;
|
store[RenderTargets] = true;
|
||||||
|
|
|
@ -24,6 +24,7 @@ enum : u8 {
|
||||||
DepthBias,
|
DepthBias,
|
||||||
BlendConstants,
|
BlendConstants,
|
||||||
DepthBounds,
|
DepthBounds,
|
||||||
|
StencilProperties,
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Dirty
|
} // namespace Dirty
|
||||||
|
@ -56,6 +57,10 @@ public:
|
||||||
return Exchange(Dirty::DepthBounds, false);
|
return Exchange(Dirty::DepthBounds, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool TouchStencilProperties() {
|
||||||
|
return Exchange(Dirty::StencilProperties, false);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>;
|
using Flags = std::remove_reference_t<decltype(Tegra::Engines::Maxwell3D::dirty.flags)>;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue