Rasterizer: Shorten code using helper variables

This commit is contained in:
Jannik Vogel 2016-04-17 22:58:51 +02:00
parent 431df448ef
commit 537ba32167

View File

@ -344,6 +344,7 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0,
{ {
const auto& regs = g_state.regs; const auto& regs = g_state.regs;
const auto& framebuffer = regs.framebuffer; const auto& framebuffer = regs.framebuffer;
const auto& output_merger = regs.output_merger;
MICROPROFILE_SCOPE(GPU_Rasterization); MICROPROFILE_SCOPE(GPU_Rasterization);
// vertex positions in rasterizer coordinates // vertex positions in rasterizer coordinates
@ -424,8 +425,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0,
auto textures = regs.GetTextures(); auto textures = regs.GetTextures();
auto tev_stages = regs.GetTevStages(); auto tev_stages = regs.GetTevStages();
bool stencil_action_enable = g_state.regs.output_merger.stencil_test.enable && framebuffer.depth_format == Regs::DepthFormat::D24S8; bool stencil_action_enable = output_merger.stencil_test.enable && framebuffer.depth_format == Regs::DepthFormat::D24S8;
const auto stencil_test = g_state.regs.output_merger.stencil_test; const auto stencil_test = output_merger.stencil_test;
// Enter rasterization loop, starting at the center of the topleft bounding box corner. // Enter rasterization loop, starting at the center of the topleft bounding box corner.
// TODO: Not sure if looping through x first might be faster // TODO: Not sure if looping through x first might be faster
@ -841,7 +842,6 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0,
} }
} }
const auto& output_merger = regs.output_merger;
// TODO: Does alpha testing happen before or after stencil? // TODO: Does alpha testing happen before or after stencil?
if (output_merger.alpha_test.enable) { if (output_merger.alpha_test.enable) {
bool pass = false; bool pass = false;