mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Merge 58b3c14c23 into ed2fe134aa
This commit is contained in:
commit
6e136b7787
@ -6,6 +6,7 @@
|
||||
#ifdef _WIN32
|
||||
|
||||
// clang-format off
|
||||
#include <initguid.h>
|
||||
#include <Audioclient.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <functiondiscoverykeys_devpkey.h>
|
||||
@ -91,13 +92,13 @@ static void ForEachNamedDevice(const std::function<bool(ComPtr<IMMDevice>, std::
|
||||
ComPtr<IMMDeviceEnumerator> enumerator;
|
||||
|
||||
result = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(enumerator.GetAddressOf()));
|
||||
IID_PPV_ARGS(&enumerator));
|
||||
|
||||
if (!HandleWinAPI("Failed to create MMDeviceEnumerator", result))
|
||||
return;
|
||||
|
||||
ComPtr<IMMDeviceCollection> devices;
|
||||
result = enumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, devices.GetAddressOf());
|
||||
result = enumerator->EnumAudioEndpoints(eRender, DEVICE_STATE_ACTIVE, &devices);
|
||||
|
||||
if (!HandleWinAPI("Failed to get available devices", result))
|
||||
return;
|
||||
@ -108,13 +109,13 @@ static void ForEachNamedDevice(const std::function<bool(ComPtr<IMMDevice>, std::
|
||||
for (u32 i = 0; i < count; i++)
|
||||
{
|
||||
ComPtr<IMMDevice> device;
|
||||
devices->Item(i, device.GetAddressOf());
|
||||
devices->Item(i, &device);
|
||||
if (!HandleWinAPI("Failed to get device " + std::to_string(i), result))
|
||||
continue;
|
||||
|
||||
ComPtr<IPropertyStore> device_properties;
|
||||
|
||||
result = device->OpenPropertyStore(STGM_READ, device_properties.GetAddressOf());
|
||||
result = device->OpenPropertyStore(STGM_READ, &device_properties);
|
||||
|
||||
if (!HandleWinAPI("Failed to initialize IPropertyStore", result))
|
||||
continue;
|
||||
@ -158,9 +159,8 @@ ComPtr<IMMDevice> WASAPIStream::GetDeviceByName(std::string_view name)
|
||||
bool WASAPIStream::Init()
|
||||
{
|
||||
ASSERT(m_enumerator == nullptr);
|
||||
HRESULT const result =
|
||||
CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(m_enumerator.GetAddressOf()));
|
||||
HRESULT const result = CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr,
|
||||
CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&m_enumerator));
|
||||
|
||||
if (!HandleWinAPI("Failed to create MMDeviceEnumerator", result))
|
||||
return false;
|
||||
@ -178,7 +178,7 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
|
||||
if (Config::Get(Config::MAIN_WASAPI_DEVICE) == "default")
|
||||
{
|
||||
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf());
|
||||
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -189,7 +189,7 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
{
|
||||
ERROR_LOG_FMT(AUDIO, "Can't find device '{}', falling back to default",
|
||||
Config::Get(Config::MAIN_WASAPI_DEVICE));
|
||||
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, device.GetAddressOf());
|
||||
result = m_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, &device);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
// Show a friendly name in the log
|
||||
ComPtr<IPropertyStore> device_properties;
|
||||
|
||||
result = device->OpenPropertyStore(STGM_READ, device_properties.GetAddressOf());
|
||||
result = device->OpenPropertyStore(STGM_READ, &device_properties);
|
||||
|
||||
if (!HandleWinAPI("Failed to initialize IPropertyStore", result))
|
||||
return false;
|
||||
@ -212,8 +212,7 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
ComPtr<IAudioClient> audio_client;
|
||||
|
||||
// Get IAudioDevice
|
||||
result = device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, nullptr,
|
||||
reinterpret_cast<LPVOID*>(audio_client.GetAddressOf()));
|
||||
result = device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, nullptr, &audio_client);
|
||||
|
||||
if (!HandleWinAPI("Failed to activate IAudioClient", result))
|
||||
return false;
|
||||
@ -249,8 +248,8 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
return false;
|
||||
|
||||
// Get IAudioDevice
|
||||
result = device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, nullptr,
|
||||
reinterpret_cast<LPVOID*>(audio_client.ReleaseAndGetAddressOf()));
|
||||
result =
|
||||
device->Activate(__uuidof(IAudioClient), CLSCTX_INPROC_SERVER, nullptr, &audio_client);
|
||||
|
||||
if (!HandleWinAPI("Failed to reactivate IAudioClient", result))
|
||||
return false;
|
||||
@ -276,7 +275,7 @@ bool WASAPIStream::SetRunning(bool running)
|
||||
|
||||
ComPtr<IAudioRenderClient> audio_renderer;
|
||||
|
||||
result = audio_client->GetService(IID_PPV_ARGS(audio_renderer.GetAddressOf()));
|
||||
result = audio_client->GetService(IID_PPV_ARGS(&audio_renderer));
|
||||
|
||||
if (!HandleWinAPI("Failed to get IAudioRenderClient from IAudioClient", result))
|
||||
return false;
|
||||
|
||||
@ -64,7 +64,7 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
}
|
||||
|
||||
ComPtr<IDXGIAdapter> adapter;
|
||||
HRESULT hr = dxgi_factory->EnumAdapters(adapter_index, adapter.GetAddressOf());
|
||||
HRESULT hr = dxgi_factory->EnumAdapters(adapter_index, &adapter);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
WARN_LOG_FMT(VIDEO, "Adapter {} not found, using default: {}", adapter_index, DX11HRWrap(hr));
|
||||
@ -75,10 +75,10 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
// version of the DirectX SDK. If it does, simply fallback to a non-debug device.
|
||||
if (enable_debug_layer)
|
||||
{
|
||||
hr = d3d11_create_device(
|
||||
adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, D3D11_CREATE_DEVICE_DEBUG,
|
||||
s_supported_feature_levels.data(), static_cast<UINT>(s_supported_feature_levels.size()),
|
||||
D3D11_SDK_VERSION, device.GetAddressOf(), &feature_level, context.GetAddressOf());
|
||||
hr = d3d11_create_device(adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr,
|
||||
D3D11_CREATE_DEVICE_DEBUG, s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()),
|
||||
D3D11_SDK_VERSION, &device, &feature_level, &context);
|
||||
|
||||
// Debugbreak on D3D error
|
||||
if (SUCCEEDED(hr) && SUCCEEDED(hr = device.As(&s_debug)))
|
||||
@ -105,10 +105,10 @@ bool Create(u32 adapter_index, bool enable_debug_layer)
|
||||
|
||||
if (!enable_debug_layer || FAILED(hr))
|
||||
{
|
||||
hr = d3d11_create_device(
|
||||
adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0, s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()), D3D11_SDK_VERSION,
|
||||
device.GetAddressOf(), &feature_level, context.GetAddressOf());
|
||||
hr = d3d11_create_device(adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0,
|
||||
s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()),
|
||||
D3D11_SDK_VERSION, &device, &feature_level, &context);
|
||||
}
|
||||
|
||||
if (FAILED(hr))
|
||||
@ -181,7 +181,7 @@ std::vector<u32> GetAAModes(u32 adapter_index)
|
||||
return {};
|
||||
|
||||
ComPtr<IDXGIAdapter> adapter;
|
||||
temp_dxgi_factory->EnumAdapters(adapter_index, adapter.GetAddressOf());
|
||||
temp_dxgi_factory->EnumAdapters(adapter_index, &adapter);
|
||||
|
||||
PFN_D3D11_CREATE_DEVICE d3d11_create_device;
|
||||
if (!temp_lib.Open("d3d11.dll") ||
|
||||
@ -190,10 +190,10 @@ std::vector<u32> GetAAModes(u32 adapter_index)
|
||||
return {};
|
||||
}
|
||||
|
||||
HRESULT hr = d3d11_create_device(
|
||||
adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0, s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()), D3D11_SDK_VERSION,
|
||||
temp_device.GetAddressOf(), &temp_feature_level, nullptr);
|
||||
HRESULT hr = d3d11_create_device(adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0,
|
||||
s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()),
|
||||
D3D11_SDK_VERSION, &temp_device, &temp_feature_level, nullptr);
|
||||
if (FAILED(hr))
|
||||
return {};
|
||||
}
|
||||
@ -243,7 +243,7 @@ bool SupportsLogicOp(u32 adapter_index)
|
||||
return false;
|
||||
|
||||
ComPtr<IDXGIAdapter> adapter;
|
||||
temp_dxgi_factory->EnumAdapters(adapter_index, adapter.GetAddressOf());
|
||||
temp_dxgi_factory->EnumAdapters(adapter_index, &adapter);
|
||||
|
||||
PFN_D3D11_CREATE_DEVICE d3d11_create_device;
|
||||
if (!temp_lib.Open("d3d11.dll") ||
|
||||
@ -252,10 +252,10 @@ bool SupportsLogicOp(u32 adapter_index)
|
||||
return false;
|
||||
}
|
||||
|
||||
HRESULT hr = d3d11_create_device(
|
||||
adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0, s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()), D3D11_SDK_VERSION,
|
||||
temp_device.GetAddressOf(), nullptr, nullptr);
|
||||
HRESULT hr = d3d11_create_device(adapter.Get(), D3D_DRIVER_TYPE_UNKNOWN, nullptr, 0,
|
||||
s_supported_feature_levels.data(),
|
||||
static_cast<UINT>(s_supported_feature_levels.size()),
|
||||
D3D11_SDK_VERSION, &temp_device, nullptr, nullptr);
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
|
||||
@ -353,7 +353,7 @@ ID3D11SamplerState* StateCache::Get(SamplerState state)
|
||||
}
|
||||
|
||||
ComPtr<ID3D11SamplerState> res;
|
||||
HRESULT hr = D3D::device->CreateSamplerState(&sampdc, res.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateSamplerState(&sampdc, &res);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D sampler state failed: {}", DX11HRWrap(hr));
|
||||
return m_sampler.emplace(state, std::move(res)).first->second.Get();
|
||||
}
|
||||
@ -387,7 +387,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
|
||||
tdesc.LogicOp = logic_ops[u32(state.logic_mode.Value())];
|
||||
|
||||
ComPtr<ID3D11BlendState1> res;
|
||||
HRESULT hr = D3D::device1->CreateBlendState1(&desc, res.GetAddressOf());
|
||||
HRESULT hr = D3D::device1->CreateBlendState1(&desc, &res);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
return m_blend.emplace(state.hex, std::move(res)).first->second.Get();
|
||||
@ -430,7 +430,7 @@ ID3D11BlendState* StateCache::Get(BlendingState state)
|
||||
tdesc.BlendOpAlpha = state.subtract_alpha ? D3D11_BLEND_OP_REV_SUBTRACT : D3D11_BLEND_OP_ADD;
|
||||
|
||||
ComPtr<ID3D11BlendState> res;
|
||||
HRESULT hr = D3D::device->CreateBlendState(&desc, res.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateBlendState(&desc, &res);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D blend state failed: {}", DX11HRWrap(hr));
|
||||
return m_blend.emplace(state.hex, std::move(res)).first->second.Get();
|
||||
}
|
||||
@ -451,7 +451,7 @@ ID3D11RasterizerState* StateCache::Get(RasterizationState state)
|
||||
desc.ScissorEnable = TRUE;
|
||||
|
||||
ComPtr<ID3D11RasterizerState> res;
|
||||
HRESULT hr = D3D::device->CreateRasterizerState(&desc, res.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateRasterizerState(&desc, &res);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D rasterizer state failed: {}", DX11HRWrap(hr));
|
||||
return m_raster.emplace(state.hex, std::move(res)).first->second.Get();
|
||||
}
|
||||
@ -493,7 +493,7 @@ ID3D11DepthStencilState* StateCache::Get(DepthState state)
|
||||
}
|
||||
|
||||
ComPtr<ID3D11DepthStencilState> res;
|
||||
HRESULT hr = D3D::device->CreateDepthStencilState(&depthdc, res.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateDepthStencilState(&depthdc, &res);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Creating D3D depth stencil state failed: {}", DX11HRWrap(hr));
|
||||
return m_depth.emplace(state.hex, std::move(res)).first->second.Get();
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ std::unique_ptr<DXTexture> DXTexture::Create(const TextureConfig& config, std::s
|
||||
D3D11_USAGE_DEFAULT, 0, config.samples, 0,
|
||||
config.type == AbstractTextureType::Texture_CubeMap ? D3D11_RESOURCE_MISC_TEXTURECUBE : 0);
|
||||
ComPtr<ID3D11Texture2D> d3d_texture;
|
||||
HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, d3d_texture.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, &d3d_texture);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D backing texture: {}", config.width, config.height,
|
||||
@ -119,7 +119,7 @@ bool DXTexture::CreateSRV()
|
||||
m_texture.Get(), dimension, D3DCommon::GetSRVFormatForAbstractFormat(m_config.format), 0,
|
||||
m_config.levels, 0, m_config.layers);
|
||||
DEBUG_ASSERT(!m_srv);
|
||||
HRESULT hr = D3D::device->CreateShaderResourceView(m_texture.Get(), &desc, m_srv.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateShaderResourceView(m_texture.Get(), &desc, &m_srv);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D SRV: {}", m_config.width, m_config.height,
|
||||
@ -136,7 +136,7 @@ bool DXTexture::CreateUAV()
|
||||
m_texture.Get(), D3D11_UAV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3DCommon::GetSRVFormatForAbstractFormat(m_config.format), 0, 0, m_config.layers);
|
||||
DEBUG_ASSERT(!m_uav);
|
||||
HRESULT hr = D3D::device->CreateUnorderedAccessView(m_texture.Get(), &desc, m_uav.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateUnorderedAccessView(m_texture.Get(), &desc, &m_uav);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertFmt("Failed to create {}x{}x{} D3D UAV: {}", m_config.width, m_config.height,
|
||||
@ -233,7 +233,7 @@ std::unique_ptr<DXStagingTexture> DXStagingTexture::Create(StagingTextureType ty
|
||||
config.width, config.height, 1, 1, bind_flags, usage, cpu_flags);
|
||||
|
||||
ComPtr<ID3D11Texture2D> texture;
|
||||
HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, texture.GetAddressOf());
|
||||
HRESULT hr = D3D::device->CreateTexture2D(&desc, nullptr, &texture);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create staging texture: {}", DX11HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
return nullptr;
|
||||
@ -444,8 +444,8 @@ DXFramebuffer::Create(DXTexture* color_attachment, DXTexture* depth_attachment,
|
||||
D3D11_RTV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3DCommon::GetRTVFormatForAbstractFormat(color_attachment->GetFormat(), false), 0, 0,
|
||||
color_attachment->GetLayers());
|
||||
HRESULT hr = D3D::device->CreateRenderTargetView(color_attachment->GetD3DTexture(), &desc,
|
||||
rtv.GetAddressOf());
|
||||
HRESULT hr =
|
||||
D3D::device->CreateRenderTargetView(color_attachment->GetD3DTexture(), &desc, &rtv);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create render target view for framebuffer: {}",
|
||||
DX11HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
@ -458,7 +458,7 @@ DXFramebuffer::Create(DXTexture* color_attachment, DXTexture* depth_attachment,
|
||||
{
|
||||
desc.Format = integer_format;
|
||||
hr = D3D::device->CreateRenderTargetView(color_attachment->GetD3DTexture(), &desc,
|
||||
integer_rtv.GetAddressOf());
|
||||
&integer_rtv);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr),
|
||||
"Failed to create integer render target view for framebuffer: {}", DX11HRWrap(hr));
|
||||
}
|
||||
@ -475,7 +475,7 @@ DXFramebuffer::Create(DXTexture* color_attachment, DXTexture* depth_attachment,
|
||||
0, 0, 1);
|
||||
HRESULT hr = D3D::device->CreateRenderTargetView(
|
||||
static_cast<DXTexture*>(additional_color_attachment)->GetD3DTexture(), &desc,
|
||||
additional_rtv.GetAddressOf());
|
||||
&additional_rtv);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Create render target view for framebuffer: {}",
|
||||
DX11HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
@ -491,8 +491,8 @@ DXFramebuffer::Create(DXTexture* color_attachment, DXTexture* depth_attachment,
|
||||
D3D11_DSV_DIMENSION_TEXTURE2DARRAY,
|
||||
D3DCommon::GetDSVFormatForAbstractFormat(depth_attachment->GetFormat()), 0, 0,
|
||||
depth_attachment->GetLayers(), 0);
|
||||
HRESULT hr = D3D::device->CreateDepthStencilView(depth_attachment->GetD3DTexture(), &desc,
|
||||
dsv.GetAddressOf());
|
||||
HRESULT hr =
|
||||
D3D::device->CreateDepthStencilView(depth_attachment->GetD3DTexture(), &desc, &dsv);
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create depth stencil view for framebuffer: {}",
|
||||
DX11HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
|
||||
@ -447,14 +447,14 @@ bool DXContext::CreateCommandLists()
|
||||
for (u32 i = 0; i < NUM_COMMAND_LISTS; i++)
|
||||
{
|
||||
CommandListResources& res = m_command_lists[i];
|
||||
HRESULT hr = m_device->CreateCommandAllocator(
|
||||
D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(res.command_allocator.GetAddressOf()));
|
||||
HRESULT hr = m_device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||
IID_PPV_ARGS(&res.command_allocator));
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create command allocator: {}", DX12HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
return false;
|
||||
|
||||
hr = m_device->CreateCommandList(1, D3D12_COMMAND_LIST_TYPE_DIRECT, res.command_allocator.Get(),
|
||||
nullptr, IID_PPV_ARGS(res.command_list.GetAddressOf()));
|
||||
nullptr, IID_PPV_ARGS(&res.command_list));
|
||||
ASSERT_MSG(VIDEO, SUCCEEDED(hr), "Failed to create command list: {}", DX12HRWrap(hr));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
||||
@ -81,13 +81,13 @@ Microsoft::WRL::ComPtr<IDXGIFactory> CreateDXGIFactory(bool debug_device)
|
||||
// Use Win8.1 version if available.
|
||||
if (create_dxgi_factory2 &&
|
||||
SUCCEEDED(create_dxgi_factory2(debug_device ? DXGI_CREATE_FACTORY_DEBUG : 0,
|
||||
IID_PPV_ARGS(factory.GetAddressOf()))))
|
||||
IID_PPV_ARGS(&factory))))
|
||||
{
|
||||
return factory;
|
||||
}
|
||||
|
||||
// Fallback to original version, without debug support.
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(factory.ReleaseAndGetAddressOf()));
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(&factory));
|
||||
if (FAILED(hr))
|
||||
{
|
||||
PanicAlertFmt("CreateDXGIFactory() failed: {}", Common::HRWrap(hr));
|
||||
@ -100,14 +100,14 @@ Microsoft::WRL::ComPtr<IDXGIFactory> CreateDXGIFactory(bool debug_device)
|
||||
std::vector<std::string> GetAdapterNames()
|
||||
{
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory> factory;
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(factory.GetAddressOf()));
|
||||
HRESULT hr = create_dxgi_factory(IID_PPV_ARGS(&factory));
|
||||
if (FAILED(hr))
|
||||
return {};
|
||||
|
||||
std::vector<std::string> adapters;
|
||||
Microsoft::WRL::ComPtr<IDXGIAdapter> adapter;
|
||||
while (factory->EnumAdapters(static_cast<UINT>(adapters.size()),
|
||||
adapter.ReleaseAndGetAddressOf()) != DXGI_ERROR_NOT_FOUND)
|
||||
while (factory->EnumAdapters(static_cast<UINT>(adapters.size()), &adapter) !=
|
||||
DXGI_ERROR_NOT_FOUND)
|
||||
{
|
||||
std::string name;
|
||||
DXGI_ADAPTER_DESC desc;
|
||||
@ -297,12 +297,12 @@ void SetDebugObjectName(IUnknown* resource, std::string_view name)
|
||||
|
||||
Microsoft::WRL::ComPtr<ID3D11DeviceChild> child11;
|
||||
Microsoft::WRL::ComPtr<ID3D12DeviceChild> child12;
|
||||
if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(child11.GetAddressOf()))))
|
||||
if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child11))))
|
||||
{
|
||||
child11->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.length()),
|
||||
name.data());
|
||||
}
|
||||
else if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(child12.GetAddressOf()))))
|
||||
else if (SUCCEEDED(resource->QueryInterface(IID_PPV_ARGS(&child12))))
|
||||
{
|
||||
child12->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(name.length()),
|
||||
name.data());
|
||||
|
||||
@ -155,7 +155,7 @@ bool SwapChain::CreateSwapChain(bool stereo, bool hdr)
|
||||
// Only try to activate HDR here, to avoid failing when creating the swapchain
|
||||
// (we can't know if the format is supported upfront)
|
||||
Microsoft::WRL::ComPtr<IDXGISwapChain4> swap_chain4;
|
||||
hr = m_swap_chain->QueryInterface(IID_PPV_ARGS(&swap_chain4));
|
||||
hr = m_swap_chain.As(&swap_chain4);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
UINT color_space_support = 0;
|
||||
@ -214,7 +214,7 @@ bool SwapChain::ResizeSwapChain()
|
||||
WARN_LOG_FMT(VIDEO, "ResizeBuffers() failed: {}", Common::HRWrap(hr));
|
||||
|
||||
Microsoft::WRL::ComPtr<IDXGISwapChain4> swap_chain4;
|
||||
hr = m_swap_chain->QueryInterface(IID_PPV_ARGS(&swap_chain4));
|
||||
hr = m_swap_chain.As(&swap_chain4);
|
||||
if (SUCCEEDED(hr))
|
||||
hr = swap_chain4->SetColorSpace1(m_hdr ? DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 :
|
||||
DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709);
|
||||
|
||||
@ -78,7 +78,7 @@ bool InitWindow()
|
||||
return false;
|
||||
|
||||
if (SUCCEEDED(CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER,
|
||||
IID_PPV_ARGS(taskbar_list.GetAddressOf()))))
|
||||
IID_PPV_ARGS(&taskbar_list))))
|
||||
{
|
||||
if (FAILED(taskbar_list->HrInit()))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user