Pica: Implement W-Buffer in SW rasterizer

This commit is contained in:
Jannik Vogel 2016-03-20 01:53:49 +01:00
parent 006fe5fc0f
commit 4c98113b57
4 changed files with 43 additions and 11 deletions

View file

@ -256,7 +256,7 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
// Depth modifiers
case PICA_REG_INDEX(viewport_depth_range):
case PICA_REG_INDEX(viewport_depth_far_plane):
case PICA_REG_INDEX(viewport_depth_near_plane):
SyncDepthModifiers();
break;
@ -911,7 +911,7 @@ void RasterizerOpenGL::SyncCullMode() {
void RasterizerOpenGL::SyncDepthModifiers() {
float depth_scale = -Pica::float24::FromRaw(Pica::g_state.regs.viewport_depth_range).ToFloat32();
float depth_offset = Pica::float24::FromRaw(Pica::g_state.regs.viewport_depth_far_plane).ToFloat32() / 2.0f;
float depth_offset = Pica::float24::FromRaw(Pica::g_state.regs.viewport_depth_near_plane).ToFloat32() / 2.0f;
// TODO: Implement scale modifier
uniform_block_data.data.depth_offset = depth_offset;