Add diff from old nevrax pixel program code to IDriver, CEffect related code not included

This commit is contained in:
kaetemi 2013-06-19 01:20:51 +02:00
parent b5dfdbdd55
commit 9f6b60a920

View file

@ -30,6 +30,7 @@
#include "nel/3d/vertex_buffer.h" #include "nel/3d/vertex_buffer.h"
#include "nel/3d/index_buffer.h" #include "nel/3d/index_buffer.h"
#include "nel/3d/vertex_program.h" #include "nel/3d/vertex_program.h"
#include "nel/3d/pixel_program.h"
#include "nel/3d/material.h" #include "nel/3d/material.h"
#include "nel/misc/mutex.h" #include "nel/misc/mutex.h"
#include "nel/3d/primitive_profile.h" #include "nel/3d/primitive_profile.h"
@ -145,6 +146,7 @@ public:
protected: protected:
CSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos; CSynchronized<TTexDrvInfoPtrMap> _SyncTexDrvInfos;
CSynchronized<TEffectDrvInfoPtrMap> _SyncEffectDrvInfos;
TTexDrvSharePtrList _TexDrvShares; TTexDrvSharePtrList _TexDrvShares;
TMatDrvInfoPtrList _MatDrvInfos; TMatDrvInfoPtrList _MatDrvInfos;
@ -152,6 +154,7 @@ protected:
TIBDrvInfoPtrList _IBDrvInfos; TIBDrvInfoPtrList _IBDrvInfos;
TPolygonMode _PolygonMode; TPolygonMode _PolygonMode;
TVtxPrgDrvInfoPtrList _VtxPrgDrvInfos; TVtxPrgDrvInfoPtrList _VtxPrgDrvInfos;
TPixelPrgDrvInfoPtrList _PixelPrgDrvInfos;
TShaderDrvInfoPtrList _ShaderDrvInfos; TShaderDrvInfoPtrList _ShaderDrvInfos;
uint _ResetCounter; uint _ResetCounter;
@ -172,6 +175,7 @@ public:
*/ */
// @{ // @{
virtual void disableHardwareVertexProgram()=0; virtual void disableHardwareVertexProgram()=0;
virtual void disableHardwarePixelProgram()=0;
virtual void disableHardwareVertexArrayAGP()=0; virtual void disableHardwareVertexArrayAGP()=0;
virtual void disableHardwareTextureShader()=0; virtual void disableHardwareTextureShader()=0;
// @} // @}
@ -1009,6 +1013,11 @@ public:
*/ */
virtual bool isVertexProgramEmulated () const =0; virtual bool isVertexProgramEmulated () const =0;
/**
* Does the driver supports pixel programs ?
*/
virtual bool isPixelProgramSupported () const =0;
/** /**
@ -1021,7 +1030,16 @@ public:
virtual bool activeVertexProgram (CVertexProgram *program) =0; virtual bool activeVertexProgram (CVertexProgram *program) =0;
/** /**
* Setup constant values. * Activate / disactivate a pixel program
*
* \param program is a pointer on a pixel program. Can be NULL to disable the current pixel program.
*
* \return true if setup/unsetup successed, false else.
*/
virtual bool activePixelProgram (CPixelProgram *program) =0;
/**
* Setup vertex program constant values.
*/ */
virtual void setConstant (uint index, float, float, float, float) =0; virtual void setConstant (uint index, float, float, float, float) =0;
virtual void setConstant (uint index, double, double, double, double) =0; virtual void setConstant (uint index, double, double, double, double) =0;
@ -1032,6 +1050,31 @@ public:
/// setup several 4 double csts taken from the given tab /// setup several 4 double csts taken from the given tab
virtual void setConstant (uint index, uint num, const double *src) =0; virtual void setConstant (uint index, uint num, const double *src) =0;
/**
* Setup pixel program constant values.
*/
virtual void setPixelProgramConstant (uint index, float, float, float, float) =0;
virtual void setPixelProgramConstant (uint index, double, double, double, double) =0;
virtual void setPixelProgramConstant (uint index, const NLMISC::CVector& value) =0;
virtual void setPixelProgramConstant (uint index, const NLMISC::CVectorD& value) =0;
/// setup several 4 float csts taken from the given tab
virtual void setPixelProgramConstant (uint index, uint num, const float *src) =0;
/// setup several 4 double csts taken from the given tab
virtual void setPixelProgramConstant (uint index, uint num, const double *src) =0;
/**
* Setup constants with a current matrix.
*
* This call must be done after setFrustum(), setupViewMatrix() or setupModelMatrix() to get correct
* results.
*
* \param index is the base constant index where to store the matrix. This index must be a multiple of 4.
* \param matrix is the matrix id to store in the constants
* \param transform is the transformation to apply to the matrix before store it in the constants.
*
*/
virtual void setPixelProgramConstantMatrix (uint index, TMatrix matrix, TTransform transform) =0;
/** /**
* Setup constants with a current matrix. * Setup constants with a current matrix.
* *
@ -1251,6 +1294,9 @@ public:
virtual void stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) = 0; virtual void stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) = 0;
virtual void stencilMask(uint mask) = 0; virtual void stencilMask(uint mask) = 0;
// get the number of texture samplers available for pû•el programs
virtual uint getMaxTexturesForEffects() const = 0;
protected: protected:
friend class IVBDrvInfos; friend class IVBDrvInfos;
friend class IIBDrvInfos; friend class IIBDrvInfos;
@ -1258,6 +1304,7 @@ protected:
friend class ITextureDrvInfos; friend class ITextureDrvInfos;
friend class IMaterialDrvInfos; friend class IMaterialDrvInfos;
friend class IVertexProgramDrvInfos; friend class IVertexProgramDrvInfos;
friend class IPixelProgramDrvInfos;
friend class IShaderDrvInfos; friend class IShaderDrvInfos;
/// remove ptr from the lists in the driver. /// remove ptr from the lists in the driver.
@ -1268,6 +1315,7 @@ protected:
void removeMatDrvInfoPtr(ItMatDrvInfoPtrList shaderIt); void removeMatDrvInfoPtr(ItMatDrvInfoPtrList shaderIt);
void removeShaderDrvInfoPtr(ItShaderDrvInfoPtrList shaderIt); void removeShaderDrvInfoPtr(ItShaderDrvInfoPtrList shaderIt);
void removeVtxPrgDrvInfoPtr(ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt); void removeVtxPrgDrvInfoPtr(ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt);
void removePixelPrgDrvInfoPtr(ItPixelPrgDrvInfoPtrList pixelPrgDrvInfoIt);
private: private:
bool _StaticMemoryToVRAM; bool _StaticMemoryToVRAM;