Use [[nodiscard]] attribute more sparingly

Removed all uses of the [[nodiscard]] attribute unless ignoring the
return value would lead to an error or leak e.g. memory allocations.
This commit is contained in:
2025-06-26 20:28:21 +10:00
parent d89f8de08f
commit 04eec1b703
4 changed files with 30 additions and 28 deletions

View File

@@ -20,17 +20,18 @@ namespace Nova {
static RenderDriver* create(RenderAPI api, WindowDriver* window_driver = nullptr);
virtual ~RenderDriver() = default;
[[nodiscard]] virtual RenderAPI get_api() const = 0;
[[nodiscard]] virtual u32 get_api_version() const = 0;
[[nodiscard]] virtual std::string get_api_name() const = 0;
[[nodiscard]] virtual std::string get_api_version_string() const = 0;
virtual RenderAPI get_api() const = 0;
virtual u32 get_api_version() const = 0;
virtual std::string get_api_name() const = 0;
virtual std::string get_api_version_string() const = 0;
[[nodiscard]] virtual u32 get_device_count() const = 0;
[[nodiscard]] virtual const RenderDevice& get_device(u32 index) const = 0;
[[nodiscard]] virtual bool get_device_supports_surface(u32 index, SurfaceID surface) const = 0;
virtual u32 get_device_count() const = 0;
virtual const RenderDevice& get_device(u32 index) const = 0;
virtual bool get_device_supports_surface(u32 index, SurfaceID surface) const = 0;
virtual void select_device(u32 index) = 0;
[[nodiscard]] virtual u32 choose_queue_family(QueueType type, SurfaceID surface) = 0;
virtual u32 choose_queue_family(QueueType type, SurfaceID surface) = 0;
[[nodiscard]] virtual QueueID get_queue(u32 queue_family) = 0;
virtual void free_queue(QueueID queue) = 0;
@@ -39,7 +40,7 @@ namespace Nova {
[[nodiscard]] virtual SwapchainID create_swapchain(SurfaceID surface) = 0;
virtual void resize_swapchain(SwapchainID swapchain) = 0;
[[nodiscard]] virtual RenderPassID get_swapchain_render_pass(SwapchainID swapchain) const = 0;
virtual RenderPassID get_swapchain_render_pass(SwapchainID swapchain) const = 0;
virtual void destroy_swapchain(SwapchainID swapchain) = 0;
[[nodiscard]] virtual ShaderID create_shader(const std::span<u8> bytes, ShaderStage stage) = 0;