2018-03-23 03:18:13 +01:00
|
|
|
#ifdef _WIN32
|
2017-02-05 20:54:24 +01:00
|
|
|
|
2020-10-04 23:24:14 +02:00
|
|
|
#include "Common/GPU/D3D9/D3D9StateCache.h"
|
2013-08-17 11:23:51 +02:00
|
|
|
|
2015-09-05 19:42:58 +02:00
|
|
|
DirectXState dxstate;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
2022-08-16 21:48:54 +02:00
|
|
|
LPDIRECT3DDEVICE9 pD3Ddevice9 = nullptr;
|
|
|
|
|
LPDIRECT3DDEVICE9EX pD3DdeviceEx9 = nullptr;
|
2017-02-05 20:46:26 +01:00
|
|
|
|
2015-09-05 19:42:58 +02:00
|
|
|
int DirectXState::state_count = 0;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
2015-09-05 19:42:58 +02:00
|
|
|
void DirectXState::Initialize() {
|
|
|
|
|
if (initialized)
|
|
|
|
|
return;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
|
|
|
|
Restore();
|
|
|
|
|
|
|
|
|
|
initialized = true;
|
|
|
|
|
}
|
|
|
|
|
|
2015-09-05 19:42:58 +02:00
|
|
|
void DirectXState::Restore() {
|
2013-08-17 11:23:51 +02:00
|
|
|
int count = 0;
|
2014-08-23 01:52:46 +02:00
|
|
|
|
2013-08-17 11:23:51 +02:00
|
|
|
blend.restore(); count++;
|
2014-09-21 12:01:49 -07:00
|
|
|
blendSeparate.restore(); count++;
|
2013-08-17 11:23:51 +02:00
|
|
|
blendEquation.restore(); count++;
|
|
|
|
|
blendFunc.restore(); count++;
|
|
|
|
|
blendColor.restore(); count++;
|
|
|
|
|
|
|
|
|
|
scissorTest.restore(); count++;
|
|
|
|
|
scissorRect.restore(); count++;
|
|
|
|
|
|
|
|
|
|
cullMode.restore(); count++;
|
2018-04-28 16:31:39 -07:00
|
|
|
shadeMode.restore(); count++;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
|
|
|
|
depthTest.restore(); count++;
|
|
|
|
|
depthFunc.restore(); count++;
|
|
|
|
|
depthWrite.restore(); count++;
|
|
|
|
|
|
|
|
|
|
colorMask.restore(); count++;
|
2014-08-23 01:52:46 +02:00
|
|
|
|
2015-11-12 14:47:43 +01:00
|
|
|
viewport.restore(); count++;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
2013-09-22 11:27:40 +02:00
|
|
|
alphaTest.restore(); count++;
|
|
|
|
|
alphaTestFunc.restore(); count++;
|
|
|
|
|
alphaTestRef.restore(); count++;
|
|
|
|
|
|
2013-08-17 11:23:51 +02:00
|
|
|
stencilTest.restore(); count++;
|
|
|
|
|
stencilOp.restore(); count++;
|
|
|
|
|
stencilFunc.restore(); count++;
|
2022-07-24 21:26:40 +02:00
|
|
|
stencilWriteMask.restore(); count++;
|
2013-08-17 11:23:51 +02:00
|
|
|
|
2014-08-23 01:52:46 +02:00
|
|
|
texMinFilter.restore(); count++;
|
|
|
|
|
texMagFilter.restore(); count++;
|
|
|
|
|
texMipFilter.restore(); count++;
|
2014-08-26 07:58:09 -07:00
|
|
|
texMipLodBias.restore(); count++;
|
2017-04-22 18:36:25 -07:00
|
|
|
texMaxMipLevel.restore(); count++;
|
2014-08-23 01:52:46 +02:00
|
|
|
texAddressU.restore(); count++;
|
|
|
|
|
texAddressV.restore(); count++;
|
2022-07-30 21:33:24 +02:00
|
|
|
texAddressW.restore(); count++;
|
2013-08-17 11:23:51 +02:00
|
|
|
}
|
|
|
|
|
|
2017-04-22 18:36:25 -07:00
|
|
|
#endif // _MSC_VER
|