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

@ -540,13 +540,22 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
for (int i = 0; i < numTexgen; ++i)
WRITE(p, ",\n in float3 uv%d : TEXCOORD%d", i, i);
WRITE(p, ",\n in float4 clipPos : TEXCOORD%d", numTexgen);
WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1);
if(g_ActiveConfig.bEnablePixelLigting)
WRITE(p, ",\n in float4 Normal : TEXCOORD%d", numTexgen + 1);
}
else
{
// wpos is in w of first 4 texcoords
for (int i = 0; i < 8; ++i)
WRITE(p, ",\n in float4 uv%d : TEXCOORD%d", i, i);
if(g_ActiveConfig.bEnablePixelLigting)
{
for (int i = 0; i < 8; ++i)
WRITE(p, ",\n in float4 uv%d : TEXCOORD%d", i, i);
}
else
{
for (int i = 0; i < xfregs.numTexGens; ++i)
WRITE(p, ",\n in float%d uv%d : TEXCOORD%d", i < 4 ? 4 : 3 , i, i);
}
}
WRITE(p, " ) {\n");

View File

@ -356,7 +356,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(unsigned int stage,
entry->hash = *(u32*)ptr = (u32)(((double)rand() / RAND_MAX) * 0xFFFFFFFF);
// load texture
entry->Load(width, height, expandedWidth, 0);
entry->Load(width, height, expandedWidth, 0, (texLevels == 0));
// load mips
if (texLevels > 1 && pcfmt != PC_TEX_FMT_NONE)

View File

@ -61,7 +61,7 @@ public:
virtual bool Save(const char filename[]) = 0;
virtual void Load(unsigned int width, unsigned int height,
unsigned int expanded_width, unsigned int level) = 0;
unsigned int expanded_width, unsigned int level, bool autogen_mips = false) = 0;
virtual void FromRenderTarget(bool bFromZBuffer, bool bScaleByHalf,
unsigned int cbufid, const float *colmat, const EFBRectangle &source_rect,
bool bIsIntensityFmt, u32 copyfmt) = 0;