mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-12 00:40:44 +00:00
mipwork, laregly courtesy of @mmarauder2k9-torque
This commit is contained in:
parent
81504fb089
commit
cacd8a6064
8 changed files with 128 additions and 128 deletions
|
|
@ -151,7 +151,13 @@ void GFXD3D11TextureTarget::attachTexture( RenderSlot slot, GFXTextureObject *te
|
|||
mTargetSize.set( tex->getSize().x, tex->getSize().y );
|
||||
mTargetFormat = tex->getFormat();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mGenMips)
|
||||
{
|
||||
mTargetSRViews[slot] = d3dto->getSRView();
|
||||
mTargetSRViews[slot]->AddRef();
|
||||
}
|
||||
}
|
||||
|
||||
// Update surface size
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ void GFXD3D11TextureManager::_innerCreateTexture( GFXD3D11TextureObject *retTex,
|
|||
}
|
||||
|
||||
if( !forceMips && !retTex->mProfile->isSystemMemory() &&
|
||||
numMipLevels == 0 &&
|
||||
(numMipLevels == 0 || numMipLevels > 1)&&
|
||||
!(depth > 0) )
|
||||
{
|
||||
miscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
|
||||
|
|
|
|||
|
|
@ -1414,13 +1414,13 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
|||
{
|
||||
inOutNumMips = 1;
|
||||
}
|
||||
else if( !isPow2( width ) || !isPow2( height ) )
|
||||
else if (!isPow2(width) || !isPow2(height))
|
||||
{
|
||||
// If a texture is not power-of-2 in size for both dimensions, it must
|
||||
// have only 1 mip level.
|
||||
inOutNumMips = 1;
|
||||
inOutNumMips = mFloor(mLog2(mMax(width, height))) + 1;
|
||||
}
|
||||
|
||||
|
||||
// Check format, and compatibility with texture profile requirements
|
||||
bool autoGenSupp = ( inOutNumMips == 0 );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue