Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3055f34 authored by Chia-I Wu's avatar Chia-I Wu
Browse files

vulkan: constify DebugReportCallbackList::Message

Sending a message should not modify the state of DebugReportCallbackList,
conceptually.

Bug: 28120066
Change-Id: I7b30b4a41492b4e670408f34a6bffe8b56295afd
parent a0d40aaf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -58,9 +58,9 @@ void DebugReportCallbackList::Message(VkDebugReportFlagsEXT flags,
                                      size_t location,
                                      int32_t message_code,
                                      const char* layer_prefix,
                                      const char* message) {
                                      const char* message) const {
    std::shared_lock<decltype(rwmutex_)> lock(rwmutex_);
    Node* node = &head_;
    const Node* node = &head_;
    while ((node = node->next)) {
        if ((node->flags & flags) != 0) {
            node->callback(flags, object_type, object, location, message_code,
+2 −2
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ class DebugReportCallbackList {
                 size_t location,
                 int32_t message_code,
                 const char* layer_prefix,
                 const char* message);
                 const char* message) const;

    static Node* FromHandle(VkDebugReportCallbackEXT handle) {
        return reinterpret_cast<Node*>(uintptr_t(handle));
@@ -78,7 +78,7 @@ class DebugReportCallbackList {
    };

    // TODO(jessehall): replace with std::shared_mutex when available in libc++
    std::shared_timed_mutex rwmutex_;
    mutable std::shared_timed_mutex rwmutex_;
    Node head_;
};