Commit c213acc1 authored by Shu's avatar Shu 🍠
Browse files

Tracy update

parent 3020cd7c
{
"version": "0.2.0",
"configurations": [
{
"name": "Run (gdb)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/univerxel",
"args": [],
"preLaunchTask": "Build info",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Activer l'impression en mode Pretty pour gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Run (gdb debug)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/univerxel",
"args": [],
"preLaunchTask": "Build debug",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Activer l'impression en mode Pretty pour gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Run server (gdb)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/univerxel-server",
"args": ["server.toml"],
"preLaunchTask": "Build server",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Activer l'impression en mode Pretty pour gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
{
"name": "Run server (gdb debug)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/univerxel-server",
"args": ["server.toml"],
"preLaunchTask": "Build debug server",
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Activer l'impression en mode Pretty pour gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
\ No newline at end of file
{
"version": "2.0.0",
"tasks": [
{
"label": "clear",
"type": "shell",
"command": "rm -r ${workspaceRoot}/build && mkdir ${workspaceRoot}/build"
},
{
"label": "cmake",
"type": "shell",
"command": "cmake",
"args": ["-DFIXED_WINDOW=1", ".."],
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "cmake info",
"type": "shell",
"command": "cmake",
"args": ["-DFIXED_WINDOW=1", "-DCMAKE_BUILD_TYPE=RelWithDebInfo", ".."],
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "cmake debug",
"type": "shell",
"command": "cmake",
"args": ["-DFIXED_WINDOW=1", "-DCMAKE_BUILD_TYPE=Debug", ".."],
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "make",
"type": "shell",
"command": "make",
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "make server",
"type": "shell",
"command": "make",
"args": ["univerxel-server"],
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "exec",
"type": "shell",
"command": "./univerxel",
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "exec memcheck",
"type": "shell",
"command": "valgrind --leak-check=full --show-leak-kinds=all --fair-sched=yes ./univerxel",
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "exec helgrind",
"type": "shell",
"command": "valgrind --tool=helgrind --fair-sched=yes ./univerxel",
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "exec callgrind",
"type": "shell",
"command": "valgrind --tool=callgrind --simulate-cache=yes --fair-sched=yes ./univerxel",
"options": {
"cwd": "${workspaceRoot}/build"
}
},
{
"label": "Build",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["cmake", "make"]
},
{
"label": "Build info",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["cmake info", "make"]
},
{
"label": "Build debug",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["cmake debug", "make"]
},
{
"label": "Build server",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["cmake", "make server"]
},
{
"label": "Build debug server",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["cmake debug", "make server"]
},
{
"label": "Rebuild",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["clear", "Build"]
},
{
"label": "Run",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["Build", "exec"]
},
{
"label": "Run valgrind",
"group": "build",
"dependsOrder": "sequence",
"dependsOn": ["Build debug", "exec memcheck"]
},
{
"label": "Dependencies",
"type": "shell",
"command": ["~/Téléchargements/cinclude2dot.pl", "--paths", "--include ../include/zstd/dictBuilder,../include/zstd,/usr/include/c++/10.2.0,../include/robin_hood,../include/imgui,../include/meshoptimizer,../include,../include/tracy,../include/gl3w,../include/FastNoiseSIMD", ">", "../build/dep.dot"],
"options": {
"cwd": "${workspaceRoot}/src",
}
}
]
}
\ No newline at end of file
......@@ -8,10 +8,13 @@ option(USE_FMA "Use fma" 1)
option(LOG_DEBUG "Show debug logs" 0)
option(LOG_TRACE "Show trace logs" 0)
option(NATIVE "Build with -march=native" 0)
option(IPO "Link time optimisation" 1)
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
else(CCACHE_FOUND)
#TODO: set(CMAKE_UNITY_BUILD ON)
endif(CCACHE_FOUND)
add_subdirectory("deps/glfw")
......@@ -23,6 +26,7 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if(IPO)
include(CheckIPOSupported)
check_ipo_supported(RESULT IPO_OK OUTPUT IPO_ERROR)
if(IPO_OK)
......@@ -31,12 +35,13 @@ if(IPO_OK)
else()
message(STATUS "IPO / LTO not supported: <${IPO_ERROR}>")
endif()
endif()
if(MSVC)
add_definitions(/std:c++latest)
add_compile_definitions(WIN32_LEAN_AND_MEAN=)
else()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
#FIXME: by target set(CMAKE_CXX_FLAGS "-Wall -Wextra")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
......
......@@ -87,7 +87,7 @@ git lfs clone --recursive https://framagit.org/univerxel/univerxel.git
```sh
mkdir build && cd build
```
3. Build CMake
3. Setup CMake
```sh
cmake <options> ..
```
......@@ -104,9 +104,9 @@ LOG_DEBUG | Debug logs | `0`
LOG_TRACE | Trace logs | `0`
NATIVE | Optimize for native CPU | `0`
1. Build Make
1. Compile
```sh
make -j<process count> <target>
cmake --build . --parallel --target <target>
```
Target | Description
......@@ -159,4 +159,4 @@ Distributed under the MIT License. See [LICENSE](LICENSE) for more information.
Shu - [/me](https://git.wadza.fr/me) - me@wadza.fr
[Public releases](https://framagit.org/univerxel/univerxel) - [Working repo](https://git.wadza.fr/me/univerxel)
[Public repository](https://framagit.org/univerxel/univerxel)
# Milestones
## Hello screen again
- [x] Extract OpenGL
- [x] Minimal Vulkan
- [x] ImGui
## Hello other
- [x] Multiplayer
- [~] Chat
- Private messages
- [~] Authentication
- [x] Compression
- [x] Encryption
- [x] Embedded
- [x] Standalone
## Hello world
- [~] Map stream
- [ ] Local prediction
- [ ] Contouring service
- [~] Edit
- [ ] Compression (raw)
- [x] Shape iterators
- [ ] Anchor
- [x] Prevent suffocation
- [x] Local prediction
- [~] Occlusion Culling
- [~] Iterator ray
- [ ] Cast from chunk center
- [x] Transparency
- [~] Entities
- [ ] Collide
- [x] Get models
- [ ] Save in world
- [ ] Rotate
- [ ] Reduce compile unit count
- [~] Review documentation
- [ ] Clean kick
Released as `0.0.1`: `Pre alpha 1`
## Hello universe
- [ ] From the ground up cleanup
## System
- [~] Dependencies updater
- [x] Tracy
- [ ] ImGui
- Compile time
- [ ] Warnings
- [ ] Unit build
- [ ] Ninga
- [ ] Clang
- [x] CI build
- [x] CMake package
- [x] GitLab CI
- Platfoms
- Platforms
- [x] Linux
- [x] Windows
- Mingw: requires picotls, picoquic and FastNoise compatibility
- [ ] MacOS
- [ ] Universe
- [ ] Launcher / Updater
- [ ] Review documentation
- [ ] Code cleanup
- [ ] Proper wiki
- [ ] Yaml config
- [ ] I18L
## Data
- [ ] Element hierarchy
- [ ] Collide
- [ ] Soft part break
- [ ] Relative position
- [ ] Rotate
- [ ] Merge World and Entities
- [ ] Galaxy
- [ ] Rotation
- [ ] Orbit system
- [ ] Gravity referential
- [ ] Better generation
- SIMD
- [ ] Dynamic SIMD libs
- [ ] FastNoiseSIMD / HastyNoise double precision
- [ ] https://github.com/Auburn/FastNoise2/releases
- [ ] Surface features
- [ ] Biomes
- https://imgur.com/kM8b5Zq
- https://imgur.com/a/bh2iy
- https://speciesdevblog.files.wordpress.com/2012/11/biomemap.png
- [ ] Planet scale LOD
- [~] Curvature
- [~] CubeSphere
- Edits
- [ ] More shapes
- [ ] Anchor
- [ ] Multi-block system
- [ ] Cross chunk structure
- Generation
- SIMD
- [ ] Dynamic SIMD level libs
- [ ] https://github.com/Auburn/FastNoise2/releases
- [ ] Double precision
- [ ] Surface features
- [ ] Biomes
- https://imgur.com/kM8b5Zq
- https://imgur.com/a/bh2iy
- https://speciesdevblog.files.wordpress.com/2012/11/biomemap.png
- [ ] ECS
- [ ] Inventory
- [ ] Octree
- [ ] Surface aware LOD
- [ ] Level converter
- [ ] Minecraft import
- [ ] Base unit size change
- [ ] Local generation prediction
- [ ] Modding API
## Graphics
- [ ] Disable VK for now
- [ ] Slash screen
- [ ] Proper UI
- [ ] Pause menu
- [ ] Start menu
- [ ] Using texture pack
- [ ] FontAwesome (https://github.com/juliettef/IconFontCppHeaders)
- [ ] Define standard unit size
- Visual debug
- [ ] Chunk / Region border
- [ ] Area box
- [ ] Collision overview
- [ ] Effective occlusion culling
- [ ] Cast from chunk center
- Curvature
- CubeSphere
- [ ] Area corrected CubeSphere
- [ ] Corrected Normals
- [ ] Surface curvature
- [ ] Curvature avare frustum
- [ ] Curvature aware frustum
- [ ] Healpix
## Hello industry
- [ ] Multiblock
- [ ] Inventory
### Raster
## Hello darkness
- [ ] Launcher / Updater
- [ ] Break area part to entity
- [ ] Slash screen
- [ ] Start/Pause menu
- [x] QUIC protocol
- https://www.iquilezles.org/www/index.htm
- [~] 8 for 1 contouring problem
- [ ] Use in memory protocol (to replace server_handle)
- [ ] Remove SharedUniverse
- [ ] Octree
- [ ] Better Lod
- [ ] VK
- [ ] Instanced draw
- [ ] Pipeline cache
- [ ] Reuse descriptors
- [ ] Secondary buffers
- [ ] ECS
- [ ] Cross plateforme encoding
- [ ] Config (yaml)
- [ ] Merge stochastic and triplanar
- https://assetstore.unity.com/packages/tools/terrain/microsplat-96478
- https://www.youtube.com/user/slipster216/videos
- [ ] Biplanar
- Stochastic
- [ ] Distance resampling
- [ ] Tesselation
- [ ] Planet scale LOD (using chunk level average)
- [ ] Hard shadow
- [ ] Ambiant occlusion
- [ ] World lights
- [ ] HDR
- https://www.youtube.com/watch?v=iikdcAA7cww
- Toon shading
......@@ -112,8 +118,22 @@
- [ ] Procedural Skybox
- [ ] Deferred
- [ ] Cascaded shadow maps
- [ ] Ray Tracing
- [ ] Avoid transparent back-face
- [ ] Translucency
- Back face Depth based
- [ ] I18L
- Back-face depth based
- [ ] Contouring service
### Ray
- All of it
- Probably v2
## Network
- [x] QUIC protocol
- [ ] Use in memory protocol
- replace server_handle
- [ ] Private messages
- [ ] Commands
- [~] Authentication
- [ ] Clean kick
#!/usr/bin/env bash
BASEDIR=$(dirname "$0")
cd $BASEDIR
FILES=$(ls)
git clone https://github.com/wolfpld/tracy .up
cd .up
TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Apply tag $TAG"
git checkout $TAG
cp -rf $FILES ..
cd ..
rm */*.mk
rm -rf .up
echo "Done"
\ No newline at end of file
......@@ -34,6 +34,11 @@ typedef const void* TracyCZoneCtx;
#define TracyCSecureAlloc(x,y)
#define TracyCSecureFree(x)
#define TracyCAllocN(x,y,z)
#define TracyCFreeN(x,y)
#define TracyCSecureAllocN(x,y,z)
#define TracyCSecureFreeN(x,y)
#define TracyCFrameMark
#define TracyCFrameMarkNamed(x)
#define TracyCFrameMarkStart(x)
......@@ -57,6 +62,11 @@ typedef const void* TracyCZoneCtx;
#define TracyCSecureAllocS(x,y,z)
#define TracyCSecureFreeS(x,y)
#define TracyCAllocNS(x,y,z,w)
#define TracyCFreeNS(x,y,z)
#define TracyCSecureAllocNS(x,y,z,w)
#define TracyCSecureFreeNS(x,y,z)
#define TracyCMessageS(x,y,z)
#define TracyCMessageLS(x,y)
#define TracyCMessageCS(x,y,z,w)
......@@ -138,6 +148,11 @@ TRACY_API void ___tracy_emit_messageLC( const char* txt, uint32_t color, int cal
# define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 1 )
# define TracyCSecureFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 1 )
# define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 0, name )
# define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 0, name )
# define TracyCSecureAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 1, name )
# define TracyCSecureFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 1, name )
# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, TRACY_CALLSTACK );
# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, TRACY_CALLSTACK );
# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, TRACY_CALLSTACK );
......@@ -148,6 +163,11 @@ TRACY_API void ___tracy_emit_messageLC( const char* txt, uint32_t color, int cal
# define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size, 1 );
# define TracyCSecureFree( ptr ) ___tracy_emit_memory_free( ptr, 1 );
# define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_named( ptr, size, 0, name );
# define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_named( ptr, 0, name );
# define TracyCSecureAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_named( ptr, size, 1, name );
# define TracyCSecureFreeN( ptr, name ) ___tracy_emit_memory_free_named( ptr, 1, name );
# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 );
# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 );
# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 );
......@@ -185,6 +205,11 @@ TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size );
# define TracyCSecureAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 1 )
# define TracyCSecureFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 1 )
# define TracyCAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 0, name )
# define TracyCFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 0, name )
# define TracyCSecureAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 1, name )
# define TracyCSecureFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 1, name )
# define TracyCMessageS( txt, size, depth ) ___tracy_emit_message( txt, size, depth );
# define TracyCMessageLS( txt, depth ) ___tracy_emit_messageL( txt, depth );
# define TracyCMessageCS( txt, size, color, depth ) ___tracy_emit_messageC( txt, size, color, depth );
......@@ -200,6 +225,11 @@ TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size );
# define TracyCSecureAllocS( ptr, size, depth ) TracyCSecureAlloc( ptr, size )
# define TracyCSecureFreeS( ptr, depth ) TracyCSecureFree( ptr )
# define TracyCAllocNS( ptr, size, depth, name ) TracyCAllocN( ptr, size, name )
# define TracyCFreeNS( ptr, depth, name ) TracyCFreeN( ptr, name )
# define TracyCSecureAllocNS( ptr, size, depth, name ) TracyCSecureAllocN( ptr, size, name )
# define TracyCSecureFreeNS( ptr, depth, name ) TracyCSecureFreeN( ptr, name )
# define TracyCMessageS( txt, size, depth ) TracyCMessage( txt, size )
# define TracyCMessageLS( txt, depth ) TracyCMessageL( txt )
# define TracyCMessageCS( txt, size, color, depth ) TracyCMessageC( txt, size, color )
......
......@@ -30,6 +30,21 @@
# include <cxxabi.h>
#endif
#ifdef TRACY_DBGHELP_LOCK
# include "TracyProfiler.hpp"
# define DBGHELP_INIT TracyConcat( TRACY_DBGHELP_LOCK, Init() )
# define DBGHELP_LOCK TracyConcat( TRACY_DBGHELP_LOCK, Lock() );
# define DBGHELP_UNLOCK TracyConcat( TRACY_DBGHELP_LOCK, Unlock() );
extern "C"
{
void DBGHELP_INIT;
void DBGHELP_LOCK;
void DBGHELP_UNLOCK;
};
#endif
namespace tracy
{
......@@ -94,6 +109,11 @@ void InitCallstack()
{
RtlWalkFrameChain = (t_RtlWalkFrameChain)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlWalkFrameChain" );
#ifdef TRACY_DBGHELP_LOCK
DBGHELP_INIT;
DBGHELP_LOCK;
#endif
SymInitialize( GetCurrentProcess(), nullptr, true );
SymSetOptions( SYMOPT_LOAD_LINES );
......@@ -135,6 +155,10 @@ void InitCallstack()
}
}
#endif
#ifdef TRACY_DBGHELP_LOCK
DBGHELP_UNLOCK;
#endif
}
TRACY_API uintptr_t* CallTrace( int depth )
......@@ -155,6 +179,9 @@ const char* DecodeCallstackPtrFast( uint64_t ptr )
si->SizeOfStruct = sizeof( SYMBOL_INFO );
si->MaxNameLen = MaxNameSize;