mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-26 23:05:38 +00:00
commit
908be4818f
112 changed files with 2645 additions and 680 deletions
|
|
@ -87,9 +87,11 @@ void GFXD3D9CardProfiler::setupCardCapabilities()
|
|||
bool canDoFourStageDetailBlend = ( caps.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT ) &&
|
||||
( caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP ) &&
|
||||
( caps.MaxTextureBlendStages > 3 );
|
||||
bool canDoIndependentMrtBitDepth = (caps.PrimitiveMiscCaps & D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS ? 1 : 0 );
|
||||
|
||||
setCapability( "lerpDetailBlend", canDoLERPDetailBlend );
|
||||
setCapability( "fourStageDetailBlend", canDoFourStageDetailBlend );
|
||||
setCapability( "independentMrtBitDepth", canDoIndependentMrtBitDepth);
|
||||
}
|
||||
|
||||
bool GFXD3D9CardProfiler::_queryCardCap(const String &query, U32 &foundResult)
|
||||
|
|
|
|||
|
|
@ -31,6 +31,9 @@
|
|||
#include "gfx/gfxDebugEvent.h"
|
||||
#include "windowManager/win32/win32Window.h"
|
||||
|
||||
#ifndef _GFXDEVICE_H_
|
||||
#include "gfx/gfxDevice.h"
|
||||
#endif
|
||||
|
||||
GFXPCD3D9TextureTarget::GFXPCD3D9TextureTarget()
|
||||
: mTargetSize( Point2I::Zero ),
|
||||
|
|
@ -451,6 +454,7 @@ void GFXPCD3D9WindowTarget::createAdditionalSwapChain()
|
|||
|
||||
void GFXPCD3D9WindowTarget::resetMode()
|
||||
{
|
||||
GFX->beginReset();
|
||||
mWindow->setSuppressReset(true);
|
||||
|
||||
if (mSwapChain)
|
||||
|
|
@ -509,6 +513,7 @@ void GFXPCD3D9WindowTarget::zombify()
|
|||
|
||||
void GFXPCD3D9WindowTarget::resurrect()
|
||||
{
|
||||
GFX->beginReset();
|
||||
if(mImplicit)
|
||||
{
|
||||
setImplicitSwapChain();
|
||||
|
|
|
|||
|
|
@ -302,6 +302,7 @@ protected:
|
|||
/// This will allow querying to see if a device is initialized and ready to
|
||||
/// have operations performed on it.
|
||||
bool mInitialized;
|
||||
bool mReset;
|
||||
|
||||
/// This is called before this, or any other device, is deleted in the global destroy()
|
||||
/// method. It allows the device to clean up anything while everything is still valid.
|
||||
|
|
@ -326,6 +327,10 @@ public:
|
|||
/// @see endScene
|
||||
bool canCurrentlyRender() const { return mCanCurrentlyRender; }
|
||||
|
||||
bool recentlyReset(){ return mReset; }
|
||||
void beginReset(){ mReset = true; }
|
||||
void finalizeReset(){ mReset = false; }
|
||||
|
||||
void setAllowRender( bool render ) { mAllowRender = render; }
|
||||
|
||||
inline bool allowRender() const { return mAllowRender; }
|
||||
|
|
|
|||
|
|
@ -107,6 +107,14 @@ void GFXGLStateBlock::activate(const GFXGLStateBlock* oldState)
|
|||
if(STATE_CHANGE(blendOp))
|
||||
glBlendEquation(GFXGLBlendOp[mDesc.blendOp]);
|
||||
|
||||
if (mDesc.separateAlphaBlendEnable == true)
|
||||
{
|
||||
if (STATE_CHANGE(separateAlphaBlendSrc) || STATE_CHANGE(separateAlphaBlendDest))
|
||||
glBlendFuncSeparate(GFXGLBlend[mDesc.blendSrc], GFXGLBlend[mDesc.blendDest], GFXGLBlend[mDesc.separateAlphaBlendSrc], GFXGLBlend[mDesc.separateAlphaBlendDest]);
|
||||
if (STATE_CHANGE(separateAlphaBlendOp))
|
||||
glBlendEquationSeparate(GFXGLBlendOp[mDesc.blendOp], GFXGLBlendOp[mDesc.separateAlphaBlendOp]);
|
||||
}
|
||||
|
||||
// Color write masks
|
||||
if(STATE_CHANGE(colorWriteRed) || STATE_CHANGE(colorWriteBlue) || STATE_CHANGE(colorWriteGreen) || STATE_CHANGE(colorWriteAlpha))
|
||||
glColorMask(mDesc.colorWriteRed, mDesc.colorWriteBlue, mDesc.colorWriteGreen, mDesc.colorWriteAlpha);
|
||||
|
|
|
|||
|
|
@ -163,6 +163,10 @@ void _GFXGLTextureTargetFBOImpl::applyState()
|
|||
PRESERVE_FRAMEBUFFER();
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
|
||||
|
||||
bool drawbufs[16];
|
||||
int bufsize = 0;
|
||||
for (int i = 0; i < 16; i++)
|
||||
drawbufs[i] = false;
|
||||
bool hasColor = false;
|
||||
for(int i = 0; i < GFXGL->getNumRenderTargets(); ++i)
|
||||
{
|
||||
|
|
@ -200,6 +204,20 @@ void _GFXGLTextureTargetFBOImpl::applyState()
|
|||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, 0, 0);
|
||||
}
|
||||
|
||||
GLenum *buf = new GLenum[bufsize];
|
||||
int count = 0;
|
||||
for (int i = 0; i < bufsize; i++)
|
||||
{
|
||||
if (drawbufs[i])
|
||||
{
|
||||
buf[count] = GL_COLOR_ATTACHMENT0 + i;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
glDrawBuffers(bufsize, buf);
|
||||
|
||||
delete[] buf;
|
||||
CHECK_FRAMEBUFFER_STATUS();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ void GFXGLWindowTarget::resetMode()
|
|||
_teardownCurrentMode();
|
||||
_setupNewMode();
|
||||
}
|
||||
GFX->beginReset();
|
||||
}
|
||||
|
||||
void GFXGLWindowTarget::_onAppSignal(WindowId wnd, S32 event)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue