diff options
| author | Nicolas James <nj3ahxac@gmail.com> | 2026-03-12 16:23:05 +1100 |
|---|---|---|
| committer | Nicolas James <nj3ahxac@gmail.com> | 2026-03-12 16:23:05 +1100 |
| commit | a19308a35e88cd53c0d5ac2f26c705f902804658 (patch) | |
| tree | 368eff0e893296329e9daf71dad7978c4e40d418 /src/device_context.cc | |
| parent | cc4c4fe1015648e1c19c9b35a7a1098f6cf463c1 (diff) | |
Add reasonable compiler warnings and fix them
Diffstat (limited to 'src/device_context.cc')
| -rw-r--r-- | src/device_context.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/device_context.cc b/src/device_context.cc index 273a958..c192ec6 100644 --- a/src/device_context.cc +++ b/src/device_context.cc @@ -12,7 +12,7 @@ DeviceContext::DeviceContext(InstanceContext& parent_instance, const bool was_antilag_requested, VkuDeviceDispatchTable&& vtable) : instance(parent_instance), physical_device(parent_physical_device), - device(device), was_antilag_requested(was_antilag_requested), + was_antilag_requested(was_antilag_requested), device(device), vtable(std::move(vtable)) { // Only create our clock if we can support creating it. @@ -78,7 +78,8 @@ DeviceContext::Clock::ticks_to_time(const std::uint64_t& ticks) const { // by GetCalibratedTimestamps. It would be more robust to use the posix // gettime that vulkan guarantees it can be compared to instead. - const auto diff_nsec = static_cast<std::int64_t>(diff * ns_tick + 0.5); + const auto diff_nsec = + static_cast<std::int64_t>(static_cast<double>(diff) * ns_tick + 0.5); const auto delta = std::chrono::nanoseconds(this->host_ns + diff_nsec); return time_point_t{delta}; } |
