Skip to content

Commit

Permalink
Revert "Merge master into dev"
Browse files Browse the repository at this point in the history
This reverts commit 6f47511.
  • Loading branch information
jmorton06 committed May 19, 2020
1 parent 6f47511 commit 0e10af2
Show file tree
Hide file tree
Showing 144 changed files with 9,600 additions and 14,334 deletions.
59 changes: 24 additions & 35 deletions Dependencies/imgui/examples/imgui_impl_vulkan.cpp
Expand Up @@ -211,41 +211,30 @@ void CreateDescriptorSets(ImDrawData* draw_data)

if (pcmd->TextureId)
{
if (!g_DescriptorSets[pcmd->TextureId])
{
VkWriteDescriptorSet descriptorWrites[1] = {};

VkDescriptorSet set;
VkDescriptorSetAllocateInfo alloc_info = {};
alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
alloc_info.descriptorPool = g_DescriptorPool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &g_DescriptorSetLayout;
vkAllocateDescriptorSets(g_Device, &alloc_info, &set);

descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
descriptorWrites[0].dstSet = set;
descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
descriptorWrites[0].pImageInfo = (VkDescriptorImageInfo *) pcmd->TextureId;
descriptorWrites[0].descriptorCount = 1;

vkUpdateDescriptorSets(g_Device, 1, descriptorWrites, 0, nullptr);

g_DescriptorSets[pcmd->TextureId] = set;
}
else
{
VkWriteDescriptorSet descriptorWrites[1] = {};
auto set = g_DescriptorSets[pcmd->TextureId];
descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
descriptorWrites[0].dstSet = set;
descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
descriptorWrites[0].pImageInfo = (VkDescriptorImageInfo *) pcmd->TextureId;
descriptorWrites[0].descriptorCount = 1;

vkUpdateDescriptorSets(g_Device, 1, descriptorWrites, 0, nullptr);
}
}
if (!g_DescriptorSets[pcmd->TextureId])
{
VkWriteDescriptorSet descriptorWrites[1] = {};

VkDescriptorSet set;
VkDescriptorSetAllocateInfo alloc_info = {};
alloc_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
alloc_info.descriptorPool = g_DescriptorPool;
alloc_info.descriptorSetCount = 1;
alloc_info.pSetLayouts = &g_DescriptorSetLayout;
vkAllocateDescriptorSets(g_Device, &alloc_info, &set);

descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
descriptorWrites[0].dstSet = set;
descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
descriptorWrites[0].pImageInfo = (VkDescriptorImageInfo*)pcmd->TextureId;
descriptorWrites[0].descriptorCount = 1;

vkUpdateDescriptorSets(g_Device, 1, descriptorWrites, 0, nullptr);

g_DescriptorSets[pcmd->TextureId] = set;
}
}

}
}
}
Expand Down
28 changes: 11 additions & 17 deletions Lumos/external/spdlog/async.h
@@ -1,26 +1,28 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.

//
// Copyright(c) 2018 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//

#pragma once

//
// Async logging using global thread pool
// All loggers created here share same global thread pool.
// Each log message is pushed to a queue along with a shared pointer to the
// Each log message is pushed to a queue along withe a shared pointer to the
// logger.
// If a logger deleted while having pending messages in the queue, it's actual
// destruction will defer
// until all its messages are processed by the thread pool.
// This is because each message in the queue holds a shared_ptr to the
// originating logger.

#include <spdlog/async_logger.h>
#include <spdlog/details/registry.h>
#include <spdlog/details/thread_pool.h>
#include "spdlog/async_logger.h"
#include "spdlog/details/registry.h"
#include "spdlog/details/thread_pool.h"

#include <memory>
#include <mutex>
#include <functional>

namespace spdlog {

Expand All @@ -40,9 +42,7 @@ struct async_factory_impl
auto &registry_inst = details::registry::instance();

// create global thread pool if not already exists..

auto &mutex = registry_inst.tp_mutex();
std::lock_guard<std::recursive_mutex> tp_lock(mutex);
std::lock_guard<std::recursive_mutex> tp_lock(registry_inst.tp_mutex());
auto tp = registry_inst.get_tp();
if (tp == nullptr)
{
Expand Down Expand Up @@ -72,17 +72,11 @@ inline std::shared_ptr<spdlog::logger> create_async_nb(std::string logger_name,
return async_factory_nonblock::create<Sink>(std::move(logger_name), std::forward<SinkArgs>(sink_args)...);
}

// set global thread pool.
inline void init_thread_pool(size_t q_size, size_t thread_count, std::function<void()> on_thread_start)
{
auto tp = std::make_shared<details::thread_pool>(q_size, thread_count, on_thread_start);
details::registry::instance().set_tp(std::move(tp));
}

// set global thread pool.
inline void init_thread_pool(size_t q_size, size_t thread_count)
{
init_thread_pool(q_size, thread_count, [] {});
auto tp = std::make_shared<details::thread_pool>(q_size, thread_count);
details::registry::instance().set_tp(std::move(tp));
}

// get the global thread pool.
Expand Down
92 changes: 0 additions & 92 deletions Lumos/external/spdlog/async_logger-inl.h

This file was deleted.

35 changes: 20 additions & 15 deletions Lumos/external/spdlog/async_logger.h
@@ -1,20 +1,30 @@
// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
//
// Copyright(c) 2015 Gabi Melman.
// Distributed under the MIT License (http://opensource.org/licenses/MIT)
//

#pragma once

// Fast asynchronous logger.
// Uses pre allocated queue.
// Very fast asynchronous logger (millions of logs per second on an average
// desktop)
// Uses pre allocated lockfree queue for maximum throughput even under large
// number of threads.
// Creates a single back thread to pop messages from the queue and log them.
//
// Upon each log write the logger:
// 1. Checks if its log level is enough to log the message
// 2. Push a new copy of the message to a queue (or block the caller until
// space is available in the queue)
// 3. will throw spdlog_ex upon log exceptions
// Upon destruction, logs all remaining messages in the queue before
// destructing..

#include <spdlog/logger.h>
#include "spdlog/common.h"
#include "spdlog/logger.h"

#include <chrono>
#include <memory>
#include <string>

namespace spdlog {

Expand All @@ -30,18 +40,14 @@ namespace details {
class thread_pool;
}

class SPDLOG_API async_logger final : public std::enable_shared_from_this<async_logger>, public logger
class async_logger final : public std::enable_shared_from_this<async_logger>, public logger
{
friend class details::thread_pool;

public:
template<typename It>
async_logger(std::string logger_name, It begin, It end, std::weak_ptr<details::thread_pool> tp,
async_overflow_policy overflow_policy = async_overflow_policy::block)
: logger(std::move(logger_name), begin, end)
, thread_pool_(std::move(tp))
, overflow_policy_(overflow_policy)
{}
async_overflow_policy overflow_policy = async_overflow_policy::block);

async_logger(std::string logger_name, sinks_init_list sinks_list, std::weak_ptr<details::thread_pool> tp,
async_overflow_policy overflow_policy = async_overflow_policy::block);
Expand All @@ -52,9 +58,10 @@ class SPDLOG_API async_logger final : public std::enable_shared_from_this<async_
std::shared_ptr<logger> clone(std::string new_name) override;

protected:
void sink_it_(const details::log_msg &msg) override;
void sink_it_(details::log_msg &msg) override;
void flush_() override;
void backend_sink_it_(const details::log_msg &incoming_log_msg);

void backend_log_(const details::log_msg &incoming_log_msg);
void backend_flush_();

private:
Expand All @@ -63,6 +70,4 @@ class SPDLOG_API async_logger final : public std::enable_shared_from_this<async_
};
} // namespace spdlog

#ifdef SPDLOG_HEADER_ONLY
#include "async_logger-inl.h"
#endif
#include "details/async_logger_impl.h"
45 changes: 0 additions & 45 deletions Lumos/external/spdlog/cfg/argv.h

This file was deleted.

36 changes: 0 additions & 36 deletions Lumos/external/spdlog/cfg/env.h

This file was deleted.

0 comments on commit 0e10af2

Please sign in to comment.