Skip to content

Commit

Permalink
Merge pull request #104 from elishacloud/master
Browse files Browse the repository at this point in the history
  • Loading branch information
crosire authored Nov 29, 2019
2 parents 0afcc3e + 24fcdde commit e081ef4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/d3d8to9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::CreateImageSurface(UINT Width, UINT H

IDirect3DSurface9 *SurfaceInterface = nullptr;

const HRESULT hr = ProxyInterface->CreateOffscreenPlainSurface(Width, Height, Format, D3DPOOL_SYSTEMMEM, &SurfaceInterface, nullptr);
const HRESULT hr = ProxyInterface->CreateOffscreenPlainSurface(Width, Height, Format, D3DPOOL_SCRATCH, &SurfaceInterface, nullptr);

if (FAILED(hr))
{
Expand Down
10 changes: 2 additions & 8 deletions source/d3d8types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,12 @@ void ConvertPresentParameters(D3DPRESENT_PARAMETERS8 &Input, D3DPRESENT_PARAMETE
Output.FullScreen_RefreshRateInHz = Input.FullScreen_RefreshRateInHz;
Output.PresentationInterval = Input.FullScreen_PresentationInterval;

// MultiSampleType must be D3DMULTISAMPLE_NONE unless SwapEffect has been set to D3DSWAPEFFECT_DISCARD
if (Output.SwapEffect != D3DSWAPEFFECT_DISCARD)
// MultiSampleType must be D3DMULTISAMPLE_NONE unless SwapEffect has been set to D3DSWAPEFFECT_DISCARD or if there is a lockable backbuffer
if (Output.SwapEffect != D3DSWAPEFFECT_DISCARD || (Output.Flags & D3DPRESENTFLAG_LOCKABLE_BACKBUFFER))
{
Output.MultiSampleType = D3DMULTISAMPLE_NONE;
}

// Remove Flags that are not compatible with multisampling
if (Output.MultiSampleType != D3DMULTISAMPLE_NONE)
{
Output.Flags &= ~D3DPRESENTFLAG_LOCKABLE_BACKBUFFER;
}

// D3DPRESENT_RATE_UNLIMITED is no longer supported in D3D9
if (Output.PresentationInterval == D3DPRESENT_RATE_UNLIMITED)
{
Expand Down

0 comments on commit e081ef4

Please sign in to comment.