From 3fb5f3351732a78dbd1ca28439653ac65e886445 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 31 Jan 2013 22:43:15 -0500 Subject: [PATCH] Add plQuality entry for Shader Model 3 --- Sources/Plasma/CoreLib/plQuality.h | 7 ++--- .../PubUtilLib/plPipeline/plDXPipeline.cpp | 26 ++++++++++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Sources/Plasma/CoreLib/plQuality.h b/Sources/Plasma/CoreLib/plQuality.h index fde95339..7d2f3b5b 100644 --- a/Sources/Plasma/CoreLib/plQuality.h +++ b/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 diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 79850342..bdafdf60 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/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) { - if( pixelMinor >= 4 ) + case 1: + if (pixelMinor >= 4) plQuality::SetCapability(plQuality::kPS_1_4); - else if( pixelMinor > 0 ) + 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; } }