diff --git a/src/common/heap_array.h b/src/common/heap_array.h index cee348947..7e844a541 100644 --- a/src/common/heap_array.h +++ b/src/common/heap_array.h @@ -386,7 +386,7 @@ public: #undef RELATIONAL_OPERATOR 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) { diff --git a/src/common/thirdparty/SmallVector.cpp b/src/common/thirdparty/SmallVector.cpp index 822e8e4dc..d72e7c0cb 100644 --- a/src/common/thirdparty/SmallVector.cpp +++ b/src/common/thirdparty/SmallVector.cpp @@ -125,7 +125,7 @@ static void report_at_maximum_capacity(size_t MaxSize) { // Note: Moving this function into the header may cause performance regression. template -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::max(); // Ensure we can fit the new capacity. diff --git a/src/util/dinput_source.cpp b/src/util/dinput_source.cpp index 97e89b51f..0a3cba4f9 100644 --- a/src/util/dinput_source.cpp +++ b/src/util/dinput_source.cpp @@ -165,9 +165,13 @@ void DInputSource::Shutdown() while (!m_controllers.empty()) { const u32 index = static_cast(m_controllers.size() - 1); - InputManager::OnInputDeviceDisconnected( - InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = index}}, - GetDeviceIdentifier(static_cast(m_controllers.size() - 1))); + InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::DInput, + .source_index = index, + .source_subtype = InputSubclass::None, + .modifier = InputModifier::None, + .invert = 0, + .data = 0}}, + GetDeviceIdentifier(static_cast(m_controllers.size() - 1))); m_controllers.pop_back(); } } @@ -270,9 +274,13 @@ void DInputSource::PollEvents() if (hr != DI_OK) { - InputManager::OnInputDeviceDisconnected( - InputBindingKey{{.source_type = InputSourceType::DInput, .source_index = static_cast(i)}}, - GetDeviceIdentifier(static_cast(i))); + InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::DInput, + .source_index = static_cast(i), + .source_subtype = InputSubclass::None, + .modifier = InputModifier::None, + .invert = 0, + .data = 0}}, + GetDeviceIdentifier(static_cast(i))); m_controllers.erase(m_controllers.begin() + i); continue; } diff --git a/src/util/gpu_device.cpp b/src/util/gpu_device.cpp index b3b90af66..d9554289c 100644 --- a/src/util/gpu_device.cpp +++ b/src/util/gpu_device.cpp @@ -1630,7 +1630,10 @@ bool GPUDevice::TranslateVulkanSpvToLanguage(const std::span spirv, GP const spvc_hlsl_resource_binding rb = {.stage = execmodel, .desc_set = UBO_DESCRIPTOR_SET, .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) { Error::SetStringFmt(error, "spvc_compiler_hlsl_add_resource_binding() failed: {}", static_cast(sres)); @@ -1645,6 +1648,8 @@ bool GPUDevice::TranslateVulkanSpvToLanguage(const std::span spirv, GP const spvc_hlsl_resource_binding rb = {.stage = execmodel, .desc_set = TEXTURE_DESCRIPTOR_SET, .binding = i, + .cbv = {}, + .uav = {}, .srv = {.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) diff --git a/src/util/image.cpp b/src/util/image.cpp index 5524a8f47..9541d3bd7 100644 --- a/src/util/image.cpp +++ b/src/util/image.cpp @@ -664,6 +664,8 @@ bool JPEGFileLoader(RGBA8Image* image, std::string_view filename, std::FILE* fp, FileCallback cb = { .mgr = { + .next_input_byte = nullptr, + .bytes_in_buffer = 0, .init_source = [](j_decompress_ptr cinfo) {}, .fill_input_buffer = [](j_decompress_ptr cinfo) -> boolean { 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 = { .mgr = { + .next_output_byte = nullptr, + .free_in_buffer = 0, .init_destination = [](j_compress_ptr cinfo) { FileCallback* cb = BASE_FROM_RECORD_FIELD(cinfo->dest, FileCallback, mgr); diff --git a/src/util/input_manager.h b/src/util/input_manager.h index 034ea6957..61d8ef2a5 100644 --- a/src/util/input_manager.h +++ b/src/util/input_manager.h @@ -72,7 +72,7 @@ union InputBindingKey InputSubclass source_subtype : 3; ///< if 1, binding is for an axis and not a button (used for controllers) InputModifier modifier : 2; u32 invert : 1; ///< if 1, value is inverted prior to being sent to the sink - u32 unused : 14; + u32 : 14; u32 data; }; diff --git a/src/util/media_capture.cpp b/src/util/media_capture.cpp index 48d6f6833..c757f3c37 100644 --- a/src/util/media_capture.cpp +++ b/src/util/media_capture.cpp @@ -1386,7 +1386,8 @@ bool MediaCaptureMF::SendFrame(const PendingFrame& pf, Error* error) } 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); if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) 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; hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status); 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; if (FAILED(hr = m_video_encode_transform->ProcessOutput(0, 1, &video_buf, &status))) [[unlikely]] { @@ -2883,12 +2886,13 @@ static constexpr const std::array(MediaCaptureB "FFmpeg", #endif }; -static constexpr const std::array(MediaCaptureBackend::MaxCount)> s_backend_display_names = { +static constexpr const std::array(MediaCaptureBackend::MaxCount)> + s_backend_display_names = { #ifdef _WIN32 - TRANSLATE_DISAMBIG_NOOP("Settings", "Media Foundation", "MediaCaptureBackend"), + TRANSLATE_DISAMBIG_NOOP("Settings", "Media Foundation", "MediaCaptureBackend"), #endif #ifndef __ANDROID__ - TRANSLATE_DISAMBIG_NOOP("Settings", "FFmpeg", "MediaCaptureBackend"), + TRANSLATE_DISAMBIG_NOOP("Settings", "FFmpeg", "MediaCaptureBackend"), #endif }; static_assert(s_backend_names.size() == static_cast(MediaCaptureBackend::MaxCount)); diff --git a/src/util/sdl_input_source.cpp b/src/util/sdl_input_source.cpp index 484f41f49..7ae97599c 100644 --- a/src/util/sdl_input_source.cpp +++ b/src/util/sdl_input_source.cpp @@ -826,9 +826,13 @@ bool SDLInputSource::CloseDevice(int joystick_index) if (it == m_controllers.end()) return false; - InputManager::OnInputDeviceDisconnected( - InputBindingKey{{.source_type = InputSourceType::SDL, .source_index = static_cast(it->player_id)}}, - fmt::format("SDL-{}", it->player_id)); + InputManager::OnInputDeviceDisconnected(InputBindingKey{{.source_type = InputSourceType::SDL, + .source_index = static_cast(it->player_id), + .source_subtype = InputSubclass::None, + .modifier = InputModifier::None, + .invert = 0, + .data = 0}}, + fmt::format("SDL-{}", it->player_id)); if (it->haptic) SDL_HapticClose(it->haptic); diff --git a/src/util/vulkan_swap_chain.cpp b/src/util/vulkan_swap_chain.cpp index 74d84c833..3ba8ec3f3 100644 --- a/src/util/vulkan_swap_chain.cpp +++ b/src/util/vulkan_swap_chain.cpp @@ -89,6 +89,9 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic if (m_window_info.type == WindowInfo::Type::Win32) { const VkWin32SurfaceCreateInfoKHR surface_create_info = {.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, + .hinstance = NULL, .hwnd = static_cast(m_window_info.window_handle)}; const VkResult res = vkCreateWin32SurfaceKHR(instance, &surface_create_info, nullptr, &m_surface); if (res != VK_SUCCESS) @@ -109,6 +112,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic return false; const VkMetalSurfaceCreateInfoEXT surface_create_info = {.sType = VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT, + .pNext = nullptr, + .flags = 0, .pLayer = static_cast(m_metal_layer)}; const VkResult res = vkCreateMetalSurfaceEXT(instance, &surface_create_info, nullptr, &m_surface); if (res != VK_SUCCESS) @@ -126,6 +131,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic { const VkAndroidSurfaceCreateInfoKHR surface_create_info = { .sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, .window = static_cast(m_window_info.window_handle)}; const VkResult res = vkCreateAndroidSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface); if (res != VK_SUCCESS) @@ -143,6 +150,8 @@ bool VulkanSwapChain::CreateSurface(VkInstance instance, VkPhysicalDevice physic { const VkXcbSurfaceCreateInfoKHR surface_create_info = { .sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, .connection = static_cast(m_window_info.display_connection), .window = static_cast(reinterpret_cast(m_window_info.window_handle))}; 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) { const VkWaylandSurfaceCreateInfoKHR surface_create_info = { - VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, nullptr, 0, - static_cast(m_window_info.display_connection), - static_cast(m_window_info.window_handle)}; + .sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, + .display = static_cast(m_window_info.display_connection), + .surface = static_cast(m_window_info.window_handle)}; VkResult res = vkCreateWaylandSurfaceKHR(instance, &surface_create_info, nullptr, &m_surface); if (res != VK_SUCCESS) { @@ -403,6 +414,8 @@ bool VulkanSwapChain::CreateSwapChain(VulkanDevice& dev, Error* error) // Now we can actually create the swap chain VkSwapchainCreateInfoKHR swap_chain_info = {.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR, + .pNext = nullptr, + .flags = 0, .surface = m_surface, .minImageCount = image_count, .imageFormat = surface_format->format, @@ -411,6 +424,8 @@ bool VulkanSwapChain::CreateSwapChain(VulkanDevice& dev, Error* error) .imageArrayLayers = 1u, .imageUsage = image_usage, .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE, + .queueFamilyIndexCount = 0, + .pQueueFamilyIndices = nullptr, .preTransform = transform, .compositeAlpha = alpha, .presentMode = present_mode.value(), @@ -529,6 +544,8 @@ bool VulkanSwapChain::CreateSwapChainImages(VulkanDevice& dev, Error* error) const VkImageViewCreateInfo view_info = { .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, + .pNext = nullptr, + .flags = 0, .image = images[i], .viewType = VK_IMAGE_VIEW_TYPE_2D, .format = VulkanDevice::TEXTURE_FORMAT_MAPPING[static_cast(m_window_info.surface_format)], @@ -734,6 +751,7 @@ void VulkanSwapChain::ReleaseCurrentImage() VulkanDevice::GetInstance().WaitForGPUIdle(); const VkReleaseSwapchainImagesInfoEXT info = {.sType = VK_STRUCTURE_TYPE_RELEASE_SWAPCHAIN_IMAGES_INFO_EXT, + .pNext = nullptr, .swapchain = m_swap_chain, .imageIndexCount = 1, .pImageIndices = &m_current_image}; diff --git a/src/util/win32_raw_input_source.cpp b/src/util/win32_raw_input_source.cpp index 20338e871..30ce21844 100644 --- a/src/util/win32_raw_input_source.cpp +++ b/src/util/win32_raw_input_source.cpp @@ -236,6 +236,7 @@ bool Win32RawInputSource::OpenDevices() RID_DEVICE_INFO devinfo = { .cbSize = sizeof(devinfo), .dwType = RIM_TYPEMOUSE, + .mouse = {}, }; UINT devinfo_size = sizeof(devinfo); if (GetRawInputDeviceInfoW(rid.hDevice, RIDI_DEVICEINFO, &devinfo, &devinfo_size) <= 0 || diff --git a/src/util/window_info.cpp b/src/util/window_info.cpp index b54b00e3d..543bfedf6 100644 --- a/src/util/window_info.cpp +++ b/src/util/window_info.cpp @@ -66,7 +66,8 @@ static std::optional GetRefreshRateFromDisplayConfig(HWND hwnd, Error* er DISPLAYCONFIG_SOURCE_DEVICE_NAME sdn = {.header = {.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME, .size = sizeof(DISPLAYCONFIG_SOURCE_DEVICE_NAME), .adapterId = pi.sourceInfo.adapterId, - .id = pi.sourceInfo.id}}; + .id = pi.sourceInfo.id}, + .viewGdiDeviceName = {}}; LONG res = DisplayConfigGetDeviceInfo(&sdn.header); if (res != ERROR_SUCCESS) { diff --git a/src/util/xinput_source.cpp b/src/util/xinput_source.cpp index 3e95d1692..22a687a3d 100644 --- a/src/util/xinput_source.cpp +++ b/src/util/xinput_source.cpp @@ -444,10 +444,12 @@ void XInputSource::HandleControllerDisconnection(u32 index) { INFO_LOG("XInput controller {} disconnected.", index); - InputManager::OnInputDeviceDisconnected({{ - .source_type = InputSourceType::XInput, + InputManager::OnInputDeviceDisconnected({{.source_type = InputSourceType::XInput, .source_index = index, - }}, + .source_subtype = InputSubclass::None, + .modifier = InputModifier::None, + .invert = 0, + .data = 0}}, fmt::format("XInput-{}", index)); m_controllers[index] = {}; }