*
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user