...
 
Commits (3)
......@@ -44,6 +44,9 @@ namespace dxup {
, m_stateBlock{ nullptr } {
m_renderer = new D3D9ImmediateRenderer{ device, context, m_state };
InitializeCriticalSection(&m_criticalSection);
if (!(behaviourFlags & D3DCREATE_FPU_PRESERVE))
setupFPUFlags();
}
HRESULT Direct3DDevice9Ex::CreateD3D11Device(UINT adapter, Direct3D9Ex* parent, ID3D11Device1** device, ID3D11DeviceContext1** context, IDXGIDevice1** dxgiDevice, IDXGIAdapter1** dxgiAdapter) {
......@@ -192,9 +195,6 @@ namespace dxup {
return log::d3derr(D3DERR_INVALIDCALL, "Reset: pPresentationParameters was nullptr.");
// Unbind current state...
SetVertexShader(nullptr);
SetPixelShader(nullptr);
SetDepthStencilSurface(nullptr);
for (uint32_t i = 0; i < 4; i++)
......@@ -1731,5 +1731,17 @@ namespace dxup {
ID3D11Device* Direct3DDevice9Ex::GetD3D11Device() {
return m_device.ptr();
}
void Direct3DDevice9Ex::setupFPUFlags() {
uint32_t currentWord = 0;
_controlfp_s(&currentWord, _MCW_EM, _MCW_EM); // mask exceptions
if (config::getBool(config::RespectPrecision)) {
_controlfp_s(&currentWord, _PC_24, _MCW_PC); // single precision
_controlfp_s(&currentWord, _RC_NEAR, _MCW_RC); // round to nearest
// TODO! Find out if we want to respect this by default.
}
}
}
\ No newline at end of file
......@@ -205,6 +205,7 @@ namespace dxup {
static HRESULT CreateD3D11Device(UINT adpater, Direct3D9Ex* parent, ID3D11Device1** device, ID3D11DeviceContext1** context, IDXGIDevice1** dxgiDevice, IDXGIAdapter1** adapter);
static void SetupD3D11Debug(ID3D11Device* device);
void setupFPUFlags();
Direct3DDevice9Ex(
UINT adapterNum,
......
......@@ -62,6 +62,7 @@ namespace dxup {
initVar(var::InitialHideCursor, "DXUP_INITIALHIDECURSOR", "0");
initVar(var::RefactoringAllowed, "DXUP_REFACTORINGALLOWED", "1");
initVar(var::GDICompatible, "DXUP_GDI_COMPATIBLE", "0");
initVar(var::RespectPrecision, "DXUP_RESPECT_PRECISION", "1");
initVar(var::RespectVSync, "DXUP_RESPECT_VSYNC", "1");
initVar(var::UseFakes, "DXUP_USEFAKES", "0");
......
......@@ -19,6 +19,7 @@ namespace dxup {
InitialHideCursor,
RefactoringAllowed,
GDICompatible,
RespectPrecision,
RespectVSync,
UseFakes,
......