mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 13:49:53 -06:00
VideoBackends: Clamp Z peek values.
This commit is contained in:
@ -8,6 +8,7 @@
|
||||
#include <strsafe.h>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "Common/MathUtil.h"
|
||||
#include "Common/Timer.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
@ -419,11 +420,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
|
||||
if (bpmem.zcontrol.pixel_format == PEControl::RGB565_Z16)
|
||||
{
|
||||
// if Z is in 16 bit format you must return a 16 bit integer
|
||||
ret = ((u32)(val * 65536.0f));
|
||||
ret = MathUtil::Clamp<u32>((u32)(val * 65536.0f), 0, 0xFFFF);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = ((u32)(val * 16777216.0f));
|
||||
ret = MathUtil::Clamp<u32>((u32)(val * 16777216.0f), 0, 0xFFFFFF);
|
||||
}
|
||||
D3D::context->Unmap(read_tex, 0);
|
||||
|
||||
|
Reference in New Issue
Block a user