mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-06 02:00:25 +02:00
Vertex texture sampling support in Direct3D 9 now controlled via texture-flag ETCF_SUPPORT_VERTEXT_TEXTURE
It's no longer enabled by default as it causes some costs to all texture switches. Thanks @ edo9300 for reporting (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52721) git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6219 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -698,12 +698,6 @@ bool CD3D9Driver::setActiveTexture(u32 stage, const video::ITexture* texture)
|
||||
if (CurrentTexture[stage] == texture)
|
||||
return true;
|
||||
|
||||
if (texture && texture->getDriverType() != EDT_DIRECT3D9)
|
||||
{
|
||||
os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
CurrentTexture[stage] = texture;
|
||||
|
||||
if (!texture)
|
||||
@ -711,13 +705,20 @@ bool CD3D9Driver::setActiveTexture(u32 stage, const video::ITexture* texture)
|
||||
pID3DDevice->SetTexture(stage, 0);
|
||||
pID3DDevice->SetTextureStageState( stage, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );
|
||||
}
|
||||
else
|
||||
else if (texture->getDriverType() == EDT_DIRECT3D9)
|
||||
{
|
||||
pID3DDevice->SetTexture(stage, ((const CD3D9Texture*)texture)->getDX9BaseTexture());
|
||||
|
||||
if (stage <= 4)
|
||||
if (((const CD3D9Texture*)texture)->HasVertexTextureSupport() && stage < 4 )
|
||||
pID3DDevice->SetTexture(D3DVERTEXTEXTURESAMPLER0 + stage, ((const CD3D9Texture*)texture)->getDX9BaseTexture());
|
||||
}
|
||||
else
|
||||
{
|
||||
os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR);
|
||||
setActiveTexture(stage, 0);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user