|
|
@ -126,6 +126,7 @@ void RasterizerOpenGL::InitObjects() {
|
|
|
|
|
|
|
|
|
|
|
|
void RasterizerOpenGL::Reset() {
|
|
|
|
void RasterizerOpenGL::Reset() {
|
|
|
|
SyncCullMode();
|
|
|
|
SyncCullMode();
|
|
|
|
|
|
|
|
SyncDepthModifiers();
|
|
|
|
SyncBlendEnabled();
|
|
|
|
SyncBlendEnabled();
|
|
|
|
SyncBlendFuncs();
|
|
|
|
SyncBlendFuncs();
|
|
|
|
SyncBlendColor();
|
|
|
|
SyncBlendColor();
|
|
|
@ -194,6 +195,12 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
|
|
|
|
SyncCullMode();
|
|
|
|
SyncCullMode();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Depth modifiers
|
|
|
|
|
|
|
|
case PICA_REG_INDEX(viewport_depth_range):
|
|
|
|
|
|
|
|
case PICA_REG_INDEX(viewport_depth_far_plane):
|
|
|
|
|
|
|
|
SyncDepthModifiers();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
// Blending
|
|
|
|
// Blending
|
|
|
|
case PICA_REG_INDEX(output_merger.alphablend_enable):
|
|
|
|
case PICA_REG_INDEX(output_merger.alphablend_enable):
|
|
|
|
SyncBlendEnabled();
|
|
|
|
SyncBlendEnabled();
|
|
|
@ -602,6 +609,15 @@ void RasterizerOpenGL::SyncCullMode() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void RasterizerOpenGL::SyncDepthModifiers() {
|
|
|
|
|
|
|
|
float depth_scale = -Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_range).ToFloat32();
|
|
|
|
|
|
|
|
float depth_offset = Pica::float24::FromRawFloat24(Pica::g_state.regs.viewport_depth_far_plane).ToFloat32() / 2.0f;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Implement scale modifier
|
|
|
|
|
|
|
|
uniform_block_data.data.depth_offset = depth_offset;
|
|
|
|
|
|
|
|
uniform_block_data.dirty = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void RasterizerOpenGL::SyncBlendEnabled() {
|
|
|
|
void RasterizerOpenGL::SyncBlendEnabled() {
|
|
|
|
state.blend.enabled = (Pica::g_state.regs.output_merger.alphablend_enable == 1);
|
|
|
|
state.blend.enabled = (Pica::g_state.regs.output_merger.alphablend_enable == 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|