Add direct3d diff for old nevrax pixel program code, marked a todo in the comments
--HG-- branch : multipass-stereo
This commit is contained in:
parent
f08de2dcdc
commit
197c0687d9
3 changed files with 46 additions and 14 deletions
|
@ -193,6 +193,11 @@ CDriverD3D::CDriverD3D()
|
|||
#else // NL_DISABLE_HARDWARE_VERTEX_PROGAM
|
||||
_DisableHardwareVertexProgram = false;
|
||||
#endif // NL_DISABLE_HARDWARE_VERTEX_PROGAM
|
||||
#ifdef NL_DISABLE_HARDWARE_PIXEL_PROGAM
|
||||
_DisableHardwarePixelProgram = true;
|
||||
#else // NL_DISABLE_HARDWARE_PIXEL_PROGAM
|
||||
_DisableHardwarePixelProgram = false;
|
||||
#endif // NL_DISABLE_HARDWARE_PIXEL_PROGAM
|
||||
#ifdef NL_DISABLE_HARDWARE_VERTEX_ARRAY_AGP
|
||||
_DisableHardwareVertexArrayAGP = true;
|
||||
#else // NL_DISABLE_HARDWARE_VERTEX_ARRAY_AGP
|
||||
|
@ -1546,6 +1551,7 @@ bool CDriverD3D::setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool r
|
|||
#endif // NL_FORCE_TEXTURE_STAGE_COUNT
|
||||
|
||||
_VertexProgram = !_DisableHardwareVertexProgram && ((caps.VertexShaderVersion&0xffff) >= 0x0100);
|
||||
_PixelProgram = !_DisableHardwarePixelProgram && (caps.PixelShaderVersion&0xffff) >= 0x0101;
|
||||
_PixelShader = !_DisableHardwarePixelShader && (caps.PixelShaderVersion&0xffff) >= 0x0101;
|
||||
_MaxVerticesByVertexBufferHard = caps.MaxVertexIndex;
|
||||
_MaxLight = caps.MaxActiveLights;
|
||||
|
@ -2016,6 +2022,8 @@ bool CDriverD3D::swapBuffers()
|
|||
|
||||
// Reset vertex program
|
||||
setVertexProgram (NULL, NULL);
|
||||
// Reset pixel program
|
||||
setPixelShader (NULL);
|
||||
|
||||
if (_VBHardProfiling)
|
||||
{
|
||||
|
|
|
@ -240,6 +240,19 @@ public:
|
|||
CVertexProgamDrvInfosD3D(IDriver *drv, ItVtxPrgDrvInfoPtrList it);
|
||||
~CVertexProgamDrvInfosD3D();
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
class CPixelProgramDrvInfosD3D : public IPixelProgramDrvInfos
|
||||
{
|
||||
public:
|
||||
|
||||
// The shader
|
||||
IDirect3DPixelShader9 *Shader;
|
||||
|
||||
CPixelProgramDrvInfosD3D(IDriver *drv, ItPixelPrgDrvInfoPtrList it);
|
||||
~CPixelProgramDrvInfosD3D();
|
||||
};
|
||||
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -773,6 +786,7 @@ public:
|
|||
|
||||
// Driver parameters
|
||||
virtual void disableHardwareVertexProgram();
|
||||
virtual void disableHardwarePixelProgram();
|
||||
virtual void disableHardwareIndexArrayAGP();
|
||||
virtual void disableHardwareVertexArrayAGP();
|
||||
virtual void disableHardwareTextureShader();
|
||||
|
@ -993,8 +1007,10 @@ public:
|
|||
|
||||
// Vertex program
|
||||
virtual bool isVertexProgramSupported () const;
|
||||
virtual bool isPixelProgramSupported () const;
|
||||
virtual bool isVertexProgramEmulated () const;
|
||||
virtual bool activeVertexProgram (CVertexProgram *program);
|
||||
virtual bool activePixelProgram (CPixelProgram *program);
|
||||
virtual void setConstant (uint index, float, float, float, float);
|
||||
virtual void setConstant (uint index, double, double, double, double);
|
||||
virtual void setConstant (uint index, const NLMISC::CVector& value);
|
||||
|
@ -1006,6 +1022,15 @@ public:
|
|||
virtual void enableVertexProgramDoubleSidedColor(bool doubleSided);
|
||||
virtual bool supportVertexProgramDoubleSidedColor() const;
|
||||
|
||||
// Pixel program
|
||||
virtual void setPixelProgramConstant (uint index, float, float, float, float);
|
||||
virtual void setPixelProgramConstant (uint index, double, double, double, double);
|
||||
virtual void setPixelProgramConstant (uint index, const NLMISC::CVector& value);
|
||||
virtual void setPixelProgramConstant (uint index, const NLMISC::CVectorD& value);
|
||||
virtual void setPixelProgramConstant (uint index, uint num, const float *src);
|
||||
virtual void setPixelProgramConstant (uint index, uint num, const double *src);
|
||||
virtual void setPixelProgramConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform);
|
||||
|
||||
// Occlusion query
|
||||
virtual bool supportOcclusionQuery() const;
|
||||
virtual IOcclusionQuery *createOcclusionQuery();
|
||||
|
@ -1892,6 +1917,15 @@ public:
|
|||
return d3dtex;
|
||||
}
|
||||
|
||||
// Get the d3dtext mirror of an existing setuped pixel program.
|
||||
static inline CPixelProgramDrvInfosD3D* getPixelProgramD3D(CPixelProgram& pixelProgram)
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_getPixelProgramD3D);
|
||||
CPixelProgramDrvInfosD3D* d3dPixelProgram;
|
||||
d3dPixelProgram = (CPixelProgramDrvInfosD3D*)(IPixelProgramDrvInfos*)(pixelProgram._DrvInfo);
|
||||
return d3dPixelProgram;
|
||||
}
|
||||
|
||||
// Get the d3dtext mirror of an existing setuped vertex program.
|
||||
static inline CVertexProgamDrvInfosD3D* getVertexProgramD3D(CVertexProgram& vertexProgram)
|
||||
{
|
||||
|
@ -2197,8 +2231,10 @@ private:
|
|||
bool _ForceDXTCCompression:1;
|
||||
bool _TextureCubeSupported;
|
||||
bool _VertexProgram;
|
||||
bool _PixelProgram;
|
||||
bool _PixelShader;
|
||||
bool _DisableHardwareVertexProgram;
|
||||
bool _DisableHardwarePixelProgram;
|
||||
bool _DisableHardwareVertexArrayAGP;
|
||||
bool _DisableHardwareIndexArrayAGP;
|
||||
bool _DisableHardwarePixelShader;
|
||||
|
|
|
@ -82,10 +82,11 @@ bool CDriverD3D::activePixelProgram(CPixelProgram *program)
|
|||
program->_DrvInfo = *itPix;
|
||||
|
||||
std::string dest;
|
||||
/* TODO_REMOVE
|
||||
if(program->isEffectProgram())
|
||||
{
|
||||
dest = program->getProgram();
|
||||
}
|
||||
}*/
|
||||
|
||||
LPD3DXBUFFER pShader;
|
||||
LPD3DXBUFFER pErrorMsgs;
|
||||
|
@ -289,17 +290,4 @@ void CDriverD3D::disableHardwarePixelProgram()
|
|||
_PixelProgram = false;
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
uint CDriverD3D::getMaxTexturesForEffects() const
|
||||
{
|
||||
H_AUTO_D3D(CDriverD3D_getMaxTexturesForEffects)
|
||||
|
||||
// we use ps_2_0 profile for direct3D ASM pixel program, then 16 texture samplers are available
|
||||
if(!strcmp(CPixelProgram::getPixelASMProfile(), "ps_2_0"))
|
||||
return 16;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // NL3D
|
||||
|
|
Loading…
Reference in a new issue