DX11: Fix mipmaps. Someone forgot creating them at the proper time ;P

DX11: Fix a DX11 debug runtime error caused by the vertex shader output signature and the pixel shader input signature not matching if per-pixel lighting is disabled. Someone forgot disabling those pixel shader parameters ;P
DX11: Enable use of dynamic textures wherever possible.
DX9: Remove two unnecessary TODOs. Someone forgot removing those since they've been obsolete for a long time ;P

Anyway, at least working mipmaps and dynamic textures should increase DX11 performance a bit. And "a bit" is more than my usual "marginally" ;)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6473 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-11-24 19:13:19 +00:00
parent 84a72e90b0
commit 76b9e975d5
11 changed files with 29 additions and 27 deletions

View File

@ -61,12 +61,12 @@ bool TextureCache::TCacheEntry::Save(const char filename[])
}
void TextureCache::TCacheEntry::Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int level)
unsigned int expanded_width, unsigned int level, bool autogen_mips)
{
// TODO: remove hax
if (level != 0) return;
D3D::ReplaceRGBATexture2D(texture->GetTex(), TextureCache::temp, width, height, expanded_width, level, usage);
if (autogen_mips)
PD3DX11FilterTexture(D3D::context, texture->GetTex(), 0, D3DX11_DEFAULT);
}
TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
@ -77,18 +77,15 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
D3D11_CPU_ACCESS_FLAG cpu_access = (D3D11_CPU_ACCESS_FLAG)0;
D3D11_SUBRESOURCE_DATA srdata, *data = NULL;
// TODO: remove hax
tex_levels = 1;
if (1 == tex_levels)
if (tex_levels == 1)
{
usage = D3D11_USAGE_DYNAMIC;
cpu_access = D3D11_CPU_ACCESS_WRITE;
srdata.pSysMem = TextureCache::temp;
srdata.SysMemPitch = 4 * expanded_width;
// testing
//data = &srdata;
data = &srdata;
}
const D3D11_TEXTURE2D_DESC texdesc = CD3D11_TEXTURE2D_DESC(DXGI_FORMAT_R8G8B8A8_UNORM,
@ -107,9 +104,6 @@ TextureCache::TCacheEntryBase* TextureCache::CreateTexture(unsigned int width,
SAFE_RELEASE(pTexture);
if (0 == tex_levels)
PD3DX11FilterTexture(D3D::context, entry->texture->GetTex(), 0, D3DX11_DEFAULT);
return entry;
}

View File

@ -46,7 +46,7 @@ private:
~TCacheEntry();
void Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int levels);
unsigned int expanded_width, unsigned int levels, bool autogen_mips = false);
void FromRenderTarget(bool bFromZBuffer, bool bScaleByHalf,
unsigned int cbufid, const float* colmat, const EFBRectangle &source_rect,