mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: add code to read back depth texture
This commit is contained in:
parent
a4c74ef872
commit
d3d5a436ea
|
@ -673,7 +673,7 @@ GSTexture* GSDeviceOGL::CopyOffscreen(GSTexture* src, const GSVector4& sRect, in
|
|||
format = GL_RGBA8;
|
||||
|
||||
ASSERT(src);
|
||||
ASSERT(format == GL_RGBA8 || format == GL_R16UI);
|
||||
ASSERT(format == GL_RGBA8 || format == GL_R16UI || format == GL_R32UI);
|
||||
|
||||
GSTexture* dst = CreateOffscreen(w, h, format);
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ class GSDeviceOGL : public GSDevice
|
|||
uint32 tcoffsethack:1;
|
||||
//uint32 point_sampler:1; Not tested, so keep the bit for blend
|
||||
uint32 iip:1;
|
||||
// Next param will be handle by subroutine
|
||||
// Next param will be handle by subroutine (broken currently)
|
||||
uint32 colclip:2;
|
||||
uint32 atst:3;
|
||||
|
||||
|
|
|
@ -308,7 +308,7 @@ void GSRendererHW::Draw()
|
|||
{
|
||||
if(m_dev->IsLost() || GSRenderer::IsBadFrame(m_skip, m_userhacks_skipdraw)) {
|
||||
if (s_dump) {
|
||||
fprintf(stderr, "Warning skipping a draw call\n");
|
||||
fprintf(stderr, "Warning skipping a draw call (%d)\n", s_n);
|
||||
}
|
||||
s_n += 3; // Keep it sync with SW renderer
|
||||
return;
|
||||
|
|
|
@ -30,13 +30,6 @@ GSTextureCacheOGL::GSTextureCacheOGL(GSRenderer* r)
|
|||
|
||||
void GSTextureCacheOGL::Read(Target* t, const GSVector4i& r)
|
||||
{
|
||||
if(t->m_type != RenderTarget)
|
||||
{
|
||||
ASSERT(0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!t->m_dirty.empty())
|
||||
{
|
||||
return;
|
||||
|
@ -63,17 +56,18 @@ void GSTextureCacheOGL::Read(Target* t, const GSVector4i& r)
|
|||
case PSM_PSMZ32:
|
||||
fmt = GL_R32UI;
|
||||
ps_shader = 10;
|
||||
return;
|
||||
break;
|
||||
|
||||
case PSM_PSMZ24:
|
||||
fmt = GL_R32UI;
|
||||
ps_shader = 10;
|
||||
return;
|
||||
break;
|
||||
|
||||
case PSM_PSMZ16:
|
||||
case PSM_PSMZ16S:
|
||||
fmt = GL_R16UI;
|
||||
ps_shader = 10;
|
||||
return;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
|
@ -112,6 +106,17 @@ void GSTextureCacheOGL::Read(Target* t, const GSVector4i& r)
|
|||
case PSM_PSMCT16S:
|
||||
m_renderer->m_mem.WritePixel16(m.bits, m.pitch, off, r);
|
||||
break;
|
||||
|
||||
case PSM_PSMZ32:
|
||||
m_renderer->m_mem.WritePixel32(m.bits, m.pitch, off, r);
|
||||
break;
|
||||
case PSM_PSMZ24:
|
||||
m_renderer->m_mem.WritePixel24(m.bits, m.pitch, off, r);
|
||||
break;
|
||||
case PSM_PSMZ16:
|
||||
case PSM_PSMZ16S:
|
||||
m_renderer->m_mem.WritePixel16(m.bits, m.pitch, off, r);
|
||||
|
||||
default:
|
||||
ASSERT(0);
|
||||
}
|
||||
|
|
|
@ -210,9 +210,10 @@ GSTextureOGL::GSTextureOGL(int type, int w, int h, int format, GLuint fbo_read)
|
|||
|
||||
// Bunch of constant parameter
|
||||
switch (m_format) {
|
||||
case GL_R32UI:
|
||||
case GL_R32I:
|
||||
m_int_format = GL_RED_INTEGER;
|
||||
m_int_type = GL_INT;
|
||||
m_int_type = (m_format == GL_R32UI) ? GL_UNSIGNED_INT : GL_INT;
|
||||
m_int_alignment = 4;
|
||||
m_int_shift = 2;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue