mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
set GFXTextureManager::_validateTexParams to respect sen mipcaps
also kill console spam
This commit is contained in:
parent
3cdbd4e87e
commit
022f8d1732
3 changed files with 13 additions and 6 deletions
|
|
@ -108,7 +108,6 @@ void GFXD3D11TextureManager::_innerCreateTexture( GFXD3D11TextureObject *retTex,
|
||||||
(numMipLevels == 0 || numMipLevels > 1)&&
|
(numMipLevels == 0 || numMipLevels > 1)&&
|
||||||
!(depth > 0) )
|
!(depth > 0) )
|
||||||
{
|
{
|
||||||
if (numMipLevels == 5) Con::errorf("GFXD3D11TextureManager::_innerCreateTexture - numMipLevels == 5 found!");
|
|
||||||
miscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
|
miscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
|
||||||
bindFlags |= D3D11_BIND_RENDER_TARGET; // in order to automatically generate mips. Resource needs to be a rendertarget and shader resource
|
bindFlags |= D3D11_BIND_RENDER_TARGET; // in order to automatically generate mips. Resource needs to be a rendertarget and shader resource
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1410,7 +1410,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
||||||
U32 &inOutNumMips, GFXFormat &inOutFormat )
|
U32 &inOutNumMips, GFXFormat &inOutFormat )
|
||||||
{
|
{
|
||||||
// Validate mipmap parameter. If this profile requests no mips, set mips to 1.
|
// Validate mipmap parameter. If this profile requests no mips, set mips to 1.
|
||||||
if( profile->noMip() )
|
if( profile->noMip()|| inOutNumMips == 1)
|
||||||
{
|
{
|
||||||
inOutNumMips = 1;
|
inOutNumMips = 1;
|
||||||
}
|
}
|
||||||
|
|
@ -1418,7 +1418,17 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
||||||
{
|
{
|
||||||
// If a texture is not power-of-2 in size for both dimensions, it must
|
// If a texture is not power-of-2 in size for both dimensions, it must
|
||||||
// have only 1 mip level.
|
// have only 1 mip level.
|
||||||
inOutNumMips = profile->isRenderTarget() ? mFloor(mLog2(mMax(width, height))) + 1 : 1;
|
if (profile->isRenderTarget())
|
||||||
|
{
|
||||||
|
if (inOutNumMips == 0) //auto
|
||||||
|
inOutNumMips = mFloor(mLog2(mMax(width, height))) + 1;
|
||||||
|
else if (inOutNumMips > 1) //capped
|
||||||
|
inOutNumMips = mMin(inOutNumMips,mFloor(mLog2(mMax(width, height))) + 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
inOutNumMips = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check format, and compatibility with texture profile requirements
|
// Check format, and compatibility with texture profile requirements
|
||||||
|
|
|
||||||
|
|
@ -849,9 +849,7 @@ void PostEffect::_setupConstants( const SceneRenderState *state )
|
||||||
|
|
||||||
if (mMipCountSC[i]->isValid())
|
if (mMipCountSC[i]->isValid())
|
||||||
{
|
{
|
||||||
S32 mipLevels = (S32)mActiveTextures[i]->getMipLevels();
|
mShaderConsts->set(mMipCountSC[i], (S32)mActiveTextures[i]->getMipLevels());
|
||||||
mShaderConsts->set(mMipCountSC[i], mipLevels);
|
|
||||||
if (mipLevels == 5) Con::errorf("PostEffect::_setupConstants - mipLevels == 5 found!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue