This commit is contained in:
2025-08-16 18:35:58 +06:00
parent c9b9d4e296
commit 4b05246e29
4 changed files with 24 additions and 11 deletions

View File

@@ -67,7 +67,7 @@ set(Boost_USE_STATIC_LIBS ON)
set(BOOST_INCLUDE_LIBRARIES asio thread json)
set(BOOST_ENABLE_CMAKE 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(
Boost
GIT_REPOSITORY https://github.com/boostorg/boost.git
@@ -76,7 +76,7 @@ FetchContent_Declare(
USES_TERMINAL_DOWNLOAD true
)
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
# find_package(glm REQUIRED)

View File

@@ -251,7 +251,7 @@ void Vulkan::run()
{
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
.pNext = nullptr,
.flags = 0,
.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT,
.pInheritanceInfo = nullptr
};
@@ -1643,8 +1643,8 @@ void Vulkan::initNextSettings()
features.features.geometryShader = true;
feat11.uniformAndStorageBuffer16BitAccess = true;
feat11.storageBuffer16BitAccess = true;
feat11.uniformAndStorageBuffer16BitAccess = false;
feat11.storageBuffer16BitAccess = false;
VkDeviceCreateInfo infoDevice =
{
@@ -1712,7 +1712,7 @@ void Vulkan::initNextSettings()
{
.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO,
.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
};
@@ -2225,6 +2225,15 @@ void Vulkan::gui_MainMenu() {
void Vulkan::gui_ConnectedToServer() {
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())
return;

View File

@@ -1205,19 +1205,23 @@ void VulkanRenderSession::drawWorld(GlobalTime gTime, float dTime, VkCommandBuff
Pos::GlobalChunk x64offset = X64Offset >> Pos::Object_t::BS_Bit >> 4;
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;
for(auto& [chunkPos, vertexs, vertexCount] : nodeVertexs) {
glm::vec3 cpos(chunkPos-x64offset);
PCO.Model = glm::translate(orig, cpos*16.f);
auto [vkBuffer, offset] = vertexs;
auto [vkBufferN, offset] = vertexs;
vkCmdPushConstants(drawCmd, MainAtlas_LightMap_PipelineLayout,
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;

View File

@@ -4,5 +4,5 @@ Size=400,400
[Window][MainMenu]
Pos=0,0
Size=960,540
Size=1920,1142