|
|
|
@ -196,6 +196,14 @@ void RasterizerOpenGL::DrawTriangles() { |
|
|
|
(GLint)(rect.bottom + regs.viewport_corner.y * color_surface->res_scale_height), |
|
|
|
(GLsizei)(viewport_width * color_surface->res_scale_width), (GLsizei)(viewport_height * color_surface->res_scale_height)); |
|
|
|
|
|
|
|
if (uniform_block_data.data.framebuffer_scale[0] != color_surface->res_scale_width || |
|
|
|
uniform_block_data.data.framebuffer_scale[1] != color_surface->res_scale_height) { |
|
|
|
|
|
|
|
uniform_block_data.data.framebuffer_scale[0] = color_surface->res_scale_width; |
|
|
|
uniform_block_data.data.framebuffer_scale[1] = color_surface->res_scale_height; |
|
|
|
uniform_block_data.dirty = true; |
|
|
|
} |
|
|
|
|
|
|
|
// Sync and bind the texture surfaces
|
|
|
|
const auto pica_textures = regs.GetTextures(); |
|
|
|
for (unsigned texture_index = 0; texture_index < pica_textures.size(); ++texture_index) { |
|
|
|
@ -353,6 +361,15 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) { |
|
|
|
SyncColorWriteMask(); |
|
|
|
break; |
|
|
|
|
|
|
|
// Scissor test
|
|
|
|
case PICA_REG_INDEX(scissor_test.mode): |
|
|
|
shader_dirty = true; |
|
|
|
break; |
|
|
|
case PICA_REG_INDEX(scissor_test.x1): // and y1
|
|
|
|
case PICA_REG_INDEX(scissor_test.x2): // and y2
|
|
|
|
SyncScissorTest(); |
|
|
|
break; |
|
|
|
|
|
|
|
// Logic op
|
|
|
|
case PICA_REG_INDEX(output_merger.logic_op): |
|
|
|
SyncLogicOp(); |
|
|
|
@ -1002,6 +1019,7 @@ void RasterizerOpenGL::SetShader() { |
|
|
|
SyncDepthOffset(); |
|
|
|
SyncAlphaTest(); |
|
|
|
SyncCombinerColor(); |
|
|
|
SyncScissorTest(); |
|
|
|
auto& tev_stages = Pica::g_state.regs.GetTevStages(); |
|
|
|
for (int index = 0; index < tev_stages.size(); ++index) |
|
|
|
SyncTevConstColor(index, tev_stages[index]); |
|
|
|
@ -1166,6 +1184,22 @@ void RasterizerOpenGL::SyncDepthTest() { |
|
|
|
PicaToGL::CompareFunc(regs.output_merger.depth_test_func) : GL_ALWAYS; |
|
|
|
} |
|
|
|
|
|
|
|
void RasterizerOpenGL::SyncScissorTest() { |
|
|
|
const auto& regs = Pica::g_state.regs; |
|
|
|
|
|
|
|
if (uniform_block_data.data.scissor_x1 != regs.scissor_test.x1 || |
|
|
|
uniform_block_data.data.scissor_y1 != regs.scissor_test.y1 || |
|
|
|
uniform_block_data.data.scissor_x2 != regs.scissor_test.x2 || |
|
|
|
uniform_block_data.data.scissor_y2 != regs.scissor_test.y2) { |
|
|
|
|
|
|
|
uniform_block_data.data.scissor_x1 = regs.scissor_test.x1; |
|
|
|
uniform_block_data.data.scissor_y1 = regs.scissor_test.y1; |
|
|
|
uniform_block_data.data.scissor_x2 = regs.scissor_test.x2; |
|
|
|
uniform_block_data.data.scissor_y2 = regs.scissor_test.y2; |
|
|
|
uniform_block_data.dirty = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
void RasterizerOpenGL::SyncCombinerColor() { |
|
|
|
auto combiner_color = PicaToGL::ColorRGBA8(Pica::g_state.regs.tev_combiner_buffer_color.raw); |
|
|
|
if (combiner_color != uniform_block_data.data.tev_combiner_buffer_color) { |
|
|
|
|