Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,20 @@ ninja
./FunGame <args>
gprof ./FunGame gmon.out | gprof2dot | dot -Tsvg -o output.svg
```
Don't know how to turn this off though

To turn off
```sh
rm -rf build # or
cmake --fresh
```

gprof doesn't work with multi-threading. For that we can use perf.

```sh
perf record -ag ./FunGame Start # or any other commands

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also gprofng, but honestly perf is great

https://www.redhat.com/en/blog/perf-vs-gprofng

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll look into that when I need to start profiling again.

perf script report flamegraph # this will ask to download something
firefox flamegraph.html
```

## Formatting

POSIX shells only
Expand Down
4 changes: 2 additions & 2 deletions src/util/mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class Mesh {
template <voxel_utility::VoxelLike T>
std::optional<std::vector<Vertex>>
analyze_voxel_interface(
T voxel_object, VoxelOffset position, VoxelOffset major_direction,
const T& voxel_object, VoxelOffset position, VoxelOffset major_direction,
VoxelOffset minor_direction_1, VoxelOffset minor_direction_2
) {
VoxelColorId voxel_a = voxel_object.get_voxel_color_id(position);
Expand Down Expand Up @@ -279,7 +279,7 @@ for dimension (x,y,z direction)
*/
template <voxel_utility::VoxelLike T>
Mesh
ambient_occlusion_mesher(T voxel_object) {
ambient_occlusion_mesher(const T& voxel_object) {
std::vector<uint16_t> indicies;
std::vector<VoxelOffset> indexed_vertices;
std::vector<MatColorId> indexed_colors;
Expand Down
2 changes: 1 addition & 1 deletion src/util/voxel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class VoxelObject : VoxelBase {
* @return VoxelSize length in x, y, z
*/
[[nodiscard]] inline VoxelSize
get_size() noexcept {
get_size() const noexcept {
return size_;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/world/terrain/chunk.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class ChunkData : public voxel_utility::VoxelBase {
* @return VoxelSize vector of Chunk::SIZE
*/
[[nodiscard]] inline VoxelSize
get_size() {
get_size() const {
return {Chunk::SIZE, Chunk::SIZE, Chunk::SIZE};
}

Expand Down
Loading