mirror of https://github.com/PCSX2/pcsx2.git
GS/SW: Zero out texture cache buffers
This _shouldn't_ be necessary, but apparently our texture min/max is wrong somewhere, and we end up sampling from "random" malloc memory, which breaks GS dump runs.
This commit is contained in:
parent
bdeb0fcb76
commit
affbcfe135
|
@ -225,10 +225,15 @@ bool GSTextureCacheSW::Texture::Update(const GSVector4i& rect)
|
||||||
if (!m_buff)
|
if (!m_buff)
|
||||||
{
|
{
|
||||||
const u32 pitch = (1 << m_tw) << shift;
|
const u32 pitch = (1 << m_tw) << shift;
|
||||||
|
const size_t size = pitch * th * 4;
|
||||||
|
|
||||||
m_buff = _aligned_malloc(pitch * th * 4, VECTOR_ALIGNMENT);
|
m_buff = _aligned_malloc(size, VECTOR_ALIGNMENT);
|
||||||
if (!m_buff)
|
if (!m_buff)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// This _shouldn't_ be necessary, but apparently our texture min/max is wrong somewhere,
|
||||||
|
// and we end up sampling from "random" malloc memory, which breaks GS dump runs.
|
||||||
|
std::memset(m_buff, 0, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
GSLocalMemory& mem = g_gs_renderer->m_mem;
|
GSLocalMemory& mem = g_gs_renderer->m_mem;
|
||||||
|
|
Loading…
Reference in New Issue