Skip to content

Commit 50b1666

Browse files
tksuoranclaude
andcommitted
Fix headless build: add frame pacing stubs to null graphics backend
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 49e6176 commit 50b1666

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/erhe/graphics/erhe_graphics/null/null_device.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ auto Device_impl::get_native_handles() const -> Native_device_handles
141141
return Native_device_handles{};
142142
}
143143

144+
auto Device_impl::wait_for_displayed_frame(const std::int64_t frame_id, const uint64_t timeout_ns) -> Present_wait_result
145+
{
146+
static_cast<void>(frame_id);
147+
static_cast<void>(timeout_ns);
148+
return Present_wait_result::unsupported;
149+
}
150+
151+
void Device_impl::set_present_target_time(const std::int64_t frame_id, const double target_time_seconds, const double hold_until_seconds)
152+
{
153+
static_cast<void>(frame_id);
154+
static_cast<void>(target_time_seconds);
155+
static_cast<void>(hold_until_seconds);
156+
}
157+
158+
auto Device_impl::get_frame_pacing_tier() const -> Frame_pacing_tier
159+
{
160+
return Frame_pacing_tier::off;
161+
}
162+
144163
void Device_impl::resize_swapchain_to_window()
145164
{
146165
// No-op for null backend

src/erhe/graphics/erhe_graphics/null/null_device.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ class Device_impl final
9191
[[nodiscard]] auto create_dummy_texture (Command_buffer& init_command_buffer, erhe::dataformat::Format format) -> std::shared_ptr<Texture>;
9292
[[nodiscard]] auto get_buffer_alignment (Buffer_target target) -> std::size_t;
9393
[[nodiscard]] auto get_frame_index () const -> uint64_t;
94+
[[nodiscard]] auto wait_for_displayed_frame (std::int64_t frame_id, uint64_t timeout_ns) -> Present_wait_result;
95+
void set_present_target_time (std::int64_t frame_id, double target_time_seconds, double hold_until_seconds);
96+
[[nodiscard]] auto get_frame_pacing_tier () const -> Frame_pacing_tier;
9497
[[nodiscard]] auto allocate_ring_buffer_entry (Buffer_target buffer_target, Ring_buffer_usage usage, std::size_t byte_count) -> Ring_buffer_range;
9598
[[nodiscard]] auto make_blit_command_encoder (Command_buffer& command_buffer) -> Blit_command_encoder;
9699
[[nodiscard]] auto make_compute_command_encoder (Command_buffer& command_buffer) -> Compute_command_encoder;

0 commit comments

Comments
 (0)