diff --git a/include/Nazara/Vulkan/VkSurface.hpp b/include/Nazara/Vulkan/VkSurface.hpp index 03a57d2fe..53cb7fd5e 100644 --- a/include/Nazara/Vulkan/VkSurface.hpp +++ b/include/Nazara/Vulkan/VkSurface.hpp @@ -64,10 +64,10 @@ namespace Nz inline void Destroy(); - bool GetCapabilities(VkPhysicalDevice physicalDevice, VkSurfaceCapabilitiesKHR* surfaceCapabilities); - bool GetFormats(VkPhysicalDevice physicalDevice, std::vector* surfaceFormats); - bool GetPresentModes(VkPhysicalDevice physicalDevice, std::vector* presentModes); - bool GetSupportPresentation(VkPhysicalDevice physicalDevice, UInt32 queueFamilyIndex, bool* supported); + bool GetCapabilities(VkPhysicalDevice physicalDevice, VkSurfaceCapabilitiesKHR* surfaceCapabilities) const; + bool GetFormats(VkPhysicalDevice physicalDevice, std::vector* surfaceFormats) const; + bool GetPresentModes(VkPhysicalDevice physicalDevice, std::vector* presentModes) const; + bool GetSupportPresentation(VkPhysicalDevice physicalDevice, UInt32 queueFamilyIndex, bool* supported) const; inline bool IsSupported() const; @@ -84,7 +84,7 @@ namespace Nz Instance& m_instance; VkAllocationCallbacks m_allocator; VkSurfaceKHR m_surface; - VkResult m_lastErrorCode; + mutable VkResult m_lastErrorCode; }; } } diff --git a/include/Nazara/Vulkan/VkSurface.inl b/include/Nazara/Vulkan/VkSurface.inl index a79d9c65d..81b199d08 100644 --- a/include/Nazara/Vulkan/VkSurface.inl +++ b/include/Nazara/Vulkan/VkSurface.inl @@ -176,7 +176,7 @@ namespace Nz return m_lastErrorCode; } - inline bool Surface::GetCapabilities(VkPhysicalDevice physicalDevice, VkSurfaceCapabilitiesKHR* surfaceCapabilities) + inline bool Surface::GetCapabilities(VkPhysicalDevice physicalDevice, VkSurfaceCapabilitiesKHR* surfaceCapabilities) const { m_lastErrorCode = m_instance.vkGetPhysicalDeviceSurfaceCapabilitiesKHR(physicalDevice, m_surface, surfaceCapabilities); if (m_lastErrorCode != VkResult::VK_SUCCESS) @@ -188,7 +188,7 @@ namespace Nz return true; } - inline bool Surface::GetFormats(VkPhysicalDevice physicalDevice, std::vector* surfaceFormats) + inline bool Surface::GetFormats(VkPhysicalDevice physicalDevice, std::vector* surfaceFormats) const { // First, query format count UInt32 surfaceCount = 0; // Remember, Nz::UInt32 is a typedef on uint32_t @@ -211,7 +211,7 @@ namespace Nz return true; } - inline bool Surface::GetPresentModes(VkPhysicalDevice physicalDevice, std::vector* presentModes) + inline bool Surface::GetPresentModes(VkPhysicalDevice physicalDevice, std::vector* presentModes) const { // First, query present modes count UInt32 presentModeCount = 0; // Remember, Nz::UInt32 is a typedef on uint32_t @@ -234,7 +234,7 @@ namespace Nz return true; } - inline bool Surface::GetSupportPresentation(VkPhysicalDevice physicalDevice, UInt32 queueFamilyIndex, bool* supported) + inline bool Surface::GetSupportPresentation(VkPhysicalDevice physicalDevice, UInt32 queueFamilyIndex, bool* supported) const { VkBool32 presentationSupported = VK_FALSE; m_lastErrorCode = m_instance.vkGetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, m_surface, &presentationSupported);