Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pool type in CreateOffscreenPlainSurface() #104

Merged
merged 2 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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