GPU: Precompute texture window expression [SAVEVERSION+]

This commit is contained in:
Connor McLaughlin
2020-09-20 21:28:45 +10:00
parent f761f1550f
commit cacf7a7cc9
8 changed files with 35 additions and 34 deletions

View File

@ -602,10 +602,8 @@ void GPU_SW::ShadePixel(u32 x, u32 y, u8 color_r, u8 color_g, u8 color_b, u8 tex
{
// Apply texture window
// TODO: Precompute the second half
texcoord_x = (texcoord_x & ~(m_draw_mode.texture_window_mask_x * 8u)) |
((m_draw_mode.texture_window_offset_x & m_draw_mode.texture_window_mask_x) * 8u);
texcoord_y = (texcoord_y & ~(m_draw_mode.texture_window_mask_y * 8u)) |
((m_draw_mode.texture_window_offset_y & m_draw_mode.texture_window_mask_y) * 8u);
texcoord_x = (texcoord_x & m_draw_mode.texture_window_and_x) | m_draw_mode.texture_window_or_x;
texcoord_y = (texcoord_y & m_draw_mode.texture_window_and_y) | m_draw_mode.texture_window_or_y;
VRAMPixel texture_color;
switch (m_draw_mode.GetTextureMode())