*
This commit is contained in:
@@ -67,7 +67,7 @@ set(Boost_USE_STATIC_LIBS ON)
|
|||||||
set(BOOST_INCLUDE_LIBRARIES asio thread json)
|
set(BOOST_INCLUDE_LIBRARIES asio thread json)
|
||||||
set(BOOST_ENABLE_CMAKE ON)
|
set(BOOST_ENABLE_CMAKE ON)
|
||||||
set(BOOST_IOSTREAMS_ENABLE_ZLIB ON)
|
set(BOOST_IOSTREAMS_ENABLE_ZLIB ON)
|
||||||
set(BOOST_INCLUDE_LIBRARIES asio thread json iostreams interprocess)
|
set(BOOST_INCLUDE_LIBRARIES asio thread json iostreams interprocess timer circular_buffer lockfree stacktrace uuid serialization nowide)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
Boost
|
Boost
|
||||||
GIT_REPOSITORY https://github.com/boostorg/boost.git
|
GIT_REPOSITORY https://github.com/boostorg/boost.git
|
||||||
@@ -76,7 +76,7 @@ FetchContent_Declare(
|
|||||||
USES_TERMINAL_DOWNLOAD true
|
USES_TERMINAL_DOWNLOAD true
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(Boost)
|
FetchContent_MakeAvailable(Boost)
|
||||||
target_link_libraries(luavox_common INTERFACE Boost::asio Boost::thread Boost::json Boost::iostreams Boost::interprocess)
|
target_link_libraries(luavox_common INTERFACE Boost::asio Boost::thread Boost::json Boost::iostreams Boost::interprocess Boost::timer Boost::circular_buffer Boost::lockfree Boost::stacktrace Boost::uuid Boost::serialization Boost::nowide)
|
||||||
|
|
||||||
# glm
|
# glm
|
||||||
# find_package(glm REQUIRED)
|
# find_package(glm REQUIRED)
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ void Vulkan::run()
|
|||||||
{
|
{
|
||||||
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
|
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
|
||||||
.pNext = nullptr,
|
.pNext = nullptr,
|
||||||
.flags = 0,
|
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
|
||||||
.pInheritanceInfo = nullptr
|
.pInheritanceInfo = nullptr
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1643,8 +1643,8 @@ void Vulkan::initNextSettings()
|
|||||||
|
|
||||||
features.features.geometryShader = true;
|
features.features.geometryShader = true;
|
||||||
|
|
||||||
feat11.uniformAndStorageBuffer16BitAccess = true;
|
feat11.uniformAndStorageBuffer16BitAccess = false;
|
||||||
feat11.storageBuffer16BitAccess = true;
|
feat11.storageBuffer16BitAccess = false;
|
||||||
|
|
||||||
VkDeviceCreateInfo infoDevice =
|
VkDeviceCreateInfo infoDevice =
|
||||||
{
|
{
|
||||||
@@ -1712,7 +1712,7 @@ void Vulkan::initNextSettings()
|
|||||||
{
|
{
|
||||||
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
|
||||||
.pNext = nullptr,
|
.pNext = nullptr,
|
||||||
.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT,
|
.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT,
|
||||||
.queueFamilyIndex = SettingsNext.QueueGraphics
|
.queueFamilyIndex = SettingsNext.QueueGraphics
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2225,6 +2225,15 @@ void Vulkan::gui_MainMenu() {
|
|||||||
|
|
||||||
void Vulkan::gui_ConnectedToServer() {
|
void Vulkan::gui_ConnectedToServer() {
|
||||||
if(Game.Session) {
|
if(Game.Session) {
|
||||||
|
|
||||||
|
if(!ImGui::Begin("MainMenu", nullptr, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::string text = std::to_string(ImGui::GetIO().Framerate);
|
||||||
|
ImGui::Text(text.c_str());
|
||||||
|
|
||||||
|
ImGui::End();
|
||||||
|
|
||||||
if(Game.Session->isConnected())
|
if(Game.Session->isConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -1205,19 +1205,23 @@ void VulkanRenderSession::drawWorld(GlobalTime gTime, float dTime, VkCommandBuff
|
|||||||
Pos::GlobalChunk x64offset = X64Offset >> Pos::Object_t::BS_Bit >> 4;
|
Pos::GlobalChunk x64offset = X64Offset >> Pos::Object_t::BS_Bit >> 4;
|
||||||
Pos::GlobalRegion x64offset_region = x64offset >> 2;
|
Pos::GlobalRegion x64offset_region = x64offset >> 2;
|
||||||
|
|
||||||
auto [voxelVertexs, nodeVertexs] = VKCTX->ThreadVertexObj.getChunksForRender(WorldId, Pos, 1, PCO.ProjView, x64offset_region);
|
auto [voxelVertexs, nodeVertexs] = VKCTX->ThreadVertexObj.getChunksForRender(WorldId, Pos, 2, PCO.ProjView, x64offset_region);
|
||||||
|
|
||||||
glm::mat4 orig = PCO.Model;
|
glm::mat4 orig = PCO.Model;
|
||||||
for(auto& [chunkPos, vertexs, vertexCount] : nodeVertexs) {
|
for(auto& [chunkPos, vertexs, vertexCount] : nodeVertexs) {
|
||||||
glm::vec3 cpos(chunkPos-x64offset);
|
glm::vec3 cpos(chunkPos-x64offset);
|
||||||
PCO.Model = glm::translate(orig, cpos*16.f);
|
PCO.Model = glm::translate(orig, cpos*16.f);
|
||||||
auto [vkBuffer, offset] = vertexs;
|
auto [vkBufferN, offset] = vertexs;
|
||||||
|
|
||||||
vkCmdPushConstants(drawCmd, MainAtlas_LightMap_PipelineLayout,
|
vkCmdPushConstants(drawCmd, MainAtlas_LightMap_PipelineLayout,
|
||||||
VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_GEOMETRY_BIT, offsetof(WorldPCO, Model), sizeof(WorldPCO::Model), &PCO.Model);
|
VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_GEOMETRY_BIT, offsetof(WorldPCO, Model), sizeof(WorldPCO::Model), &PCO.Model);
|
||||||
vkCmdBindVertexBuffers(drawCmd, 0, 1, &vkBuffer, &vkOffsets);
|
|
||||||
vkCmdDraw(drawCmd, vertexCount, 1, offset, 0);
|
|
||||||
|
|
||||||
|
if(vkBufferN != vkBuffer) {
|
||||||
|
vkBuffer = vkBufferN;
|
||||||
|
vkCmdBindVertexBuffers(drawCmd, 0, 1, &vkBuffer, &vkOffsets);
|
||||||
|
}
|
||||||
|
|
||||||
|
vkCmdDraw(drawCmd, vertexCount, 1, offset, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
PCO.Model = orig;
|
PCO.Model = orig;
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ Size=400,400
|
|||||||
|
|
||||||
[Window][MainMenu]
|
[Window][MainMenu]
|
||||||
Pos=0,0
|
Pos=0,0
|
||||||
Size=960,540
|
Size=1920,1142
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user