Misc: Fix new clang-cl warnings
This commit is contained in:
parent
854a8eb1bb
commit
d5e2db0dee
|
@ -386,7 +386,7 @@ public:
|
||||||
#undef RELATIONAL_OPERATOR
|
#undef RELATIONAL_OPERATOR
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void internal_resize(size_t size, T* prev_ptr, size_t prev_size)
|
void internal_resize(size_t size, T* prev_ptr, [[maybe_unused]] size_t prev_size)
|
||||||
{
|
{
|
||||||
if constexpr (alignment > 0)
|
if constexpr (alignment > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,7 @@ static void report_at_maximum_capacity(size_t MaxSize) {
|
||||||
|
|
||||||
// Note: Moving this function into the header may cause performance regression.
|
// Note: Moving this function into the header may cause performance regression.
|
||||||
template <class Size_T>
|
template <class Size_T>
|
||||||
static size_t getNewCapacity(size_t MinSize, size_t TSize, size_t OldCapacity) {
|
static size_t getNewCapacity(size_t MinSize, [[maybe_unused]] size_t TSize, size_t OldCapacity) {
|
||||||
constexpr size_t MaxSize = std::numeric_limits<Size_T>::max();
|
constexpr size_t MaxSize = std::numeric_limits<Size_T>::max();
|
||||||
|
|
||||||
// Ensure we can fit the new capacity.
|
// Ensure we can fit the new capacity.
|
||||||
|
|
|
@ -165,8 +165,12 @@ void DInputSource::Shutdown()
|
||||||
while (!m_controllers.empty())
|
while (!m_controllers.empty())
|
||||||
{
|
{
|
||||||
const u32 index = static_cast<u32>(m_controllers.size() - 1);
|
const u32 index = static_cast<u32>(m_controllers.size() - 1);
|
||||||
InputManager::OnInputDeviceDisconnected(
|
InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::DInput,
|
||||||
InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = index}},
|
.source_index = index,
|
||||||
|
.source_subtype = InputSubclass::None,
|
||||||
|
.modifier = InputModifier::None,
|
||||||
|
.invert = 0,
|
||||||
|
.data = 0}},
|
||||||
GetDeviceIdentifier(static_cast<u32>(m_controllers.size() - 1)));
|
GetDeviceIdentifier(static_cast<u32>(m_controllers.size() - 1)));
|
||||||
m_controllers.pop_back();
|
m_controllers.pop_back();
|
||||||
}
|
}
|
||||||
|
@ -270,8 +274,12 @@ void DInputSource::PollEvents()
|
||||||
|
|
||||||
if (hr != DI_OK)
|
if (hr != DI_OK)
|
||||||
{
|
{
|
||||||
InputManager::OnInputDeviceDisconnected(
|
InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::DInput,
|
||||||
InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = static_cast<u32>(i)}},
|
.source_index = static_cast<u32>(i),
|
||||||
|
.source_subtype = InputSubclass::None,
|
||||||
|
.modifier = InputModifier::None,
|
||||||
|
.invert = 0,
|
||||||
|
.data = 0}},
|
||||||
GetDeviceIdentifier(static_cast<u32>(i)));
|
GetDeviceIdentifier(static_cast<u32>(i)));
|
||||||
m_controllers.erase(m_controllers.begin() + i);
|
m_controllers.erase(m_controllers.begin() + i);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -1630,7 +1630,10 @@ bool GPUDevice::TranslateVulkanSpvToLanguage(const std::span<const u8> spirv, GP
|
||||||
const spvc_hlsl_resource_binding rb = {.stage = execmodel,
|
const spvc_hlsl_resource_binding rb = {.stage = execmodel,
|
||||||
.desc_set = UBO_DESCRIPTOR_SET,
|
.desc_set = UBO_DESCRIPTOR_SET,
|
||||||
.binding = 0,
|
.binding = 0,
|
||||||
.cbv = {.register_space = 0, .register_binding = 0}};
|
.cbv = {.register_space = 0, .register_binding = 0},
|
||||||
|
.uav = {},
|
||||||
|
.srv = {},
|
||||||
|
.sampler = {}};
|
||||||
if ((sres = dyn_libs::spvc_compiler_hlsl_add_resource_binding(scompiler, &rb)) != SPVC_SUCCESS)
|
if ((sres = dyn_libs::spvc_compiler_hlsl_add_resource_binding(scompiler, &rb)) != SPVC_SUCCESS)
|
||||||
{
|
{
|
||||||
Error::SetStringFmt(error, "spvc_compiler_hlsl_add_resource_binding() failed: {}", static_cast<int>(sres));
|
Error::SetStringFmt(error, "spvc_compiler_hlsl_add_resource_binding() failed: {}", static_cast<int>(sres));
|
||||||
|
@ -1645,6 +1648,8 @@ bool GPUDevice::TranslateVulkanSpvToLanguage(const std::span<const u8> spirv, GP
|
||||||
const spvc_hlsl_resource_binding rb = {.stage = execmodel,
|
const spvc_hlsl_resource_binding rb = {.stage = execmodel,
|
||||||
.desc_set = TEXTURE_DESCRIPTOR_SET,
|
.desc_set = TEXTURE_DESCRIPTOR_SET,
|
||||||
.binding = i,
|
.binding = i,
|
||||||
|
.cbv = {},
|
||||||
|
.uav = {},
|
||||||
.srv = {.register_space = 0, .register_binding = i},
|
.srv = {.register_space = 0, .register_binding = i},
|
||||||
.sampler = {.register_space = 0, .register_binding = i}};
|
.sampler = {.register_space = 0, .register_binding = i}};
|
||||||
if ((sres = dyn_libs::spvc_compiler_hlsl_add_resource_binding(scompiler, &rb)) != SPVC_SUCCESS)
|
if ((sres = dyn_libs::spvc_compiler_hlsl_add_resource_binding(scompiler, &rb)) != SPVC_SUCCESS)
|
||||||
|
|
|
@ -664,6 +664,8 @@ bool JPEGFileLoader(RGBA8Image* image, std::string_view filename, std::FILE* fp,
|
||||||
|
|
||||||
FileCallback cb = {
|
FileCallback cb = {
|
||||||
.mgr = {
|
.mgr = {
|
||||||
|
.next_input_byte = nullptr,
|
||||||
|
.bytes_in_buffer = 0,
|
||||||
.init_source = [](j_decompress_ptr cinfo) {},
|
.init_source = [](j_decompress_ptr cinfo) {},
|
||||||
.fill_input_buffer = [](j_decompress_ptr cinfo) -> boolean {
|
.fill_input_buffer = [](j_decompress_ptr cinfo) -> boolean {
|
||||||
FileCallback* cb = BASE_FROM_RECORD_FIELD(cinfo->src, FileCallback, mgr);
|
FileCallback* cb = BASE_FROM_RECORD_FIELD(cinfo->src, FileCallback, mgr);
|
||||||
|
@ -821,6 +823,8 @@ bool JPEGFileSaver(const RGBA8Image& image, std::string_view filename, std::FILE
|
||||||
|
|
||||||
FileCallback cb = {
|
FileCallback cb = {
|
||||||
.mgr = {
|
.mgr = {
|
||||||
|
.next_output_byte = nullptr,
|
||||||
|
.free_in_buffer = 0,
|
||||||
.init_destination =
|
.init_destination =
|
||||||
[](j_compress_ptr cinfo) {
|
[](j_compress_ptr cinfo) {
|
||||||
FileCallback* cb = BASE_FROM_RECORD_FIELD(cinfo->dest, FileCallback, mgr);
|
FileCallback* cb = BASE_FROM_RECORD_FIELD(cinfo->dest, FileCallback, mgr);
|
||||||
|
|
|
@ -72,7 +72,7 @@ union InputBindingKey
|
||||||
InputSubclass source_subtype : 3; ///< if 1, binding is for an axis and not a button (used for controllers)
|
InputSubclass source_subtype : 3; ///< if 1, binding is for an axis and not a button (used for controllers)
|
||||||
InputModifier modifier : 2;
|
InputModifier modifier : 2;
|
||||||
u32 invert : 1; ///< if 1, value is inverted prior to being sent to the sink
|
u32 invert : 1; ///< if 1, value is inverted prior to being sent to the sink
|
||||||
u32 unused : 14;
|
u32 : 14;
|
||||||
u32 data;
|
u32 data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1386,7 +1386,8 @@ bool MediaCaptureMF::SendFrame(const PendingFrame& pf, Error* error)
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD status;
|
DWORD status;
|
||||||
MFT_OUTPUT_DATA_BUFFER yuv_buf = {.pSample = m_video_yuv_sample.Get()};
|
MFT_OUTPUT_DATA_BUFFER yuv_buf = {
|
||||||
|
.dwStreamID = 0, .pSample = m_video_yuv_sample.Get(), .dwStatus = 0, .pEvents = nullptr};
|
||||||
hr = m_video_yuv_transform->ProcessOutput(0, 1, &yuv_buf, &status);
|
hr = m_video_yuv_transform->ProcessOutput(0, 1, &yuv_buf, &status);
|
||||||
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
|
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
|
||||||
break;
|
break;
|
||||||
|
@ -1453,7 +1454,8 @@ bool MediaCaptureMF::ProcessVideoOutputSamples(Error* error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MFT_OUTPUT_DATA_BUFFER video_buf = {.pSample = m_video_output_sample.Get()};
|
MFT_OUTPUT_DATA_BUFFER video_buf = {
|
||||||
|
.dwStreamID = 0, .pSample = m_video_output_sample.Get(), .dwStatus = 0, .pEvents = nullptr};
|
||||||
DWORD status;
|
DWORD status;
|
||||||
hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status);
|
hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status);
|
||||||
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
|
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)
|
||||||
|
@ -1570,7 +1572,8 @@ bool MediaCaptureMF::ProcessVideoEvents(Error* error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MFT_OUTPUT_DATA_BUFFER video_buf = {.pSample = m_video_output_sample.Get()};
|
MFT_OUTPUT_DATA_BUFFER video_buf = {
|
||||||
|
.dwStreamID = 0, .pSample = m_video_output_sample.Get(), .dwStatus = 0, .pEvents = nullptr};
|
||||||
DWORD status;
|
DWORD status;
|
||||||
if (FAILED(hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status))) [[unlikely]]
|
if (FAILED(hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status))) [[unlikely]]
|
||||||
{
|
{
|
||||||
|
@ -2883,7 +2886,8 @@ static constexpr const std::array<const char*, static_cast<size_t>(MediaCaptureB
|
||||||
"FFmpeg",
|
"FFmpeg",
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
static constexpr const std::array<const char*, static_cast<size_t>(MediaCaptureBackend::MaxCount)> s_backend_display_names = {
|
static constexpr const std::array<const char*, static_cast<size_t>(MediaCaptureBackend::MaxCount)>
|
||||||
|
s_backend_display_names = {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
TRANSLATE_DISAMBIG_NOOP("Settings", "Media Foundation", "MediaCaptureBackend"),
|
TRANSLATE_DISAMBIG_NOOP("Settings", "Media Foundation", "MediaCaptureBackend"),
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -826,8 +826,12 @@ bool SDLInputSource::CloseDevice(int joystick_index)
|
||||||
if (it == m_controllers.end())
|
if (it == m_controllers.end())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
InputManager::OnInputDeviceDisconnected(
|
InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::SDL,
|
||||||
InputBindingKey{{.source_type = InputSourceType::SDL, .source_index = static_cast<u32>(it->player_id)}},
|
.source_index = static_cast<u32>(it->player_id),
|
||||||
|
.source_subtype = InputSubclass::None,
|
||||||
|
.modifier = InputModifier::None,
|
||||||
|
.invert = 0,
|
||||||
|
.data = 0}},
|
||||||
fmt::format("SDL-{}", it->player_id));
|
fmt::format("SDL-{}", it->player_id));
|
||||||
|
|
||||||
if (it->haptic)
|
if (it->haptic)
|
||||||
|
|
|
@ -89,6 +89,9 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic
|
||||||
if (m_window_info.type == WindowInfo::Type::Win32)
|
if (m_window_info.type == WindowInfo::Type::Win32)
|
||||||
{
|
{
|
||||||
const VkWin32SurfaceCreateInfoKHR surface_create_info = {.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
|
const VkWin32SurfaceCreateInfoKHR surface_create_info = {.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
|
.hinstance = NULL,
|
||||||
.hwnd = static_cast<HWND>(m_window_info.window_handle)};
|
.hwnd = static_cast<HWND>(m_window_info.window_handle)};
|
||||||
const VkResult res = vkCreateWin32SurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
const VkResult res = vkCreateWin32SurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
||||||
if (res != VK_SUCCESS)
|
if (res != VK_SUCCESS)
|
||||||
|
@ -109,6 +112,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const VkMetalSurfaceCreateInfoEXT surface_create_info = {.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT,
|
const VkMetalSurfaceCreateInfoEXT surface_create_info = {.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
.pLayer = static_cast<const CAMetalLayer*>(m_metal_layer)};
|
.pLayer = static_cast<const CAMetalLayer*>(m_metal_layer)};
|
||||||
const VkResult res = vkCreateMetalSurfaceEXT(instance, &surface_create_info, nullptr, &m_surface);
|
const VkResult res = vkCreateMetalSurfaceEXT(instance, &surface_create_info, nullptr, &m_surface);
|
||||||
if (res != VK_SUCCESS)
|
if (res != VK_SUCCESS)
|
||||||
|
@ -126,6 +131,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic
|
||||||
{
|
{
|
||||||
const VkAndroidSurfaceCreateInfoKHR surface_create_info = {
|
const VkAndroidSurfaceCreateInfoKHR surface_create_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
.window = static_cast<ANativeWindow*>(m_window_info.window_handle)};
|
.window = static_cast<ANativeWindow*>(m_window_info.window_handle)};
|
||||||
const VkResult res = vkCreateAndroidSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
const VkResult res = vkCreateAndroidSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
||||||
if (res != VK_SUCCESS)
|
if (res != VK_SUCCESS)
|
||||||
|
@ -143,6 +150,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic
|
||||||
{
|
{
|
||||||
const VkXcbSurfaceCreateInfoKHR surface_create_info = {
|
const VkXcbSurfaceCreateInfoKHR surface_create_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
.connection = static_cast<xcb_connection_t*>(m_window_info.display_connection),
|
.connection = static_cast<xcb_connection_t*>(m_window_info.display_connection),
|
||||||
.window = static_cast<xcb_window_t>(reinterpret_cast<uintptr_t>(m_window_info.window_handle))};
|
.window = static_cast<xcb_window_t>(reinterpret_cast<uintptr_t>(m_window_info.window_handle))};
|
||||||
const VkResult res = vkCreateXcbSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
const VkResult res = vkCreateXcbSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
||||||
|
@ -160,9 +169,11 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic
|
||||||
if (m_window_info.type == WindowInfo::Type::Wayland)
|
if (m_window_info.type == WindowInfo::Type::Wayland)
|
||||||
{
|
{
|
||||||
const VkWaylandSurfaceCreateInfoKHR surface_create_info = {
|
const VkWaylandSurfaceCreateInfoKHR surface_create_info = {
|
||||||
VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, nullptr, 0,
|
.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR,
|
||||||
static_cast<struct wl_display*>(m_window_info.display_connection),
|
.pNext = nullptr,
|
||||||
static_cast<struct wl_surface*>(m_window_info.window_handle)};
|
.flags = 0,
|
||||||
|
.display = static_cast<struct wl_display*>(m_window_info.display_connection),
|
||||||
|
.surface = static_cast<struct wl_surface*>(m_window_info.window_handle)};
|
||||||
VkResult res = vkCreateWaylandSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
VkResult res = vkCreateWaylandSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface);
|
||||||
if (res != VK_SUCCESS)
|
if (res != VK_SUCCESS)
|
||||||
{
|
{
|
||||||
|
@ -403,6 +414,8 @@ bool VulkanSwapChain::CreateSwapChain(VulkanDevice& dev, Error* error)
|
||||||
|
|
||||||
// Now we can actually create the swap chain
|
// Now we can actually create the swap chain
|
||||||
VkSwapchainCreateInfoKHR swap_chain_info = {.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
|
VkSwapchainCreateInfoKHR swap_chain_info = {.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
.surface = m_surface,
|
.surface = m_surface,
|
||||||
.minImageCount = image_count,
|
.minImageCount = image_count,
|
||||||
.imageFormat = surface_format->format,
|
.imageFormat = surface_format->format,
|
||||||
|
@ -411,6 +424,8 @@ bool VulkanSwapChain::CreateSwapChain(VulkanDevice& dev, Error* error)
|
||||||
.imageArrayLayers = 1u,
|
.imageArrayLayers = 1u,
|
||||||
.imageUsage = image_usage,
|
.imageUsage = image_usage,
|
||||||
.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||||
|
.queueFamilyIndexCount = 0,
|
||||||
|
.pQueueFamilyIndices = nullptr,
|
||||||
.preTransform = transform,
|
.preTransform = transform,
|
||||||
.compositeAlpha = alpha,
|
.compositeAlpha = alpha,
|
||||||
.presentMode = present_mode.value(),
|
.presentMode = present_mode.value(),
|
||||||
|
@ -529,6 +544,8 @@ bool VulkanSwapChain::CreateSwapChainImages(VulkanDevice& dev, Error* error)
|
||||||
|
|
||||||
const VkImageViewCreateInfo view_info = {
|
const VkImageViewCreateInfo view_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||||
|
.pNext = nullptr,
|
||||||
|
.flags = 0,
|
||||||
.image = images[i],
|
.image = images[i],
|
||||||
.viewType = VK_IMAGE_VIEW_TYPE_2D,
|
.viewType = VK_IMAGE_VIEW_TYPE_2D,
|
||||||
.format = VulkanDevice::TEXTURE_FORMAT_MAPPING[static_cast<u8>(m_window_info.surface_format)],
|
.format = VulkanDevice::TEXTURE_FORMAT_MAPPING[static_cast<u8>(m_window_info.surface_format)],
|
||||||
|
@ -734,6 +751,7 @@ void VulkanSwapChain::ReleaseCurrentImage()
|
||||||
VulkanDevice::GetInstance().WaitForGPUIdle();
|
VulkanDevice::GetInstance().WaitForGPUIdle();
|
||||||
|
|
||||||
const VkReleaseSwapchainImagesInfoEXT info = {.sType = VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT,
|
const VkReleaseSwapchainImagesInfoEXT info = {.sType = VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT,
|
||||||
|
.pNext = nullptr,
|
||||||
.swapchain = m_swap_chain,
|
.swapchain = m_swap_chain,
|
||||||
.imageIndexCount = 1,
|
.imageIndexCount = 1,
|
||||||
.pImageIndices = &m_current_image};
|
.pImageIndices = &m_current_image};
|
||||||
|
|
|
@ -236,6 +236,7 @@ bool Win32RawInputSource::OpenDevices()
|
||||||
RID_DEVICE_INFO devinfo = {
|
RID_DEVICE_INFO devinfo = {
|
||||||
.cbSize = sizeof(devinfo),
|
.cbSize = sizeof(devinfo),
|
||||||
.dwType = RIM_TYPEMOUSE,
|
.dwType = RIM_TYPEMOUSE,
|
||||||
|
.mouse = {},
|
||||||
};
|
};
|
||||||
UINT devinfo_size = sizeof(devinfo);
|
UINT devinfo_size = sizeof(devinfo);
|
||||||
if (GetRawInputDeviceInfoW(rid.hDevice, RIDI_DEVICEINFO, &devinfo, &devinfo_size) <= 0 ||
|
if (GetRawInputDeviceInfoW(rid.hDevice, RIDI_DEVICEINFO, &devinfo, &devinfo_size) <= 0 ||
|
||||||
|
|
|
@ -66,7 +66,8 @@ static std::optional<float> GetRefreshRateFromDisplayConfig(HWND hwnd, Error* er
|
||||||
DISPLAYCONFIG_SOURCE_DEVICE_NAME sdn = {.header = {.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME,
|
DISPLAYCONFIG_SOURCE_DEVICE_NAME sdn = {.header = {.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME,
|
||||||
.size = sizeof(DISPLAYCONFIG_SOURCE_DEVICE_NAME),
|
.size = sizeof(DISPLAYCONFIG_SOURCE_DEVICE_NAME),
|
||||||
.adapterId = pi.sourceInfo.adapterId,
|
.adapterId = pi.sourceInfo.adapterId,
|
||||||
.id = pi.sourceInfo.id}};
|
.id = pi.sourceInfo.id},
|
||||||
|
.viewGdiDeviceName = {}};
|
||||||
LONG res = DisplayConfigGetDeviceInfo(&sdn.header);
|
LONG res = DisplayConfigGetDeviceInfo(&sdn.header);
|
||||||
if (res != ERROR_SUCCESS)
|
if (res != ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
|
|
|
@ -444,10 +444,12 @@ void XInputSource::HandleControllerDisconnection(u32 index)
|
||||||
{
|
{
|
||||||
INFO_LOG("XInput controller {} disconnected.", index);
|
INFO_LOG("XInput controller {} disconnected.", index);
|
||||||
|
|
||||||
InputManager::OnInputDeviceDisconnected({{
|
InputManager::OnInputDeviceDisconnected({{.source_type = InputSourceType::XInput,
|
||||||
.source_type = InputSourceType::XInput,
|
|
||||||
.source_index = index,
|
.source_index = index,
|
||||||
}},
|
.source_subtype = InputSubclass::None,
|
||||||
|
.modifier = InputModifier::None,
|
||||||
|
.invert = 0,
|
||||||
|
.data = 0}},
|
||||||
fmt::format("XInput-{}", index));
|
fmt::format("XInput-{}", index));
|
||||||
m_controllers[index] = {};
|
m_controllers[index] = {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue