build: Clear out remaining compile warnings. (#6662)

This commit is contained in:
Steveice10
2023-07-04 21:00:24 -07:00
committed by GitHub
parent 2126c240cd
commit 13a8969824
26 changed files with 117 additions and 103 deletions

View File

@@ -292,11 +292,6 @@ void RasterizerSoftware::ProcessTriangle(const Vertex& v0, const Vertex& v1, con
auto textures = regs.texturing.GetTextures();
const auto tev_stages = regs.texturing.GetTevStages();
const bool stencil_action_enable =
regs.framebuffer.output_merger.stencil_test.enable &&
regs.framebuffer.framebuffer.depth_format == FramebufferRegs::DepthFormat::D24S8;
const auto stencil_test = regs.framebuffer.output_merger.stencil_test;
// Enter rasterization loop, starting at the center of the topleft bounding box corner.
// TODO: Not sure if looping through x first might be faster
for (u16 y = min_y + 8; y < max_y; y += 0x10) {
@@ -446,7 +441,7 @@ void RasterizerSoftware::ProcessTriangle(const Vertex& v0, const Vertex& v1, con
continue;
}
WriteFog(combiner_output, depth);
if (!DoDepthStencilTest(x, y, depth, stencil_action_enable)) {
if (!DoDepthStencilTest(x, y, depth)) {
continue;
}
const auto result = PixelColor(x, y, combiner_output);
@@ -828,11 +823,14 @@ bool RasterizerSoftware::DoAlphaTest(u8 alpha) const {
return alpha > output_merger.alpha_test.ref;
case FramebufferRegs::CompareFunc::GreaterThanOrEqual:
return alpha >= output_merger.alpha_test.ref;
default:
LOG_CRITICAL(Render_Software, "Unknown alpha test condition {}",
output_merger.alpha_test.func.Value());
return false;
}
}
bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth,
bool stencil_action_enable) const {
bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth) const {
const auto& framebuffer = regs.framebuffer.framebuffer;
const auto stencil_test = regs.framebuffer.output_merger.stencil_test;
u8 old_stencil = 0;
@@ -847,6 +845,10 @@ bool RasterizerSoftware::DoDepthStencilTest(u16 x, u16 y, float depth,
}
};
const bool stencil_action_enable =
regs.framebuffer.output_merger.stencil_test.enable &&
regs.framebuffer.framebuffer.depth_format == FramebufferRegs::DepthFormat::D24S8;
if (stencil_action_enable) {
old_stencil = fb.GetStencil(x >> 4, y >> 4);
const u8 dest = old_stencil & stencil_test.input_mask;

View File

@@ -68,7 +68,7 @@ private:
bool DoAlphaTest(u8 alpha) const;
/// Performs the depth stencil test. Returns false if the test failed.
bool DoDepthStencilTest(u16 x, u16 y, float depth, bool stencil_action_enable) const;
bool DoDepthStencilTest(u16 x, u16 y, float depth) const;
private:
Memory::MemorySystem& memory;