mirror of https://github.com/PCSX2/pcsx2.git
gsdx-hw: Completely remove MSAA from renderer code.
This commit is contained in:
parent
bf8dc7707a
commit
e429677a07
|
@ -131,7 +131,7 @@ void GSDevice::Present(GSTexture* sTex, GSTexture* dTex, const GSVector4& dRect,
|
|||
StretchRect(sTex, dTex, dRect, shader, m_linear_present);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice::FetchSurface(int type, int w, int h, int format)
|
||||
{
|
||||
const GSVector2i size(w, h);
|
||||
|
||||
|
@ -139,7 +139,7 @@ GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
|
|||
{
|
||||
GSTexture* t = *i;
|
||||
|
||||
if(t->GetType() == type && t->GetFormat() == format && t->GetSize() == size && t->IsMSAA() == msaa)
|
||||
if(t->GetType() == type && t->GetFormat() == format && t->GetSize() == size)
|
||||
{
|
||||
m_pool.erase(i);
|
||||
|
||||
|
@ -147,7 +147,7 @@ GSTexture* GSDevice::FetchSurface(int type, int w, int h, bool msaa, int format)
|
|||
}
|
||||
}
|
||||
|
||||
return CreateSurface(type, w, h, msaa, format);
|
||||
return CreateSurface(type, w, h, format);
|
||||
}
|
||||
|
||||
void GSDevice::PrintMemoryUsage()
|
||||
|
@ -213,24 +213,24 @@ void GSDevice::PurgePool()
|
|||
}
|
||||
}
|
||||
|
||||
GSTexture* GSDevice::CreateRenderTarget(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice::CreateRenderTarget(int w, int h, int format)
|
||||
{
|
||||
return FetchSurface(GSTexture::RenderTarget, w, h, msaa, format);
|
||||
return FetchSurface(GSTexture::RenderTarget, w, h, format);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice::CreateDepthStencil(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice::CreateDepthStencil(int w, int h, int format)
|
||||
{
|
||||
return FetchSurface(GSTexture::DepthStencil, w, h, msaa, format);
|
||||
return FetchSurface(GSTexture::DepthStencil, w, h, format);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice::CreateTexture(int w, int h, int format)
|
||||
{
|
||||
return FetchSurface(GSTexture::Texture, w, h, false, format);
|
||||
return FetchSurface(GSTexture::Texture, w, h, format);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice::CreateOffscreen(int w, int h, int format)
|
||||
{
|
||||
return FetchSurface(GSTexture::Offscreen, w, h, false, format);
|
||||
return FetchSurface(GSTexture::Offscreen, w, h, format);
|
||||
}
|
||||
|
||||
void GSDevice::StretchRect(GSTexture* sTex, GSTexture* dTex, const GSVector4& dRect, int shader, bool linear)
|
||||
|
@ -249,7 +249,7 @@ void GSDevice::Merge(GSTexture* sTex[3], GSVector4* sRect, GSVector4* dRect, con
|
|||
{
|
||||
Recycle(m_merge);
|
||||
|
||||
m_merge = CreateRenderTarget(fs.x, fs.y, false);
|
||||
m_merge = CreateRenderTarget(fs.x, fs.y);
|
||||
}
|
||||
|
||||
// TODO: m_1x1
|
||||
|
@ -266,7 +266,7 @@ void GSDevice::Merge(GSTexture* sTex[3], GSVector4* sRect, GSVector4* dRect, con
|
|||
{
|
||||
if(sTex[i] != NULL)
|
||||
{
|
||||
tex[i] = sTex[i]->IsMSAA() ? Resolve(sTex[i]) : sTex[i];
|
||||
tex[i] = sTex[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffse
|
|||
{
|
||||
delete m_weavebob;
|
||||
|
||||
m_weavebob = CreateRenderTarget(ds.x, ds.y, false);
|
||||
m_weavebob = CreateRenderTarget(ds.x, ds.y);
|
||||
}
|
||||
|
||||
if(mode == 0 || mode == 2) // weave or blend
|
||||
|
@ -311,7 +311,7 @@ void GSDevice::Interlace(const GSVector2i& ds, int field, int mode, float yoffse
|
|||
{
|
||||
delete m_blend;
|
||||
|
||||
m_blend = CreateRenderTarget(ds.x, ds.y, false);
|
||||
m_blend = CreateRenderTarget(ds.x, ds.y);
|
||||
}
|
||||
|
||||
DoInterlace(m_weavebob, m_blend, 2, false, 0);
|
||||
|
@ -342,7 +342,7 @@ void GSDevice::ExternalFX()
|
|||
if (m_shaderfx == NULL || m_shaderfx->GetSize() != s)
|
||||
{
|
||||
delete m_shaderfx;
|
||||
m_shaderfx = CreateRenderTarget(s.x, s.y, false);
|
||||
m_shaderfx = CreateRenderTarget(s.x, s.y);
|
||||
}
|
||||
|
||||
if (m_shaderfx != NULL)
|
||||
|
@ -362,7 +362,7 @@ void GSDevice::FXAA()
|
|||
if(m_fxaa == NULL || m_fxaa->GetSize() != s)
|
||||
{
|
||||
delete m_fxaa;
|
||||
m_fxaa = CreateRenderTarget(s.x, s.y, false);
|
||||
m_fxaa = CreateRenderTarget(s.x, s.y);
|
||||
}
|
||||
|
||||
if(m_fxaa != NULL)
|
||||
|
@ -382,7 +382,7 @@ void GSDevice::ShadeBoost()
|
|||
if(m_shadeboost == NULL || m_shadeboost->GetSize() != s)
|
||||
{
|
||||
delete m_shadeboost;
|
||||
m_shadeboost = CreateRenderTarget(s.x, s.y, false);
|
||||
m_shadeboost = CreateRenderTarget(s.x, s.y);
|
||||
}
|
||||
|
||||
if(m_shadeboost != NULL)
|
||||
|
|
|
@ -136,8 +136,8 @@ protected:
|
|||
unsigned int m_frame; // for ageing the pool
|
||||
bool m_linear_present;
|
||||
|
||||
virtual GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format) = 0;
|
||||
virtual GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
|
||||
virtual GSTexture* CreateSurface(int type, int w, int h, int format) = 0;
|
||||
virtual GSTexture* FetchSurface(int type, int w, int h, int format);
|
||||
|
||||
virtual void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c) = 0;
|
||||
virtual void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset) = 0;
|
||||
|
@ -175,13 +175,11 @@ public:
|
|||
virtual void ClearDepth(GSTexture* t) {}
|
||||
virtual void ClearStencil(GSTexture* t, uint8 c) {}
|
||||
|
||||
virtual GSTexture* CreateRenderTarget(int w, int h, bool msaa, int format = 0);
|
||||
virtual GSTexture* CreateDepthStencil(int w, int h, bool msaa, int format = 0);
|
||||
virtual GSTexture* CreateRenderTarget(int w, int h, int format = 0);
|
||||
virtual GSTexture* CreateDepthStencil(int w, int h, int format = 0);
|
||||
virtual GSTexture* CreateTexture(int w, int h, int format = 0);
|
||||
virtual GSTexture* CreateOffscreen(int w, int h, int format = 0);
|
||||
|
||||
virtual GSTexture* Resolve(GSTexture* t) {return NULL;}
|
||||
|
||||
virtual GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0) {return NULL;}
|
||||
|
||||
virtual void CopyRect(GSTexture* sTex, GSTexture* dTex, const GSVector4i& r) {}
|
||||
|
|
|
@ -27,7 +27,6 @@ GSTexture::GSTexture()
|
|||
, m_size(0, 0)
|
||||
, m_type(0)
|
||||
, m_format(0)
|
||||
, m_msaa(false)
|
||||
, last_frame_used(0)
|
||||
, LikelyOffset(false)
|
||||
, OffsetHack_modx(0.0f)
|
||||
|
|
|
@ -30,7 +30,6 @@ protected:
|
|||
GSVector2i m_size;
|
||||
int m_type;
|
||||
int m_format;
|
||||
bool m_msaa;
|
||||
|
||||
public:
|
||||
struct GSMap {uint8* bits; int pitch;};
|
||||
|
@ -60,8 +59,6 @@ public:
|
|||
int GetType() const {return m_type;}
|
||||
int GetFormat() const {return m_format;}
|
||||
|
||||
bool IsMSAA() const {return m_msaa;}
|
||||
|
||||
// frame number (arbitrary base) the texture was recycled on
|
||||
// different purpose than texture cache ages, do not attempt to merge
|
||||
unsigned last_frame_used;
|
||||
|
|
|
@ -1157,7 +1157,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
int h = (int)(scale.y * th);
|
||||
|
||||
GSTexture* sTex = dst->m_texture;
|
||||
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h, false);
|
||||
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h);
|
||||
|
||||
GSVector4i area(x, y, x + w, y + h);
|
||||
m_renderer->m_dev->CopyRect(sTex, dTex, area);
|
||||
|
@ -1201,16 +1201,6 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
|
||||
dst->Update();
|
||||
|
||||
GSTexture* tmp = NULL;
|
||||
|
||||
if (dst->m_texture->IsMSAA())
|
||||
{
|
||||
tmp = dst->m_texture;
|
||||
|
||||
dst->m_texture = m_renderer->m_dev->Resolve(dst->m_texture);
|
||||
}
|
||||
|
||||
|
||||
// do not round here!!! if edge becomes a black pixel and addressing mode is clamp => everything outside the clamped area turns into black (kh2 shadows)
|
||||
|
||||
int w = (int)(dst->m_texture->GetScale().x * tw);
|
||||
|
@ -1330,7 +1320,7 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
GSVector4 sRect(0, 0, w, h);
|
||||
|
||||
GSTexture* sTex = src->m_texture ? src->m_texture : dst->m_texture;
|
||||
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h, false);
|
||||
GSTexture* dTex = m_renderer->m_dev->CreateRenderTarget(w, h);
|
||||
|
||||
// GH: by default (m_paltex == 0) GSdx converts texture to the 32 bit format
|
||||
// However it is different here. We want to reuse a Render Target as a texture.
|
||||
|
@ -1406,14 +1396,6 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
|
|||
else
|
||||
ASSERT(0);
|
||||
|
||||
if(tmp != NULL)
|
||||
{
|
||||
// tmp is the texture before a MultiSample resolve
|
||||
m_renderer->m_dev->Recycle(dst->m_texture);
|
||||
|
||||
dst->m_texture = tmp;
|
||||
}
|
||||
|
||||
// Offset hack. Can be enabled via GSdx options.
|
||||
// The offset will be used in Draw().
|
||||
|
||||
|
@ -1479,13 +1461,13 @@ GSTextureCache::Target* GSTextureCache::CreateTarget(const GIFRegTEX0& TEX0, int
|
|||
|
||||
if(type == RenderTarget)
|
||||
{
|
||||
t->m_texture = m_renderer->m_dev->CreateRenderTarget(w, h, true);
|
||||
t->m_texture = m_renderer->m_dev->CreateRenderTarget(w, h);
|
||||
|
||||
t->m_used = true; // FIXME
|
||||
}
|
||||
else if(type == DepthStencil)
|
||||
{
|
||||
t->m_texture = m_renderer->m_dev->CreateDepthStencil(w, h, true);
|
||||
t->m_texture = m_renderer->m_dev->CreateDepthStencil(w, h);
|
||||
}
|
||||
|
||||
m_dst[type].push_front(t);
|
||||
|
|
|
@ -171,27 +171,6 @@ bool GSDevice11::Create(const std::shared_ptr<GSWnd> &wnd)
|
|||
|
||||
hr = m_dev->CheckFeatureSupport(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS, &options, sizeof(D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS));
|
||||
|
||||
// msaa
|
||||
|
||||
for(uint32 i = 2; i <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; i++)
|
||||
{
|
||||
uint32 quality[2] = {0, 0};
|
||||
|
||||
if(SUCCEEDED(m_dev->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, i, &quality[0])) && quality[0] > 0
|
||||
&& SUCCEEDED(m_dev->CheckMultisampleQualityLevels(DXGI_FORMAT_D32_FLOAT_S8X24_UINT, i, &quality[1])) && quality[1] > 0)
|
||||
{
|
||||
m_msaa_desc.Count = i;
|
||||
m_msaa_desc.Quality = std::min<uint32>(quality[0] - 1, quality[1] - 1);
|
||||
|
||||
if(i >= m_msaa) break;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_msaa_desc.Count == 1)
|
||||
{
|
||||
m_msaa = 0;
|
||||
}
|
||||
|
||||
// convert
|
||||
|
||||
D3D11_INPUT_ELEMENT_DESC il_convert[] =
|
||||
|
@ -414,7 +393,7 @@ bool GSDevice11::Create(const std::shared_ptr<GSWnd> &wnd)
|
|||
GSVector2i tex_font = m_osd.get_texture_font_size();
|
||||
|
||||
m_font = std::unique_ptr<GSTexture>(
|
||||
CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, false, DXGI_FORMAT_R8_UNORM)
|
||||
CreateSurface(GSTexture::Texture, tex_font.x, tex_font.y, DXGI_FORMAT_R8_UNORM)
|
||||
);
|
||||
|
||||
return true;
|
||||
|
@ -546,7 +525,7 @@ void GSDevice11::ClearStencil(GSTexture* t, uint8 c)
|
|||
m_ctx->ClearDepthStencilView(*(GSTexture11*)t, D3D11_CLEAR_STENCIL, 0, c);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CreateSurface(int type, int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice11::CreateSurface(int type, int w, int h, int format)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
|
@ -563,11 +542,6 @@ GSTexture* GSDevice11::CreateSurface(int type, int w, int h, bool msaa, int form
|
|||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
|
||||
if(msaa)
|
||||
{
|
||||
desc.SampleDesc = m_msaa_desc;
|
||||
}
|
||||
|
||||
// mipmap = m_mipmap > 1 || m_filter != TriFiltering::None;
|
||||
bool mipmap = m_mipmap > 1;
|
||||
int layers = mipmap && format == DXGI_FORMAT_R8G8B8A8_UNORM ? (int)log2(std::max(w,h)) : 1;
|
||||
|
@ -618,14 +592,14 @@ GSTexture* GSDevice11::CreateSurface(int type, int w, int h, bool msaa, int form
|
|||
return t;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CreateRenderTarget(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice11::CreateRenderTarget(int w, int h, int format)
|
||||
{
|
||||
return __super::CreateRenderTarget(w, h, msaa, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
return __super::CreateRenderTarget(w, h, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CreateDepthStencil(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDevice11::CreateDepthStencil(int w, int h, int format)
|
||||
{
|
||||
return __super::CreateDepthStencil(w, h, msaa, format ? format : DXGI_FORMAT_R32G8X24_TYPELESS);
|
||||
return __super::CreateDepthStencil(w, h, format ? format : DXGI_FORMAT_R32G8X24_TYPELESS);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CreateTexture(int w, int h, int format)
|
||||
|
@ -638,22 +612,6 @@ GSTexture* GSDevice11::CreateOffscreen(int w, int h, int format)
|
|||
return __super::CreateOffscreen(w, h, format ? format : DXGI_FORMAT_R8G8B8A8_UNORM);
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::Resolve(GSTexture* t)
|
||||
{
|
||||
ASSERT(t != NULL && t->IsMSAA());
|
||||
|
||||
if(GSTexture* dst = CreateRenderTarget(t->GetWidth(), t->GetHeight(), false, t->GetFormat()))
|
||||
{
|
||||
dst->SetScale(t->GetScale());
|
||||
|
||||
m_ctx->ResolveSubresource(*(GSTexture11*)dst, 0, *(GSTexture11*)t, 0, (DXGI_FORMAT)t->GetFormat());
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format, int ps_shader)
|
||||
{
|
||||
GSTexture* dst = NULL;
|
||||
|
@ -665,16 +623,11 @@ GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sRect, int
|
|||
|
||||
ASSERT(format == DXGI_FORMAT_R8G8B8A8_UNORM || format == DXGI_FORMAT_R16_UINT || format == DXGI_FORMAT_R32_UINT);
|
||||
|
||||
if(GSTexture* rt = CreateRenderTarget(w, h, false, format))
|
||||
if(GSTexture* rt = CreateRenderTarget(w, h, format))
|
||||
{
|
||||
GSVector4 dRect(0, 0, w, h);
|
||||
|
||||
if(GSTexture* src2 = src->IsMSAA() ? Resolve(src) : src)
|
||||
{
|
||||
StretchRect(src2, sRect, rt, dRect, m_convert.ps[ps_shader], NULL);
|
||||
|
||||
if(src2 != src) Recycle(src2);
|
||||
}
|
||||
StretchRect(src, sRect, rt, dRect, m_convert.ps[ps_shader], NULL);
|
||||
|
||||
dst = CreateOffscreen(w, h, format);
|
||||
|
||||
|
@ -1034,10 +987,7 @@ void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vert
|
|||
GSSetShader(NULL, NULL);
|
||||
|
||||
// ps
|
||||
|
||||
GSTexture* rt2 = rt->IsMSAA() ? Resolve(rt) : rt;
|
||||
|
||||
PSSetShaderResources(rt2, NULL);
|
||||
PSSetShaderResources(rt, NULL);
|
||||
PSSetSamplerState(m_convert.pt, NULL);
|
||||
PSSetShader(m_convert.ps[datm ? ShaderConvert_DATM_1 : ShaderConvert_DATM_0], NULL);
|
||||
|
||||
|
@ -1048,8 +998,6 @@ void GSDevice11::SetupDATE(GSTexture* rt, GSTexture* ds, const GSVertexPT1* vert
|
|||
//
|
||||
|
||||
EndScene();
|
||||
|
||||
if(rt2 != rt) Recycle(rt2);
|
||||
}
|
||||
|
||||
void GSDevice11::IASetVertexBuffer(const void* vertex, size_t stride, size_t count)
|
||||
|
|
|
@ -32,7 +32,7 @@ struct GSVertexShader11
|
|||
|
||||
class GSDevice11 : public GSDeviceDX
|
||||
{
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* CreateSurface(int type, int w, int h, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c);
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0);
|
||||
|
@ -184,13 +184,11 @@ public:
|
|||
void ClearDepth(GSTexture* t);
|
||||
void ClearStencil(GSTexture* t, uint8 c);
|
||||
|
||||
GSTexture* CreateRenderTarget(int w, int h, bool msaa, int format = 0);
|
||||
GSTexture* CreateDepthStencil(int w, int h, bool msaa, int format = 0);
|
||||
GSTexture* CreateRenderTarget(int w, int h, int format = 0);
|
||||
GSTexture* CreateDepthStencil(int w, int h, int format = 0);
|
||||
GSTexture* CreateTexture(int w, int h, int format = 0);
|
||||
GSTexture* CreateOffscreen(int w, int h, int format = 0);
|
||||
|
||||
GSTexture* Resolve(GSTexture* t);
|
||||
|
||||
GSTexture* CopyOffscreen(GSTexture* src, const GSVector4& sRect, int w, int h, int format = 0, int ps_shader = 0);
|
||||
|
||||
GSTexture* CopyRenderTarget(GSTexture* src);
|
||||
|
|
|
@ -43,8 +43,6 @@ GSTexture11::GSTexture11(ID3D11Texture2D* texture)
|
|||
|
||||
m_format = (int)m_desc.Format;
|
||||
|
||||
m_msaa = m_desc.SampleDesc.Count > 1;
|
||||
|
||||
m_max_layer = m_desc.MipLevels;
|
||||
}
|
||||
|
||||
|
@ -211,8 +209,6 @@ GSTexture11::operator ID3D11ShaderResourceView*()
|
|||
{
|
||||
if(!m_srv && m_dev && m_texture)
|
||||
{
|
||||
ASSERT(!m_msaa);
|
||||
|
||||
if(m_desc.Format == DXGI_FORMAT_R32G8X24_TYPELESS)
|
||||
{
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srvd = {};
|
||||
|
@ -236,8 +232,6 @@ GSTexture11::operator ID3D11UnorderedAccessView*()
|
|||
{
|
||||
if(!m_uav && m_dev && m_texture)
|
||||
{
|
||||
ASSERT(!m_msaa);
|
||||
|
||||
m_dev->CreateUnorderedAccessView(m_texture, NULL, &m_uav);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,11 +31,6 @@ bool GSDeviceDX::s_old_d3d_compiler_dll;
|
|||
GSDeviceDX::GSDeviceDX()
|
||||
{
|
||||
m_upscale_multiplier = theApp.GetConfigI("upscale_multiplier");
|
||||
// m_msaa = theApp.GetConfigB("UserHacks") ? theApp.GetConfigI("UserHacks_MSAA") : 0;
|
||||
m_msaa = 0; // Temporarily disable msaa until it's fixed.
|
||||
|
||||
m_msaa_desc.Count = 1;
|
||||
m_msaa_desc.Quality = 0;
|
||||
}
|
||||
|
||||
GSDeviceDX::~GSDeviceDX()
|
||||
|
@ -86,14 +81,9 @@ void GSDeviceDX::FreeD3DCompiler()
|
|||
s_d3d_compiler_dll = nullptr;
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceDX::FetchSurface(int type, int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDeviceDX::FetchSurface(int type, int w, int h, int format)
|
||||
{
|
||||
if(m_msaa < 2)
|
||||
{
|
||||
msaa = false;
|
||||
}
|
||||
|
||||
return __super::FetchSurface(type, w, h, msaa, format);
|
||||
return __super::FetchSurface(type, w, h, format);
|
||||
}
|
||||
|
||||
bool GSDeviceDX::SetFeatureLevel(D3D_FEATURE_LEVEL level, bool compat_mode)
|
||||
|
|
|
@ -314,8 +314,6 @@ public:
|
|||
|
||||
protected:
|
||||
struct {D3D_FEATURE_LEVEL level; std::string model, vs, gs, ps, cs;} m_shader;
|
||||
uint32 m_msaa;
|
||||
DXGI_SAMPLE_DESC m_msaa_desc;
|
||||
|
||||
static HMODULE s_d3d_compiler_dll;
|
||||
static decltype(&D3DCompile) s_pD3DCompile;
|
||||
|
@ -323,7 +321,7 @@ protected:
|
|||
// could be useful for external shaders.
|
||||
static bool s_old_d3d_compiler_dll;
|
||||
|
||||
GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* FetchSurface(int type, int w, int h, int format);
|
||||
|
||||
public:
|
||||
GSDeviceDX();
|
||||
|
|
|
@ -774,7 +774,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
|||
// fprintf(stderr, "COLCLIP HDR mode ENABLED\n");
|
||||
GSVector4 dRect(ComputeBoundingBox(rtscale, rtsize));
|
||||
GSVector4 sRect = dRect / GSVector4(rtsize.x, rtsize.y).xyxy();
|
||||
hdr_rt = dev->CreateRenderTarget(rtsize.x, rtsize.y, false, DXGI_FORMAT_R32G32B32A32_FLOAT);
|
||||
hdr_rt = dev->CreateRenderTarget(rtsize.x, rtsize.y, DXGI_FORMAT_R32G32B32A32_FLOAT);
|
||||
// Warning: StretchRect must be called before BeginScene otherwise
|
||||
// vertices will be overwritten. Trust me you don't want to do that.
|
||||
dev->StretchRect(rt, sRect, hdr_rt, dRect, ShaderConvert_COPY, false);
|
||||
|
|
|
@ -89,7 +89,6 @@ void GSRendererHW::SetScaling()
|
|||
// 3/ upload of framebuffer (preload hack)
|
||||
// 4/ framebuffer clear (color/depth/stencil)
|
||||
// 5/ read back of the frambuffer
|
||||
// 6/ MSAA
|
||||
//
|
||||
// With the solution
|
||||
// 1/ Nothing to do.Except the texture cache bug (channel shuffle effect)
|
||||
|
@ -99,7 +98,6 @@ void GSRendererHW::SetScaling()
|
|||
// 4a/ stencil can be limited to valid data.
|
||||
// 4b/ is it useful to clear color? depth? (in any case, it ought to be few operation)
|
||||
// 5/ limit the read to the valid data
|
||||
// 6/ not support on openGL
|
||||
|
||||
// Framebuffer width is always a multiple of 64 so at certain cases it can't cover some weird width values.
|
||||
// 480P , 576P use width as 720 which is not referencable by FBW * 64. so it produces 704 ( the closest value multiple by 64).
|
||||
|
@ -1343,7 +1341,7 @@ bool GSRendererHW::OI_BlitFMV(GSTextureCache::Target* _rt, GSTextureCache::Sourc
|
|||
// Do the blit. With a Copy mess to avoid issue with limited API (dx)
|
||||
// m_dev->StretchRect(tex->m_texture, sRect, tex->m_texture, dRect);
|
||||
GSVector4i r_full(0, 0, tw, th);
|
||||
if (GSTexture* rt = m_dev->CreateRenderTarget(tw, th, false)) {
|
||||
if (GSTexture* rt = m_dev->CreateRenderTarget(tw, th)) {
|
||||
m_dev->CopyRect(tex->m_texture, rt, r_full);
|
||||
|
||||
m_dev->StretchRect(tex->m_texture, sRect, rt, dRect);
|
||||
|
|
|
@ -37,7 +37,7 @@ bool GSDeviceNull::Reset(int w, int h)
|
|||
return GSDevice::Reset(w, h);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceNull::CreateSurface(int type, int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDeviceNull::CreateSurface(int type, int w, int h, int format)
|
||||
{
|
||||
return new GSTextureNull(type, w, h, format);
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
class GSDeviceNull : public GSDevice
|
||||
{
|
||||
private:
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* CreateSurface(int type, int w, int h, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c) {}
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0) {}
|
||||
|
|
|
@ -54,8 +54,7 @@ int GSDeviceOGL::m_shader_reg = 0;
|
|||
FILE* GSDeviceOGL::m_debug_gl_file = NULL;
|
||||
|
||||
GSDeviceOGL::GSDeviceOGL()
|
||||
: m_msaa(0)
|
||||
, m_force_texture_clear(0)
|
||||
: m_force_texture_clear(0)
|
||||
, m_fbo(0)
|
||||
, m_fbo_read(0)
|
||||
, m_va(NULL)
|
||||
|
@ -233,7 +232,7 @@ void GSDeviceOGL::GenerateProfilerData()
|
|||
}
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int fmt)
|
||||
GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, int fmt)
|
||||
{
|
||||
GL_PUSH("Create surface");
|
||||
|
||||
|
@ -259,9 +258,9 @@ GSTexture* GSDeviceOGL::CreateSurface(int type, int w, int h, bool msaa, int fmt
|
|||
return t;
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceOGL::FetchSurface(int type, int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDeviceOGL::FetchSurface(int type, int w, int h, int format)
|
||||
{
|
||||
GSTexture* t = GSDevice::FetchSurface(type, w, h, false, format);
|
||||
GSTexture* t = GSDevice::FetchSurface(type, w, h, format);
|
||||
|
||||
|
||||
if (m_force_texture_clear) {
|
||||
|
@ -1177,14 +1176,14 @@ void GSDeviceOGL::SelfShaderTest()
|
|||
SelfShaderTestPrint(test, nb_shader);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceOGL::CreateRenderTarget(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDeviceOGL::CreateRenderTarget(int w, int h, int format)
|
||||
{
|
||||
return GSDevice::CreateRenderTarget(w, h, msaa, format ? format : GL_RGBA8);
|
||||
return GSDevice::CreateRenderTarget(w, h, format ? format : GL_RGBA8);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceOGL::CreateDepthStencil(int w, int h, bool msaa, int format)
|
||||
GSTexture* GSDeviceOGL::CreateDepthStencil(int w, int h, int format)
|
||||
{
|
||||
return GSDevice::CreateDepthStencil(w, h, msaa, format ? format : GL_DEPTH32F_STENCIL8);
|
||||
return GSDevice::CreateDepthStencil(w, h, format ? format : GL_DEPTH32F_STENCIL8);
|
||||
}
|
||||
|
||||
GSTexture* GSDeviceOGL::CreateTexture(int w, int h, int format)
|
||||
|
|
|
@ -409,7 +409,6 @@ public:
|
|||
static int m_shader_reg;
|
||||
|
||||
private:
|
||||
uint32 m_msaa; // Level of Msaa
|
||||
int m_force_texture_clear;
|
||||
int m_mipmap;
|
||||
TriFiltering m_filter;
|
||||
|
@ -492,8 +491,8 @@ public:
|
|||
|
||||
std::unique_ptr<GSTexture> m_font;
|
||||
|
||||
GSTexture* CreateSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* FetchSurface(int type, int w, int h, bool msaa, int format);
|
||||
GSTexture* CreateSurface(int type, int w, int h, int format);
|
||||
GSTexture* FetchSurface(int type, int w, int h, int format);
|
||||
|
||||
void DoMerge(GSTexture* sTex[3], GSVector4* sRect, GSTexture* dTex, GSVector4* dRect, const GSRegPMODE& PMODE, const GSRegEXTBUF& EXTBUF, const GSVector4& c) final;
|
||||
void DoInterlace(GSTexture* sTex, GSTexture* dTex, int shader, bool linear, float yoffset = 0) final;
|
||||
|
@ -535,8 +534,8 @@ public:
|
|||
void ClearDepth(GSTexture* t) final;
|
||||
void ClearStencil(GSTexture* t, uint8 c) final;
|
||||
|
||||
GSTexture* CreateRenderTarget(int w, int h, bool msaa, int format = 0) final;
|
||||
GSTexture* CreateDepthStencil(int w, int h, bool msaa, int format = 0) final;
|
||||
GSTexture* CreateRenderTarget(int w, int h, int format = 0) final;
|
||||
GSTexture* CreateDepthStencil(int w, int h, int format = 0) final;
|
||||
GSTexture* CreateTexture(int w, int h, int format = 0) final;
|
||||
GSTexture* CreateOffscreen(int w, int h, int format = 0) final;
|
||||
void InitPrimDateTexture(GSTexture* rt, const GSVector4i& area);
|
||||
|
|
Loading…
Reference in New Issue