Browse Source

Remove some obviously obsolete caps

Branan Purvine-Riley 12 years ago committed by Adam Johnson
parent
commit
fc67738ee8
  1. 4
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp
  2. 70
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp
  3. 26
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h
  4. 20
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  5. 12
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h

4
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXEnumerate.cpp

@ -729,10 +729,6 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDevice(D3DEnum_DeviceInfo* devInfo, hsG
devRec.SetCap(kCapsPerspective); devRec.SetCap(kCapsPerspective);
if( devInfo->fIsHardware ) if( devInfo->fIsHardware )
devRec.SetCap( kCapsHardware ); 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 ) if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_FOGTABLE )
{ {
devRec.SetCap( kCapsFogLinear ); devRec.SetCap( kCapsFogLinear );

70
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp

@ -890,7 +890,6 @@ void plDXGeneralSettings::Reset()
fNoGammaCorrect = false; fNoGammaCorrect = false;
fMaxUVWSrc = 8; fMaxUVWSrc = 8;
fCantProj = false; fCantProj = false;
fLimitedProj = false;
fBadManaged = false; fBadManaged = false;
fShareDepth = false; fShareDepth = false;
fCurrAnisotropy = false; fCurrAnisotropy = false;
@ -929,7 +928,7 @@ void plDXPipeline::IInitDeviceState()
fD3DDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_LESSEQUAL ); fD3DDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_LESSEQUAL );
fD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE ); 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_CLIPPING, TRUE );
fD3DDevice->SetRenderState( D3DRS_CULLMODE, fCurrCullMode ); fD3DDevice->SetRenderState( D3DRS_CULLMODE, fCurrCullMode );
ISetCullMode(); ISetCullMode();
@ -941,7 +940,7 @@ void plDXPipeline::IInitDeviceState()
fD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, ( fSettings.fD3DCaps & kCapsFSAntiAlias ) ? TRUE : FALSE ); fD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, ( fSettings.fD3DCaps & kCapsFSAntiAlias ) ? TRUE : FALSE );
fD3DDevice->SetRenderState( D3DRS_ANTIALIASEDLINEENABLE, 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_SPECULARENABLE, FALSE );
fD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); fD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE );
fCurrD3DLiteState = false; fCurrD3DLiteState = false;
@ -1038,10 +1037,6 @@ void plDXPipeline::ISetCaps()
fSettings.fD3DCaps |= kCapsMipmap; fSettings.fD3DCaps |= kCapsMipmap;
if (fCurrentDevice->fDDCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) if (fCurrentDevice->fDDCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP)
fSettings.fD3DCaps |= kCapsCubicMipmap; 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) if (fSettings.fNumAASamples > 0)
fSettings.fD3DCaps |= kCapsFSAntiAlias; fSettings.fD3DCaps |= kCapsFSAntiAlias;
if (fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WFOG) if (fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WFOG)
@ -1165,16 +1160,8 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
fSettings.fD3DCaps &= ~kCapsMipmap; fSettings.fD3DCaps &= ~kCapsMipmap;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicMipmap ) ) if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicMipmap ) )
fSettings.fD3DCaps &= ~kCapsCubicMipmap; fSettings.fD3DCaps &= ~kCapsCubicMipmap;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsWBuffer ) )
fSettings.fD3DCaps &= ~kCapsWBuffer;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsZBias ) ) if( !devRec.GetCap( hsG3DDeviceSelector::kCapsZBias ) )
fSettings.fD3DCaps &= ~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 ) ) if( !devRec.GetCap( hsG3DDeviceSelector::kCapsFogExp ) )
fSettings.fD3DCaps &= ~kCapsExpFog; fSettings.fD3DCaps &= ~kCapsExpFog;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicTextures ) ) if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicTextures ) )
@ -1185,8 +1172,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
if( devRec.GetCap(hsG3DDeviceSelector::kCapsCantProj) ) if( devRec.GetCap(hsG3DDeviceSelector::kCapsCantProj) )
fSettings.fCantProj = true; fSettings.fCantProj = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsLimitedProj) )
fSettings.fLimitedProj = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsBadManaged) ) if( devRec.GetCap(hsG3DDeviceSelector::kCapsBadManaged) )
fSettings.fBadManaged = true; fSettings.fBadManaged = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsShareDepth) ) if( devRec.GetCap(hsG3DDeviceSelector::kCapsShareDepth) )
@ -1202,11 +1187,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
if( devRec.GetCap( hsG3DDeviceSelector::kCapsBadYonStuff ) ) if( devRec.GetCap( hsG3DDeviceSelector::kCapsBadYonStuff ) )
fSettings.fD3DCaps |= kCapsHasBadYonStuff; 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 /// 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, /// 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. /// but that means ensuring it's set beforehand, which it might not be.
@ -1268,14 +1248,7 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
fManagedCutoff = 1; fManagedCutoff = 1;
} }
//// Our temp debug flag to force z-buffering... /// Set up the z-bias scale values
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; fTweaks.fDefaultPerspLayerScale = kPerspLayerScale;
@ -3909,9 +3882,7 @@ bool plDXPipeline::BeginRender()
} }
// Superfluous setting of Z state. // Superfluous setting of Z state.
fD3DDevice->SetRenderState( D3DRS_ZENABLE, fD3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
( fView.IsPerspective() && ( fSettings.fD3DCaps & kCapsWBuffer ) )
? D3DZB_USEW : D3DZB_TRUE );
/// If we have a renderTarget active, use its viewport /// If we have a renderTarget active, use its viewport
ISetViewport(); ISetViewport();
@ -8693,11 +8664,6 @@ bool plDXPipeline::IProcessMipmapLevels( plMipmap *mipmap, uint32_t &numLevels,
{ {
uint32_t sizeMask = 0x03; 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; int maxLevel = mipmap->GetNumLevels() - 1;
/// 9.7.2000 - Also do this test if the card doesn't support /// 9.7.2000 - Also do this test if the card doesn't support
@ -9713,25 +9679,7 @@ hsMatrix44 plDXPipeline::IGetCameraToNDC()
// is [x/w, y/w, z/w + t/s, 1/sw] // 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; 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 zTrans = -scale * float(fCurrRenderLayer) * fTweaks.fPerspLayerTrans;
cam2ndc.fMap[0][0] *= scale; cam2ndc.fMap[0][0] *= scale;
@ -9741,7 +9689,6 @@ hsMatrix44 plDXPipeline::IGetCameraToNDC()
cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2]; cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2];
cam2ndc.fMap[3][2] *= scale; cam2ndc.fMap[3][2] *= scale;
} }
}
else else
{ {
plConst(float) kZTrans = -1.e-4f; plConst(float) kZTrans = -1.e-4f;
@ -11408,9 +11355,6 @@ void plDXPipeline::IRenderProjectionEach(const plRenderPrimFunc& render, hsGMate
int iNextPass = iPass + fCurrNumLayers; int iNextPass = iPass + fCurrNumLayers;
if( fSettings.fLimitedProj && (material->GetLayer(iPass)->GetUVWSrc() & ~plLayerInterface::kUVWIdxMask) )
return;
// For each projector: // For each projector:
int k; int k;
for( k = 0; k < fLights.fProjEach.GetCount(); 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()) ) if( !(slave && slave->fCaster && slave->fCaster->GetKey()) )
return; 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 // Ref the shadow caster so we're sure it will still be around when we go to
// render it. // render it.
slave->fCaster->GetKey()->RefObject(); slave->fCaster->GetKey()->RefObject();

26
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h

@ -187,21 +187,17 @@ protected:
kCapsExpFog = 0x00000040, kCapsExpFog = 0x00000040,
kCapsExp2Fog = 0x00000080, kCapsExp2Fog = 0x00000080,
kCapsRangeFog = 0x00000100, kCapsRangeFog = 0x00000100,
kCapsWBuffer = 0x00000200, kCapsTexBoundToStage = 0x00000200,
kCapsTexBoundToStage = 0x00000400, kCapsLODWatch = 0x00000400,
kCapsDither = 0x00000800, kCapsFSAntiAlias = 0x00000800,
kCapsLODWatch = 0x00001000, kCapsLuminanceTextures = 0x00001000,
kCapsFSAntiAlias = 0x00002000, kCapsDoesSmallTextures = 0x00002000,
kCapsLuminanceTextures = 0x00004000, kCapsDoesWFog = 0x00004000,
kCapsDoesSmallTextures = 0x00008000, kCapsPixelFog = 0x00008000,
kCapsDoesWFog = 0x00010000, kCapsHasBadYonStuff = 0x00010000,
kCapsPixelFog = 0x00020000, kCapsNpotTextures = 0x00020000,
kCapsHasBadYonStuff = 0x00040000, kCapsCubicTextures = 0x00040000,
kCapsNoKindaSmallTexs = 0x00080000, kCapsCubicMipmap = 0x00080000
kCapsNpotTextures = 0x00100000,
kCapsCubicTextures = 0x00200000,
kCapsCubicMipmap = 0x00400000
}; };
enum { enum {
kKNone = 0x0, kKNone = 0x0,

20
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp

@ -552,7 +552,6 @@ namespace
kDefaultChipset = 0x00, kDefaultChipset = 0x00,
kIntelI810Chipset, kIntelI810Chipset,
kS3GenericChipset, kS3GenericChipset,
kKYROChipset,
kATIRadeonChipset, kATIRadeonChipset,
kATIR8X00Chipset, kATIR8X00Chipset,
kMatroxParhelia, kMatroxParhelia,
@ -603,30 +602,19 @@ namespace
}; };
uint32_t dsATIR8X00CapsClr[] = { uint32_t dsATIR8X00CapsClr[] = {
2, // First integer is always the length 1, // First integer is always the length
hsG3DDeviceSelector::kCapsWBuffer,
hsG3DDeviceSelector::kCapsDoesSmallTextures }; hsG3DDeviceSelector::kCapsDoesSmallTextures };
uint32_t dsDefaultCapsClr[] = { uint32_t dsDefaultCapsClr[] = {
1, // First integer is always the length 1, // First integer is always the length
hsG3DDeviceSelector::kCapsDoesSmallTextures }; 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[] = CFTable dsCFTable[] =
{ {
// Chipset ID // F2Set // F2Clear // ZSuck // MaxLayers // LODBias // Fog Value Tables // Chipset ID // F2Set // F2Clear // ZSuck // MaxLayers // LODBias // Fog Value Tables
{ kDefaultChipset, nullptr, dsDefaultCapsClr, 0, 0, 0, &dsDefaultFogVals }, { kDefaultChipset, nullptr, dsDefaultCapsClr, 0, 0, 0, &dsDefaultFogVals },
{ kNVidiaGeForceFXChipset, dsGeForceFXCapsSet, nullptr, 0, 0, 0, &dsDefaultFogVals }, { kNVidiaGeForceFXChipset, dsGeForceFXCapsSet, nullptr, 0, 0, 0, &dsDefaultFogVals },
{ kIntelI810Chipset, nullptr, dsDefaultCapsClr, 4.5f, 1, -0.5f, &dsi810FogVals }, { kIntelI810Chipset, nullptr, dsDefaultCapsClr, 4.5f, 1, -0.5f, &dsi810FogVals },
{ kKYROChipset, dsKYROCapsSet, dsKYROCapsClr, -151.0f, 1, 0, &dsDefaultFogVals },
{ kATIR8X00Chipset, dsATIR8X00CapsSet, dsATIR8X00CapsClr, 0, 0, 0, &dsRadeonFogVals }, { 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" ); hsStatusMessage( "== Using fudge factors for an Intel i810 chipset ==\n" );
ISetFudgeFactors( kIntelI810Chipset, record ); 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. /// 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 ) else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce fx 5200" ) != nil )
{ {

12
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h

@ -143,7 +143,6 @@ public:
protected: protected:
/// Version < 2 Data
uint32_t fFlags; uint32_t fFlags;
uint32_t fG3DDeviceType; uint32_t fG3DDeviceType;
@ -161,7 +160,6 @@ protected:
hsTArray<hsG3DDeviceMode> fModes; hsTArray<hsG3DDeviceMode> fModes;
/// New to Version 3
float fZBiasRating; float fZBiasRating;
float fLODBiasRating; float fLODBiasRating;
float fFogExpApproxStart; float fFogExpApproxStart;
@ -170,14 +168,11 @@ protected:
// (i.e. for Z fog, it's a percentage of 1 to add on, // (i.e. for Z fog, it's a percentage of 1 to add on,
// for W fog, it's a percentage of the yon) // for W fog, it's a percentage of the yon)
/// Version 7 - Fog Knee values
float fFogKnees[ kNumFogTypes ]; float fFogKnees[ kNumFogTypes ];
float fFogKneeVals[ kNumFogTypes ]; float fFogKneeVals[ kNumFogTypes ];
/// Version 9 - The actual AA setting we use
uint8_t fAASetting; uint8_t fAASetting;
/// Version A - the anisotropic level we use
uint8_t fMaxAnisotropicSamples; // 1 to disable, up to max allowed in hardware uint8_t fMaxAnisotropicSamples; // 1 to disable, up to max allowed in hardware
public: public:
@ -289,24 +284,18 @@ public:
}; };
enum { enum {
kCapsNone = 0, kCapsNone = 0,
kCapsNoWindow,
kCapsMipmap, kCapsMipmap,
kCapsPerspective, kCapsPerspective,
kCapsHardware, kCapsHardware,
kCapsWBuffer,
kCapsCompressTextures, kCapsCompressTextures,
kCapsHWTransform, kCapsHWTransform,
kCapsDither,
kCapsFogLinear, kCapsFogLinear,
kCapsFogExp, kCapsFogExp,
kCapsFogExp2, kCapsFogExp2,
kCapsFogRange, kCapsFogRange,
kCapsLODWatch,
kCapsUNUSED,
kCapsDoesSmallTextures, kCapsDoesSmallTextures,
kCapsPixelFog, kCapsPixelFog,
kCapsBadYonStuff, kCapsBadYonStuff,
kCapsNoKindaSmallTexs,
kCapsCubicTextures, kCapsCubicTextures,
kCapsCubicMipmap, kCapsCubicMipmap,
kCapsZBias, kCapsZBias,
@ -317,7 +306,6 @@ public:
kCapsCantShadow, kCapsCantShadow,
kCapsMaxUVWSrc2, kCapsMaxUVWSrc2,
kCapsCantProj, kCapsCantProj,
kCapsLimitedProj,
kCapsShareDepth, kCapsShareDepth,
kCapsBadManaged, kCapsBadManaged,
kCapsNoAniso, kCapsNoAniso,

Loading…
Cancel
Save