1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 10:24:10 +01:00

[d3d9] Make nullptr/oob checks in GetBackBuffer unlikely

This commit is contained in:
Joshua Ashton 2020-02-28 01:03:34 +00:00
parent 8cfca32c2a
commit e41640dcde

View File

@ -331,10 +331,10 @@ namespace dxvk {
UINT iBackBuffer,
D3DBACKBUFFER_TYPE Type,
IDirect3DSurface9** ppBackBuffer) {
if (ppBackBuffer == nullptr)
if (unlikely(ppBackBuffer == nullptr))
return D3DERR_INVALIDCALL;
if (iBackBuffer >= m_presentParams.BackBufferCount) {
if (unlikely(iBackBuffer >= m_presentParams.BackBufferCount)) {
Logger::err(str::format("D3D9: GetBackBuffer: Invalid back buffer index: ", iBackBuffer));
return D3DERR_INVALIDCALL;
}