From fc67738ee80989e79ba65c34521c42e1a30934f4 Mon Sep 17 00:00:00 2001 From: Branan Purvine-Riley Date: Sat, 27 Jul 2013 15:50:10 -0700 Subject: [PATCH] Remove some obviously obsolete caps --- .../plPipeline/DX/plDXEnumerate.cpp | 4 - .../PubUtilLib/plPipeline/DX/plDXPipeline.cpp | 86 +++---------------- .../PubUtilLib/plPipeline/DX/plDXPipeline.h | 26 +++--- .../plPipeline/hsG3DDeviceSelector.cpp | 22 +---- .../plPipeline/hsG3DDeviceSelector.h | 12 --- 5 files changed, 25 insertions(+), 125 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp index d1eb4613..8588b545 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp @@ -729,10 +729,6 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDevice(D3DEnum_DeviceInfo* devInfo, hsG devRec.SetCap(kCapsPerspective); if( devInfo->fIsHardware ) devRec.SetCap( kCapsHardware ); - if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_DITHER ) - devRec.SetCap(kCapsDither); - if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_WBUFFER ) - devRec.SetCap(kCapsWBuffer); if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_FOGTABLE ) { devRec.SetCap( kCapsFogLinear ); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp index 42dd103d..496cc6cf 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp @@ -890,7 +890,6 @@ void plDXGeneralSettings::Reset() fNoGammaCorrect = false; fMaxUVWSrc = 8; fCantProj = false; - fLimitedProj = false; fBadManaged = false; fShareDepth = false; fCurrAnisotropy = false; @@ -929,7 +928,7 @@ void plDXPipeline::IInitDeviceState() fD3DDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_LESSEQUAL ); fD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE ); - fD3DDevice->SetRenderState( D3DRS_ZENABLE, ( fSettings.fD3DCaps & kCapsWBuffer ) ? D3DZB_USEW : D3DZB_TRUE ); + fD3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE ); fD3DDevice->SetRenderState( D3DRS_CLIPPING, TRUE ); fD3DDevice->SetRenderState( D3DRS_CULLMODE, fCurrCullMode ); ISetCullMode(); @@ -941,7 +940,7 @@ void plDXPipeline::IInitDeviceState() fD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, ( fSettings.fD3DCaps & kCapsFSAntiAlias ) ? TRUE : FALSE ); fD3DDevice->SetRenderState( D3DRS_ANTIALIASEDLINEENABLE, FALSE ); - fD3DDevice->SetRenderState( D3DRS_DITHERENABLE, ( fSettings.fD3DCaps & kCapsDither ) ? TRUE : FALSE ); + fD3DDevice->SetRenderState( D3DRS_DITHERENABLE, FALSE ); fD3DDevice->SetRenderState( D3DRS_SPECULARENABLE, FALSE ); fD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); fCurrD3DLiteState = false; @@ -1038,10 +1037,6 @@ void plDXPipeline::ISetCaps() fSettings.fD3DCaps |= kCapsMipmap; if (fCurrentDevice->fDDCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) fSettings.fD3DCaps |= kCapsCubicMipmap; - if (fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WBUFFER) - fSettings.fD3DCaps |= kCapsWBuffer; - if (fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_DITHER) - fSettings.fD3DCaps |= kCapsDither; if (fSettings.fNumAASamples > 0) fSettings.fD3DCaps |= kCapsFSAntiAlias; if (fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WFOG) @@ -1165,16 +1160,8 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec ) fSettings.fD3DCaps &= ~kCapsMipmap; if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicMipmap ) ) fSettings.fD3DCaps &= ~kCapsCubicMipmap; - if( !devRec.GetCap( hsG3DDeviceSelector::kCapsWBuffer ) ) - fSettings.fD3DCaps &= ~kCapsWBuffer; if( !devRec.GetCap( hsG3DDeviceSelector::kCapsZBias ) ) fSettings.fD3DCaps &= ~kCapsZBias; -// if( !devRec.GetCap( hsG3DDeviceSelector::kCapsHWTransform ) ) -// fSettings.fD3DCaps &= ~kCapsHWTransform; - if( !devRec.GetCap( hsG3DDeviceSelector::kCapsDither ) ) - fSettings.fD3DCaps &= ~kCapsDither; -// if( devRec.GetAASetting() == 0 ) -// fSettings.fD3DCaps &= ~kCapsFSAntiAlias; if( !devRec.GetCap( hsG3DDeviceSelector::kCapsFogExp ) ) fSettings.fD3DCaps &= ~kCapsExpFog; if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicTextures ) ) @@ -1185,8 +1172,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec ) if( devRec.GetCap(hsG3DDeviceSelector::kCapsCantProj) ) fSettings.fCantProj = true; - if( devRec.GetCap(hsG3DDeviceSelector::kCapsLimitedProj) ) - fSettings.fLimitedProj = true; if( devRec.GetCap(hsG3DDeviceSelector::kCapsBadManaged) ) fSettings.fBadManaged = true; if( devRec.GetCap(hsG3DDeviceSelector::kCapsShareDepth) ) @@ -1202,11 +1187,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec ) if( devRec.GetCap( hsG3DDeviceSelector::kCapsBadYonStuff ) ) fSettings.fD3DCaps |= kCapsHasBadYonStuff; - /// 10.31.2000 mcn - Flag for can't-handle-under-8-pixel-dimensions-on-textures - /// (see, isn't the name flag actually better in retrospect? :) - if( devRec.GetCap( hsG3DDeviceSelector::kCapsNoKindaSmallTexs ) ) - fSettings.fD3DCaps |= kCapsNoKindaSmallTexs; - /// Note: the following SHOULD be here, but we later detect for texture /// formats and reset this flag. It should only be set if it is set already, /// but that means ensuring it's set beforehand, which it might not be. @@ -1268,15 +1248,8 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec ) fManagedCutoff = 1; } - //// Our temp debug flag to force z-buffering... - if( !( fDbgSetupInitFlags & 0x00000001 ) ) - fSettings.fD3DCaps &= ~kCapsWBuffer; - - /// Set up the z-bias scale values, based on z- or w-buffering - if( fSettings.fD3DCaps & kCapsWBuffer ) - fTweaks.fDefaultPerspLayerScale = kPerspLayerScaleW; - else - fTweaks.fDefaultPerspLayerScale = kPerspLayerScale; + /// Set up the z-bias scale values + fTweaks.fDefaultPerspLayerScale = kPerspLayerScale; // Less than 4 layers at once means we have to fallback on uv bumpmapping @@ -3909,9 +3882,7 @@ bool plDXPipeline::BeginRender() } // Superfluous setting of Z state. - fD3DDevice->SetRenderState( D3DRS_ZENABLE, - ( fView.IsPerspective() && ( fSettings.fD3DCaps & kCapsWBuffer ) ) - ? D3DZB_USEW : D3DZB_TRUE ); + fD3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE ); /// If we have a renderTarget active, use its viewport ISetViewport(); @@ -8693,11 +8664,6 @@ bool plDXPipeline::IProcessMipmapLevels( plMipmap *mipmap, uint32_t &numLevels, { uint32_t sizeMask = 0x03; - /// 10.31.2000 - If we have this flag set, we really have to cut out - /// sizes under 8x8. So far only true on the KYRO... - if( fSettings.fD3DCaps & kCapsNoKindaSmallTexs ) - sizeMask = 0x07; - int maxLevel = mipmap->GetNumLevels() - 1; /// 9.7.2000 - Also do this test if the card doesn't support @@ -9713,34 +9679,15 @@ hsMatrix44 plDXPipeline::IGetCameraToNDC() // is [x/w, y/w, z/w + t/s, 1/sw] - if( fSettings.fD3DCaps & kCapsWBuffer ) - { - // W-buffering is only true w-buffering on 3dfx cards. On everything else, - // they REALLY base it off the Z value. So we want to scale (but NOT translate) - // the Z... - // Note: the base value for perspLayerScale should be 0.001 for w-buffering, - // not the normal 0.00001 - float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale; - - cam2ndc.fMap[0][0] *= scale; - cam2ndc.fMap[1][1] *= scale; - cam2ndc.fMap[2][2] *= scale; - cam2ndc.fMap[3][2] *= scale; - } - else - { - // Z-buffering, so do it the traditional way - float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale; -// scale = -1.f; - float zTrans = -scale * float(fCurrRenderLayer) * fTweaks.fPerspLayerTrans; + float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale; + float zTrans = -scale * float(fCurrRenderLayer) * fTweaks.fPerspLayerTrans; - cam2ndc.fMap[0][0] *= scale; - cam2ndc.fMap[1][1] *= scale; + cam2ndc.fMap[0][0] *= scale; + cam2ndc.fMap[1][1] *= scale; - cam2ndc.fMap[2][2] *= scale; - cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2]; - cam2ndc.fMap[3][2] *= scale; - } + cam2ndc.fMap[2][2] *= scale; + cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2]; + cam2ndc.fMap[3][2] *= scale; } else { @@ -11408,9 +11355,6 @@ void plDXPipeline::IRenderProjectionEach(const plRenderPrimFunc& render, hsGMate int iNextPass = iPass + fCurrNumLayers; - if( fSettings.fLimitedProj && (material->GetLayer(iPass)->GetUVWSrc() & ~plLayerInterface::kUVWIdxMask) ) - return; - // For each projector: int k; for( k = 0; k < fLights.fProjEach.GetCount(); k++ ) @@ -12239,12 +12183,6 @@ void plDXPipeline::SubmitShadowSlave(plShadowSlave* slave) if( !(slave && slave->fCaster && slave->fCaster->GetKey()) ) return; - // A board with limited projection capability (i.e. GeForce1) can't - // do perspective shadows (from point source lights) because it - // requires a count3 uvw on 2 texture units (0,1) simultaneously. Just skip. - if( (fSettings.fLimitedProj || fSettings.fCantProj) && slave->fView.GetPerspective() ) - return; - // Ref the shadow caster so we're sure it will still be around when we go to // render it. slave->fCaster->GetKey()->RefObject(); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h index 58dca47a..d0f933fe 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h @@ -187,21 +187,17 @@ protected: kCapsExpFog = 0x00000040, kCapsExp2Fog = 0x00000080, kCapsRangeFog = 0x00000100, - kCapsWBuffer = 0x00000200, - kCapsTexBoundToStage = 0x00000400, - kCapsDither = 0x00000800, - kCapsLODWatch = 0x00001000, - kCapsFSAntiAlias = 0x00002000, - kCapsLuminanceTextures = 0x00004000, - kCapsDoesSmallTextures = 0x00008000, - kCapsDoesWFog = 0x00010000, - kCapsPixelFog = 0x00020000, - kCapsHasBadYonStuff = 0x00040000, - kCapsNoKindaSmallTexs = 0x00080000, - kCapsNpotTextures = 0x00100000, - - kCapsCubicTextures = 0x00200000, - kCapsCubicMipmap = 0x00400000 + kCapsTexBoundToStage = 0x00000200, + kCapsLODWatch = 0x00000400, + kCapsFSAntiAlias = 0x00000800, + kCapsLuminanceTextures = 0x00001000, + kCapsDoesSmallTextures = 0x00002000, + kCapsDoesWFog = 0x00004000, + kCapsPixelFog = 0x00008000, + kCapsHasBadYonStuff = 0x00010000, + kCapsNpotTextures = 0x00020000, + kCapsCubicTextures = 0x00040000, + kCapsCubicMipmap = 0x00080000 }; enum { kKNone = 0x0, diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp index a13bec23..c896b3df 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp @@ -552,7 +552,6 @@ namespace kDefaultChipset = 0x00, kIntelI810Chipset, kS3GenericChipset, - kKYROChipset, kATIRadeonChipset, kATIR8X00Chipset, kMatroxParhelia, @@ -603,30 +602,19 @@ namespace }; uint32_t dsATIR8X00CapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsWBuffer, + 1, // First integer is always the length hsG3DDeviceSelector::kCapsDoesSmallTextures }; uint32_t dsDefaultCapsClr[] = { 1, // First integer is always the length hsG3DDeviceSelector::kCapsDoesSmallTextures }; - uint32_t dsKYROCapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsDoesSmallTextures, - hsG3DDeviceSelector::kCapsPixelFog }; - - uint32_t dsKYROCapsSet[] = { - 1, // First integer is always the length - hsG3DDeviceSelector::kCapsNoKindaSmallTexs }; - CFTable dsCFTable[] = - { + { // Chipset ID // F2Set // F2Clear // ZSuck // MaxLayers // LODBias // Fog Value Tables { kDefaultChipset, nullptr, dsDefaultCapsClr, 0, 0, 0, &dsDefaultFogVals }, { kNVidiaGeForceFXChipset, dsGeForceFXCapsSet, nullptr, 0, 0, 0, &dsDefaultFogVals }, { kIntelI810Chipset, nullptr, dsDefaultCapsClr, 4.5f, 1, -0.5f, &dsi810FogVals }, - { kKYROChipset, dsKYROCapsSet, dsKYROCapsClr, -151.0f, 1, 0, &dsDefaultFogVals }, { kATIR8X00Chipset, dsATIR8X00CapsSet, dsATIR8X00CapsClr, 0, 0, 0, &dsRadeonFogVals }, }; @@ -710,12 +698,6 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, hsStatusMessage( "== Using fudge factors for an Intel i810 chipset ==\n" ); ISetFudgeFactors( kIntelI810Chipset, record ); } - /// Detect STMicroelectronics KYRO chipset - else if( deviceID == 0x00000010 && ( strstr( desc, "kyro" ) != nil ) ) - { - hsStatusMessage( "== Using fudge factors for a KYRO chipset ==\n" ); - ISetFudgeFactors( kKYROChipset, record ); - } /// Detect for a GeForc FX card. We only need to nerf the really low end one. else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce fx 5200" ) != nil ) { diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h index 442ffd81..1ae4602a 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h @@ -143,7 +143,6 @@ public: protected: - /// Version < 2 Data uint32_t fFlags; uint32_t fG3DDeviceType; @@ -161,7 +160,6 @@ protected: hsTArray fModes; - /// New to Version 3 float fZBiasRating; float fLODBiasRating; float fFogExpApproxStart; @@ -170,14 +168,11 @@ protected: // (i.e. for Z fog, it's a percentage of 1 to add on, // for W fog, it's a percentage of the yon) - /// Version 7 - Fog Knee values float fFogKnees[ kNumFogTypes ]; float fFogKneeVals[ kNumFogTypes ]; - /// Version 9 - The actual AA setting we use uint8_t fAASetting; - /// Version A - the anisotropic level we use uint8_t fMaxAnisotropicSamples; // 1 to disable, up to max allowed in hardware public: @@ -289,24 +284,18 @@ public: }; enum { kCapsNone = 0, - kCapsNoWindow, kCapsMipmap, kCapsPerspective, kCapsHardware, - kCapsWBuffer, kCapsCompressTextures, kCapsHWTransform, - kCapsDither, kCapsFogLinear, kCapsFogExp, kCapsFogExp2, kCapsFogRange, - kCapsLODWatch, - kCapsUNUSED, kCapsDoesSmallTextures, kCapsPixelFog, kCapsBadYonStuff, - kCapsNoKindaSmallTexs, kCapsCubicTextures, kCapsCubicMipmap, kCapsZBias, @@ -317,7 +306,6 @@ public: kCapsCantShadow, kCapsMaxUVWSrc2, kCapsCantProj, - kCapsLimitedProj, kCapsShareDepth, kCapsBadManaged, kCapsNoAniso,