Skip to content

Commit

Permalink
D3D9: do not spam unsupported HLSL targets & correct VTF format check
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Feb 15, 2020
1 parent 17304da commit c1910c4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 3 additions & 7 deletions RenderSystems/Direct3D9/src/OgreD3D9HLSLProgram.cpp
Expand Up @@ -649,24 +649,20 @@ namespace Ogre {
//-----------------------------------------------------------------------
void D3D9HLSLProgram::setTarget(const String& target)
{
mTarget = "";
std::vector<String> profiles = StringUtil::split(target, " ");

// find first supported format
for(unsigned int i = 0 ; i < profiles.size() ; i++)
{
String & currentProfile = profiles[i];
if(GpuProgramManager::getSingleton().isSyntaxSupported(currentProfile))
{
mTarget = currentProfile;
break;
return;
}
}

if(mTarget == "")
{
LogManager::getSingleton().logMessage(
"Invalid target for D3D9 shader '" + mName + "' - '" + target + "'");
}
mTarget = profiles.front();
}

//-----------------------------------------------------------------------
Expand Down
4 changes: 1 addition & 3 deletions RenderSystems/Direct3D9/src/OgreD3D9RenderSystem.cpp
Expand Up @@ -1496,9 +1496,7 @@ namespace Ogre
for (uint ipf = static_cast<uint>(PF_L8); ipf < static_cast<uint>(PF_COUNT); ++ipf)
{
PixelFormat pf = (PixelFormat)ipf;

D3DFORMAT fmt =
D3D9Mappings::_getPF(D3D9Mappings::_getClosestSupportedPF(pf));
D3DFORMAT fmt = D3D9Mappings::_getPF(pf);

if (SUCCEEDED(mD3D->CheckDeviceFormat(
mActiveD3DDriver->getAdapterNumber(), D3DDEVTYPE_HAL, bbSurfDesc.Format,
Expand Down

0 comments on commit c1910c4

Please sign in to comment.