diff options
author | Jens Peters <jp7677@gmail.com> | 2021-09-15 19:40:30 +0300 |
---|---|---|
committer | Jens Peters <jp7677@gmail.com> | 2021-09-15 19:40:30 +0300 |
commit | 745c2b07a8fb255a816d8dff7cfe6e769f9b2a06 (patch) | |
tree | 116474f6e253af9f1b631307d37165a8fac6acbb | |
parent | 0b0ba7ca06e1a91ec7d912c694484895b09748dd (diff) |
nvapi-d3d12: Improve readability
-rw-r--r-- | src/d3d12/nvapi_d3d12_device.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/d3d12/nvapi_d3d12_device.cpp b/src/d3d12/nvapi_d3d12_device.cpp index d940a06..514654c 100644 --- a/src/d3d12/nvapi_d3d12_device.cpp +++ b/src/d3d12/nvapi_d3d12_device.cpp @@ -60,15 +60,12 @@ namespace dxvk { // These are specific to NVIDIA and both of these extensions goes together. Com<ID3D12DeviceExt> NvapiD3d12Device::GetCubinDevice(ID3D12Device* device) { auto it = m_cubinDeviceMap.find(device); - Com<ID3D12DeviceExt> cubinDevice = nullptr; - if(it == m_cubinDeviceMap.end()) - { - cubinDevice = GetDeviceExt(device, D3D12_VK_NVX_BINARY_IMPORT); - if(cubinDevice != nullptr) - m_cubinDeviceMap.emplace(device, cubinDevice.ptr()); - } - else - cubinDevice = it->second; + if(it != m_cubinDeviceMap.end()) + return it->second; + + auto cubinDevice = GetDeviceExt(device, D3D12_VK_NVX_BINARY_IMPORT); + if(cubinDevice != nullptr) + m_cubinDeviceMap.emplace(device, cubinDevice.ptr()); return cubinDevice; } |