Skip to content

Commit

Permalink
Fix crash when calling get_video_adapter_* in a thread
Browse files Browse the repository at this point in the history
co-authored-by: Clay John <claynjohn@gmail.com>
  • Loading branch information
univeous and clayjohn committed Jul 19, 2023
1 parent a758388 commit 0a64abe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 26 deletions.
12 changes: 0 additions & 12 deletions servers/rendering/rendering_server_default.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,10 @@ uint64_t RenderingServerDefault::get_rendering_info(RenderingInfo p_info) {
return RSG::utilities->get_rendering_info(p_info);
}

String RenderingServerDefault::get_video_adapter_name() const {
return RSG::utilities->get_video_adapter_name();
}

String RenderingServerDefault::get_video_adapter_vendor() const {
return RSG::utilities->get_video_adapter_vendor();
}

RenderingDevice::DeviceType RenderingServerDefault::get_video_adapter_type() const {
return RSG::utilities->get_video_adapter_type();
}

String RenderingServerDefault::get_video_adapter_api_version() const {
return RSG::utilities->get_video_adapter_api_version();
}

void RenderingServerDefault::set_frame_profiling_enabled(bool p_enable) {
RSG::utilities->capturing_timestamps = p_enable;
}
Expand Down
31 changes: 17 additions & 14 deletions servers/rendering/rendering_server_default.h
Original file line number Diff line number Diff line change
Expand Up @@ -945,10 +945,27 @@ class RenderingServerDefault : public RenderingServer {
FUNC0(global_shader_parameters_clear)

#undef server_name
#undef ServerName
/* STATUS INFORMATION */
#define ServerName RendererUtilities
#define server_name RSG::utilities
FUNC0RC(String, get_video_adapter_name)
FUNC0RC(String, get_video_adapter_vendor)
FUNC0RC(String, get_video_adapter_api_version)
#undef server_name
#undef ServerName
#undef WRITE_ACTION
#undef SYNC_DEBUG

virtual uint64_t get_rendering_info(RenderingInfo p_info) override;
virtual RenderingDevice::DeviceType get_video_adapter_type() const override;

virtual void set_frame_profiling_enabled(bool p_enable) override;
virtual Vector<FrameProfileArea> get_frame_profile() override;
virtual uint64_t get_frame_profile_frame() override;

virtual RID get_test_cube() override;

/* FREE */

virtual void free(RID p_rid) override {
Expand All @@ -970,20 +987,6 @@ class RenderingServerDefault : public RenderingServer {
virtual void init() override;
virtual void finish() override;

/* STATUS INFORMATION */

virtual uint64_t get_rendering_info(RenderingInfo p_info) override;
virtual String get_video_adapter_name() const override;
virtual String get_video_adapter_vendor() const override;
virtual RenderingDevice::DeviceType get_video_adapter_type() const override;
virtual String get_video_adapter_api_version() const override;

virtual void set_frame_profiling_enabled(bool p_enable) override;
virtual Vector<FrameProfileArea> get_frame_profile() override;
virtual uint64_t get_frame_profile_frame() override;

virtual RID get_test_cube() override;

/* TESTING */

virtual double get_frame_setup_time_cpu() const override;
Expand Down

0 comments on commit 0a64abe

Please sign in to comment.