Add rest of the diff from the old nevrax code for pixel programs to NL3D

This commit is contained in:
kaetemi 2013-06-19 01:38:23 +02:00
parent 7da48d8866
commit cb966505cc
6 changed files with 20 additions and 0 deletions

View file

@ -133,6 +133,7 @@ public:
// @{
virtual void disableHardwareVertexProgram();
virtual void disableHardwarePixelProgram();
virtual void disableHardwareVertexArrayAGP();
virtual void disableHardwareTextureShader();

View file

@ -168,6 +168,7 @@ public:
*/
// @{
virtual void disableHardwareVertexProgram()=0;
virtual void disableHardwarePixelProgram()=0;
virtual void disableHardwareVertexArrayAGP()=0;
virtual void disableHardwareTextureShader()=0;
// @}

View file

@ -258,6 +258,11 @@ void IDriver::removeVtxPrgDrvInfoPtr(ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt)
{
_VtxPrgDrvInfos.erase(vtxPrgDrvInfoIt);
}
// ***************************************************************************
void IDriver::removePixelPrgDrvInfoPtr(ItPixelPrgDrvInfoPtrList pixelPrgDrvInfoIt)
{
_PixelPrgDrvInfos.erase(pixelPrgDrvInfoIt);
}
// ***************************************************************************
bool IDriver::invalidateShareTexture (ITexture &texture)

View file

@ -213,6 +213,12 @@ void CDriverUser::disableHardwareVertexProgram()
_Driver->disableHardwareVertexProgram();
}
void CDriverUser::disableHardwarePixelProgram()
{
NL3D_HAUTO_UI_DRIVER;
_Driver->disableHardwarePixelProgram();
}
void CDriverUser::disableHardwareVertexArrayAGP()
{
NL3D_HAUTO_UI_DRIVER;

View file

@ -363,6 +363,7 @@ void CFlareModel::traverseRender()
}
// setup driver
drv->activeVertexProgram(NULL);
drv->activePixelProgram(NULL);
drv->setupModelMatrix(fs->getLookAtMode() ? CMatrix::Identity : getWorldMatrix());
// we don't change the fustrum to draw 2d shapes : it is costly, and we need to restore it after the drawing has been done
// we setup Z to be (near + far) / 2, and setup x and y to get the screen coordinates we want
@ -565,6 +566,7 @@ void CFlareModel::updateOcclusionQueryBegin(IDriver *drv)
{
nlassert(drv);
drv->activeVertexProgram(NULL);
drv->activePixelProgram(NULL);
drv->setupModelMatrix(CMatrix::Identity);
initStatics();
drv->setColorMask(false, false, false, false); // don't write any pixel during the test
@ -661,6 +663,7 @@ void CFlareModel::occlusionTest(CMesh &mesh, IDriver &drv)
}
drv.setColorMask(false, false, false, false); // don't write any pixel during the test
drv.activeVertexProgram(NULL);
drv.activePixelProgram(NULL);
setupOcclusionMeshMatrix(drv, *_Scene);
drv.activeVertexBuffer(const_cast<CVertexBuffer &>(mesh.getVertexBuffer()));
// query drawn count

View file

@ -377,6 +377,9 @@ void CScene::endPartRender()
// Reset profiling
_NextRenderProfile= false;
IDriver *drv = getDriver();
drv->activeVertexProgram(NULL);
drv->activePixelProgram(NULL);
/*
uint64 total = PSStatsRegisterPSModelObserver +
@ -1561,6 +1564,7 @@ void CScene::renderOcclusionTestMeshs()
nlassert(RenderTrav.getDriver());
RenderTrav.getDriver()->setupViewport(RenderTrav.getViewport());
RenderTrav.getDriver()->activeVertexProgram(NULL);
RenderTrav.getDriver()->activePixelProgram(NULL);
IDriver::TPolygonMode oldPolygonMode = RenderTrav.getDriver()->getPolygonMode();
CMaterial m;
m.initUnlit();