From 3927378399de5c8ecf9f582e1b22e1a21c2f68b9 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 19 Jun 2013 01:20:51 +0200 Subject: [PATCH] Add diff from old nevrax pixel program code to IDriver, CEffect related code not included --HG-- branch : multipass-stereo --- code/nel/include/nel/3d/driver.h | 50 +++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/code/nel/include/nel/3d/driver.h b/code/nel/include/nel/3d/driver.h index d090d77da..b3b8a250f 100644 --- a/code/nel/include/nel/3d/driver.h +++ b/code/nel/include/nel/3d/driver.h @@ -30,6 +30,7 @@ #include "nel/3d/vertex_buffer.h" #include "nel/3d/index_buffer.h" #include "nel/3d/vertex_program.h" +#include "nel/3d/pixel_program.h" #include "nel/3d/material.h" #include "nel/misc/mutex.h" #include "nel/3d/primitive_profile.h" @@ -145,6 +146,7 @@ public: protected: CSynchronized _SyncTexDrvInfos; + CSynchronized _SyncEffectDrvInfos; TTexDrvSharePtrList _TexDrvShares; TMatDrvInfoPtrList _MatDrvInfos; @@ -152,6 +154,7 @@ protected: TIBDrvInfoPtrList _IBDrvInfos; TPolygonMode _PolygonMode; TVtxPrgDrvInfoPtrList _VtxPrgDrvInfos; + TPixelPrgDrvInfoPtrList _PixelPrgDrvInfos; TShaderDrvInfoPtrList _ShaderDrvInfos; uint _ResetCounter; @@ -172,6 +175,7 @@ public: */ // @{ virtual void disableHardwareVertexProgram()=0; + virtual void disableHardwarePixelProgram()=0; virtual void disableHardwareVertexArrayAGP()=0; virtual void disableHardwareTextureShader()=0; // @} @@ -1009,6 +1013,11 @@ public: */ 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; /** - * 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, double, double, double, double) =0; @@ -1031,7 +1049,32 @@ public: virtual void setConstant (uint index, uint num, const float *src) =0; /// setup several 4 double csts taken from the given tab 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. * @@ -1251,6 +1294,9 @@ public: virtual void stencilOp(TStencilOp fail, TStencilOp zfail, TStencilOp zpass) = 0; virtual void stencilMask(uint mask) = 0; + // get the number of texture samplers available for pû•el programs + virtual uint getMaxTexturesForEffects() const = 0; + protected: friend class IVBDrvInfos; friend class IIBDrvInfos; @@ -1258,6 +1304,7 @@ protected: friend class ITextureDrvInfos; friend class IMaterialDrvInfos; friend class IVertexProgramDrvInfos; + friend class IPixelProgramDrvInfos; friend class IShaderDrvInfos; /// remove ptr from the lists in the driver. @@ -1268,6 +1315,7 @@ protected: void removeMatDrvInfoPtr(ItMatDrvInfoPtrList shaderIt); void removeShaderDrvInfoPtr(ItShaderDrvInfoPtrList shaderIt); void removeVtxPrgDrvInfoPtr(ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt); + void removePixelPrgDrvInfoPtr(ItPixelPrgDrvInfoPtrList pixelPrgDrvInfoIt); private: bool _StaticMemoryToVRAM;