Browse Source

Add plQuality entry for Shader Model 3

Adam Johnson 12 years ago
parent
commit
3fb5f33517
  1. 7
      Sources/Plasma/CoreLib/plQuality.h
  2. 22
      Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

7
Sources/Plasma/CoreLib/plQuality.h

@ -50,9 +50,10 @@ public:
{
kMinimum = 0,
kPS_1_1 = 2,
kPS_1_4 = 3,
kPS_2_Plus = 4
kPS_1_1 = 2, // DirectX 8.0
kPS_1_4 = 3, // DirectX 8.1
kPS_2 = 4, // DirectX 9
kPS_3 = 5, // DirectX 9.0c
};
protected:
// These two are instanciated in plLoadMask.cpp, as well as

22
Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

@ -1100,16 +1100,28 @@ void plDXPipeline::ISetGraphicsCapability(uint32_t v)
{
int pixelMajor = D3DSHADER_VERSION_MAJOR(v);
int pixelMinor = D3DSHADER_VERSION_MINOR(v);
if( pixelMajor > 1 )
{
plQuality::SetCapability(plQuality::kPS_2_Plus);
}
else if( pixelMajor > 0 )
switch (pixelMajor)
{
case 1:
if (pixelMinor >= 4)
plQuality::SetCapability(plQuality::kPS_1_4);
else if (pixelMinor > 0)
plQuality::SetCapability(plQuality::kPS_1_1);
break;
case 2:
plQuality::SetCapability(plQuality::kPS_2);
break;
case 3:
plQuality::SetCapability(plQuality::kPS_3);
break;
default:
// Hopefully this is always FALSE. If not, may gawd have mercy upon your soul.
if (pixelMajor == 0)
plQuality::SetCapability(plQuality::kMinimum);
else
plQuality::SetCapability(plQuality::kPS_3);
break;
}
}

Loading…
Cancel
Save