idk
This commit is contained in:
Vendored
+18
-1
@@ -21,6 +21,11 @@
|
|||||||
"description": "Enable break on all exceptions",
|
"description": "Enable break on all exceptions",
|
||||||
"text": "catch throw",
|
"text": "catch throw",
|
||||||
"ignoreFailures": true
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Connect to valgrind",
|
||||||
|
"text": "${command:valgrind-task-integration.valgrindGdbArg}",
|
||||||
|
"ignoreFailures": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -74,7 +79,19 @@
|
|||||||
"console": "integratedTerminal",
|
"console": "integratedTerminal",
|
||||||
"cwd": "${workspaceRoot}/bin/Debug",
|
"cwd": "${workspaceRoot}/bin/Debug",
|
||||||
"environment": [],
|
"environment": [],
|
||||||
"visualizerFile": "${workspaceRoot}/Seele.natvis"
|
"visualizerFile": "${workspaceRoot}/Seele.natvis",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable break on all exceptions",
|
||||||
|
"text": "catch throw",
|
||||||
|
"ignoreFailures": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Connect to valgrind",
|
||||||
|
"text": "${command:valgrind-task-integration.valgrindGdbArg}",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Test",
|
"name": "Test",
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ list (APPEND EXTRA_CMAKE_ARGS
|
|||||||
list(APPEND DEPENDENCIES ktx)
|
list(APPEND DEPENDENCIES ktx)
|
||||||
|
|
||||||
find_program(BASH_EXECUTABLE git-bash)
|
find_program(BASH_EXECUTABLE git-bash)
|
||||||
|
set(KTX_FEATURE_TESTS off)
|
||||||
|
|
||||||
add_subdirectory(${KTX_ROOT} ${KTX_ROOT})
|
add_subdirectory(${KTX_ROOT} ${KTX_ROOT})
|
||||||
|
|
||||||
@@ -73,8 +74,8 @@ ExternalProject_Add(slang
|
|||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
ExternalProject_Add(slang
|
ExternalProject_Add(slang
|
||||||
SOURCE_DIR ${SLANG_ROOT}
|
SOURCE_DIR ${SLANG_ROOT}
|
||||||
BINARY_DIR ${SLANG_ROOT}/lib
|
BINARY_DIR ${SLANG_ROOT}
|
||||||
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake2 --build-location=build/linux
|
CONFIGURE_COMMAND ${CMAKE_SOURCE_DIR}/premake5 --file=${CMAKE_SOURCE_DIR}/external/slang/premake5.lua gmake --arch=${CMAKE_PLATFORM} --deps=true --build-location=build/linux
|
||||||
BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build/linux config=${SLANG_CONFIG}
|
BUILD_COMMAND make -C ${CMAKE_SOURCE_DIR}/external/slang/build/linux config=${SLANG_CONFIG}
|
||||||
INSTALL_COMMAND "")
|
INSTALL_COMMAND "")
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
Vendored
+1
-1
Submodule external/slang updated: 627fc976ba...2e1a84add5
+26
-11
@@ -6,27 +6,42 @@ using namespace Seele;
|
|||||||
std::mutex Seele::promisesLock;
|
std::mutex Seele::promisesLock;
|
||||||
List<Promise*> Seele::promises;
|
List<Promise*> Seele::promises;
|
||||||
|
|
||||||
Event::Event(nullptr_t)
|
//Event::Event(nullptr_t)
|
||||||
{
|
//{
|
||||||
}
|
//}
|
||||||
|
|
||||||
Event::Event(const std::string &name, const std::source_location &location)
|
Event::Event(const std::string &name, const std::source_location &location)
|
||||||
: name(name)
|
: name(name)
|
||||||
, location(location)
|
, location(location)
|
||||||
, eventLock(std::make_unique<std::mutex>())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Event::Event(const std::source_location &location)
|
Event::Event(const std::source_location &location)
|
||||||
: name(location.function_name())
|
: name(location.function_name())
|
||||||
, location(location)
|
, location(location)
|
||||||
, eventLock(std::make_unique<std::mutex>())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Event::Event(Event&& other)
|
||||||
|
: name(std::move(other.name))
|
||||||
|
, location(std::move(other.location))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Event& Event::operator=(Event&& other)
|
||||||
|
{
|
||||||
|
if(this != &other)
|
||||||
|
{
|
||||||
|
std::scoped_lock lock(eventLock, other.eventLock);
|
||||||
|
name = std::move(other.name);
|
||||||
|
location = std::move(other.location);
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
void Event::raise()
|
void Event::raise()
|
||||||
{
|
{
|
||||||
std::scoped_lock lock(*eventLock);
|
std::scoped_lock lock(eventLock);
|
||||||
data = true;
|
data = true;
|
||||||
if(waitingJobs.size() > 0)
|
if(waitingJobs.size() > 0)
|
||||||
{
|
{
|
||||||
@@ -39,17 +54,17 @@ void Event::raise()
|
|||||||
}
|
}
|
||||||
void Event::reset()
|
void Event::reset()
|
||||||
{
|
{
|
||||||
std::scoped_lock lock(*eventLock);
|
std::scoped_lock lock(eventLock);
|
||||||
data = false;
|
data = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Event::await_ready()
|
bool Event::await_ready()
|
||||||
{
|
{
|
||||||
eventLock->lock();
|
eventLock.lock();
|
||||||
bool result = data;
|
bool result = data;
|
||||||
if(result)
|
if(result)
|
||||||
{
|
{
|
||||||
eventLock->unlock();
|
eventLock.unlock();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -58,14 +73,14 @@ void Event::await_suspend(std::coroutine_handle<JobPromiseBase<false>> h)
|
|||||||
{
|
{
|
||||||
//h.promise().enqueue(this);
|
//h.promise().enqueue(this);
|
||||||
waitingJobs.add(JobBase<false>(&h.promise()));
|
waitingJobs.add(JobBase<false>(&h.promise()));
|
||||||
eventLock->unlock();
|
eventLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Event::await_suspend(std::coroutine_handle<JobPromiseBase<true>> h)
|
void Event::await_suspend(std::coroutine_handle<JobPromiseBase<true>> h)
|
||||||
{
|
{
|
||||||
//h.promise().enqueue(this);
|
//h.promise().enqueue(this);
|
||||||
waitingMainJobs.add(JobBase<true>(&h.promise()));
|
waitingMainJobs.add(JobBase<true>(&h.promise()));
|
||||||
eventLock->unlock();
|
eventLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadPool::ThreadPool(uint32 threadCount)
|
ThreadPool::ThreadPool(uint32 threadCount)
|
||||||
|
|||||||
+19
-13
@@ -16,14 +16,14 @@ struct JobPromiseBase;
|
|||||||
struct Event
|
struct Event
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Event(nullptr_t);
|
//Event(nullptr_t);
|
||||||
Event(const std::string& name, const std::source_location& location = std::source_location::current());
|
Event(const std::string& name, const std::source_location& location = std::source_location::current());
|
||||||
Event(const std::source_location& location = std::source_location::current());
|
Event(const std::source_location& location = std::source_location::current());
|
||||||
Event(const Event& other) = delete;
|
Event(const Event& other) = delete;
|
||||||
Event(Event&& other) = default;
|
Event(Event&& other);
|
||||||
~Event() = default;
|
~Event() = default;
|
||||||
Event& operator=(const Event& other) = delete;
|
Event& operator=(const Event& other) = delete;
|
||||||
Event& operator=(Event&& other) = default;
|
Event& operator=(Event&& other);
|
||||||
auto operator<=>(const Event& other) const
|
auto operator<=>(const Event& other) const
|
||||||
{
|
{
|
||||||
return name <=> other.name;
|
return name <=> other.name;
|
||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
}
|
}
|
||||||
operator bool()
|
operator bool()
|
||||||
{
|
{
|
||||||
std::scoped_lock lock(*eventLock);
|
std::scoped_lock lock(eventLock);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
std::string name;
|
std::string name;
|
||||||
std::source_location location;
|
std::source_location location;
|
||||||
std::unique_ptr<std::mutex> eventLock;
|
std::mutex eventLock;
|
||||||
bool data = false;
|
bool data = false;
|
||||||
Array<JobBase<false>> waitingJobs;
|
Array<JobBase<false>> waitingJobs;
|
||||||
Array<JobBase<true>> waitingMainJobs;
|
Array<JobBase<true>> waitingMainJobs;
|
||||||
@@ -81,8 +81,14 @@ struct JobPromiseBase
|
|||||||
DONE
|
DONE
|
||||||
};
|
};
|
||||||
JobPromiseBase(const std::source_location& location = std::source_location::current())
|
JobPromiseBase(const std::source_location& location = std::source_location::current())
|
||||||
: handle(std::coroutine_handle<JobPromiseBase<MainJob>>::from_promise(*this))
|
: pad0(0x7472617453)
|
||||||
, finishedEvent(Event(location))
|
, handle(std::coroutine_handle<JobPromiseBase<MainJob>>::from_promise(*this))
|
||||||
|
, waitingFor(nullptr)
|
||||||
|
, continuation(nullptr)
|
||||||
|
, numRefs(0)
|
||||||
|
, finishedEvent(location)
|
||||||
|
, state(State::READY)
|
||||||
|
, pad1(0x646E45)
|
||||||
{
|
{
|
||||||
if constexpr(!MainJob)
|
if constexpr(!MainJob)
|
||||||
{
|
{
|
||||||
@@ -165,14 +171,14 @@ struct JobPromiseBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uint64 pad0 = 0x7472617453;
|
uint64 pad0;
|
||||||
std::coroutine_handle<JobPromiseBase> handle;
|
std::coroutine_handle<JobPromiseBase> handle;
|
||||||
Event* waitingFor = nullptr;
|
Event* waitingFor;
|
||||||
JobPromiseBase* continuation = nullptr;
|
JobPromiseBase* continuation;
|
||||||
uint64 numRefs = 0;
|
uint64 numRefs;
|
||||||
Event finishedEvent;
|
Event finishedEvent;
|
||||||
State state = State::READY;
|
State state;
|
||||||
uint64 pad1 = 0x646E45;
|
uint64 pad1;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<bool MainJob = false>
|
template<bool MainJob = false>
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ Seele::SceneView::SceneView(Gfx::PGraphics graphics, PWindow owner, const Viewpo
|
|||||||
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Ely\\Ely.fbx");
|
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Ely\\Ely.fbx");
|
||||||
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Cube\\cube.obj");
|
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Cube\\cube.obj");
|
||||||
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Plane\\plane.fbx");
|
//AssetRegistry::importFile("D:\\Private\\Programming\\Unreal Engine\\Assets\\Plane\\plane.fbx");
|
||||||
PPrimitiveComponent plane = new PrimitiveComponent(AssetRegistry::findMesh("plane"));
|
//PPrimitiveComponent plane = new PrimitiveComponent(AssetRegistry::findMesh("plane"));
|
||||||
plane->setRelativeScale(Vector(100, 100, 100));
|
//plane->setRelativeScale(Vector(100, 100, 100));
|
||||||
scene->addPrimitiveComponent(plane);
|
//scene->addPrimitiveComponent(plane);
|
||||||
|
|
||||||
for(uint32 i = 0; i < 100000; ++i)
|
for(uint32 i = 0; i < 100000; ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ include_directories(${Boost_INCLUDE_DIRS})
|
|||||||
|
|
||||||
add_subdirectory(Engine/)
|
add_subdirectory(Engine/)
|
||||||
target_link_libraries(Seele_unit_tests ${Boost_LIBRARIES})
|
target_link_libraries(Seele_unit_tests ${Boost_LIBRARIES})
|
||||||
|
target_compile_definitions(Seele_unit_tests PRIVATE -DBOOST_TEST_DYN_LINK)
|
||||||
|
|
||||||
target_precompile_headers(Seele_unit_tests
|
target_precompile_headers(Seele_unit_tests
|
||||||
PRIVATE
|
PRIVATE
|
||||||
|
|||||||
Reference in New Issue
Block a user