From fa1b2d87b157fb827f0cfde0a13e8ebda04e4165 Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Sat, 8 Nov 2014 00:50:25 +0100 Subject: [PATCH 1/2] Fix PrimBuild with non Fixed Function Pipeline. --- Engine/source/gfx/gfxDevice.h | 2 ++ Engine/source/gfx/primBuilder.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/Engine/source/gfx/gfxDevice.h b/Engine/source/gfx/gfxDevice.h index 13620755e..09a8ea1c9 100644 --- a/Engine/source/gfx/gfxDevice.h +++ b/Engine/source/gfx/gfxDevice.h @@ -868,6 +868,8 @@ public: /// Sets the current stateblock (actually activated in ::updateStates) virtual void setStateBlock( GFXStateBlock *block ); + GFXStateBlock* getStateBlock() { return mNewStateBlock; } + /// This sets a stateblock directly from the description /// structure. Its acceptable to use this for debug rendering /// and other low frequency rendering tasks. diff --git a/Engine/source/gfx/primBuilder.cpp b/Engine/source/gfx/primBuilder.cpp index 42ac2d495..52c5bcc59 100644 --- a/Engine/source/gfx/primBuilder.cpp +++ b/Engine/source/gfx/primBuilder.cpp @@ -180,7 +180,18 @@ void end( bool useGenericShaders ) } if ( useGenericShaders ) + { + GFXStateBlock *currentBlock = GFX->getStateBlock(); + if (currentBlock && currentBlock->getDesc().samplersDefined) + { + if (currentBlock->getDesc().vertexColorEnable) GFX->setupGenericShaders( GFXDevice::GSModColorTexture ); + else + GFX->setupGenericShaders( GFXDevice::GSTexture ); + } + else + GFX->setupGenericShaders( GFXDevice::GSColor ); + } const GFXVertexPCT *srcVerts = mTempVertBuff.address(); U32 numVerts = mCurVertIndex; From a7434635cb7948d08bf3b9e98adc5bfbfa5184f3 Mon Sep 17 00:00:00 2001 From: LuisAntonRebollo Date: Tue, 25 Nov 2014 22:43:22 +0100 Subject: [PATCH 2/2] Fix TAB vs Spaces on Engine/source/gfx/primBuilder.cpp --- Engine/source/gfx/primBuilder.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Engine/source/gfx/primBuilder.cpp b/Engine/source/gfx/primBuilder.cpp index 52c5bcc59..af33d3a41 100644 --- a/Engine/source/gfx/primBuilder.cpp +++ b/Engine/source/gfx/primBuilder.cpp @@ -179,19 +179,19 @@ void end( bool useGenericShaders ) } } - if ( useGenericShaders ) - { - GFXStateBlock *currentBlock = GFX->getStateBlock(); - if (currentBlock && currentBlock->getDesc().samplersDefined) - { - if (currentBlock->getDesc().vertexColorEnable) - GFX->setupGenericShaders( GFXDevice::GSModColorTexture ); - else - GFX->setupGenericShaders( GFXDevice::GSTexture ); - } - else - GFX->setupGenericShaders( GFXDevice::GSColor ); - } + if ( useGenericShaders ) + { + GFXStateBlock *currentBlock = GFX->getStateBlock(); + if (currentBlock && currentBlock->getDesc().samplersDefined) + { + if (currentBlock->getDesc().vertexColorEnable) + GFX->setupGenericShaders( GFXDevice::GSModColorTexture ); + else + GFX->setupGenericShaders( GFXDevice::GSTexture ); + } + else + GFX->setupGenericShaders( GFXDevice::GSColor ); + } const GFXVertexPCT *srcVerts = mTempVertBuff.address(); U32 numVerts = mCurVertIndex;