0.2.0-dev Download ZIP
102 lines ·5.1 KB Raw
| 1 | /**************************************************************************/ |
| 2 | /* utilities.h */ |
| 3 | /**************************************************************************/ |
| 4 | /* This file is part of: */ |
| 5 | /* GODOT ENGINE */ |
| 6 | /* https://godotengine.org */ |
| 7 | /**************************************************************************/ |
| 8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
| 9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
| 10 | /* */ |
| 11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
| 12 | /* a copy of this software and associated documentation files (the */ |
| 13 | /* "Software"), to deal in the Software without restriction, including */ |
| 14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
| 15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
| 16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
| 17 | /* the following conditions: */ |
| 18 | /* */ |
| 19 | /* The above copyright notice and this permission notice shall be */ |
| 20 | /* included in all copies or substantial portions of the Software. */ |
| 21 | /* */ |
| 22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
| 23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
| 24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
| 25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
| 26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
| 27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
| 28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
| 29 | /**************************************************************************/ |
| 30 | |
| 31 | #pragma once |
| 32 | |
| 33 | #include "servers/rendering/storage/utilities.h" |
| 34 | |
| 35 | namespace RendererDummy { |
| 36 | |
| 37 | class Utilities : public RendererUtilities { |
| 38 | private: |
| 39 | static Utilities *singleton; |
| 40 | |
| 41 | public: |
| 42 | static Utilities *get_singleton() { return singleton; } |
| 43 | |
| 44 | Utilities(); |
| 45 | ~Utilities(); |
| 46 | |
| 47 | /* INSTANCES */ |
| 48 | |
| 49 | virtual RSE::InstanceType get_base_type(RID p_rid) const override; |
| 50 | virtual bool free(RID p_rid) override; |
| 51 | |
| 52 | /* DEPENDENCIES */ |
| 53 | |
| 54 | virtual void base_update_dependency(RID p_base, DependencyTracker *p_instance) override; |
| 55 | |
| 56 | /* VISIBILITY NOTIFIER */ |
| 57 | |
| 58 | virtual RID visibility_notifier_allocate() override { return RID(); } |
| 59 | virtual void visibility_notifier_initialize(RID p_notifier) override {} |
| 60 | virtual void visibility_notifier_free(RID p_notifier) override {} |
| 61 | |
| 62 | virtual void visibility_notifier_set_aabb(RID p_notifier, const AABB &p_aabb) override {} |
| 63 | virtual void visibility_notifier_set_callbacks(RID p_notifier, const Callable &p_enter_callbable, const Callable &p_exit_callable) override {} |
| 64 | |
| 65 | virtual AABB visibility_notifier_get_aabb(RID p_notifier) const override { return AABB(); } |
| 66 | virtual void visibility_notifier_call(RID p_notifier, bool p_enter, bool p_deferred) override {} |
| 67 | |
| 68 | /* TIMING */ |
| 69 | |
| 70 | virtual void capture_timestamps_begin() override {} |
| 71 | virtual void capture_timestamp(const String &p_name) override {} |
| 72 | virtual uint32_t get_captured_timestamps_count() const override { return 0; } |
| 73 | virtual uint64_t get_captured_timestamps_frame() const override { return 0; } |
| 74 | virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const override { return 0; } |
| 75 | virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const override { return 0; } |
| 76 | virtual String get_captured_timestamp_name(uint32_t p_index) const override { return String(); } |
| 77 | |
| 78 | /* MISC */ |
| 79 | |
| 80 | virtual void update_dirty_resources() override {} |
| 81 | virtual void set_debug_generate_wireframes(bool p_generate) override {} |
| 82 | |
| 83 | virtual bool has_os_feature(const String &p_feature) const override { |
| 84 | return p_feature == "rgtc" || p_feature == "bptc" || p_feature == "s3tc" || p_feature == "etc2"; |
| 85 | } |
| 86 | |
| 87 | virtual void update_memory_info() override {} |
| 88 | |
| 89 | virtual uint64_t get_rendering_info(RSE::RenderingInfo p_info) override { return 0; } |
| 90 | virtual String get_video_adapter_name() const override { return String(); } |
| 91 | virtual String get_video_adapter_vendor() const override { return String(); } |
| 92 | #ifdef RD_ENABLED |
| 93 | virtual RenderingDeviceEnums::DeviceType get_video_adapter_type() const override { return RenderingDeviceEnums::DeviceType::DEVICE_TYPE_OTHER; } |
| 94 | #endif // RD_ENABLED |
| 95 | virtual String get_video_adapter_api_version() const override { return String(); } |
| 96 | |
| 97 | virtual Size2i get_maximum_viewport_size() const override { return Size2i(); } |
| 98 | virtual uint32_t get_maximum_shader_varyings() const override { return 31; } // Fair assumption for everything except old OpenGL-only phones. |
| 99 | virtual uint64_t get_maximum_uniform_buffer_size() const override { return 65536; } // Fair assumption for all devices. |
| 100 | }; |
| 101 | |
| 102 | } // namespace RendererDummy |