From 2bdc232cbc59bc35bf44c3170a1f0ea0269a8383 Mon Sep 17 00:00:00 2001 From: HrishabhMittal Date: Wed, 25 Feb 2026 16:32:33 +0530 Subject: [PATCH] fix build errors on linux, update README.md with correct instructions --- .gitignore | 3 ++- README.md | 14 +++++++++----- Triton/compile.sh | 0 Triton/src/uniformBuffers/uniformBuffers.cpp | 3 ++- compile.sh | 0 include/core/core.hpp | 6 +++--- premake5.lua | 5 +++++ run.sh | 0 src/core/ComputeTexture.cpp | 3 ++- src/core/core.cpp | 3 ++- 10 files changed, 25 insertions(+), 12 deletions(-) mode change 100644 => 100755 Triton/compile.sh mode change 100644 => 100755 compile.sh mode change 100644 => 100755 run.sh diff --git a/.gitignore b/.gitignore index a43d9ce..bf46142 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ bin bin-int compile_commands FluidSim.make +Triton.make compile_commands.json Makefile .cache @@ -9,4 +10,4 @@ Makefile *.vcxproj *.sln .vs -Models \ No newline at end of file +Models diff --git a/README.md b/README.md index 3bcea12..fa62daa 100644 --- a/README.md +++ b/README.md @@ -55,25 +55,29 @@ This project implements a real-time fluid simulation using Vulkan compute shader 3. **Compile shaders:** ```bash + # from project root cd Triton ./compile.sh + premake5 gmake + make cd .. ``` 4. **Build the project:** ```bash - mkdir build - cd build - cmake .. + # from project root + ./compile.sh + premake5 gmake make + run.sh ``` ## Usage -Run the compiled binary from the `build` directory: +Run the compiled binary using the run script ```bash -./FluidSim +./run.sh ``` ## Code Structure diff --git a/Triton/compile.sh b/Triton/compile.sh old mode 100644 new mode 100755 diff --git a/Triton/src/uniformBuffers/uniformBuffers.cpp b/Triton/src/uniformBuffers/uniformBuffers.cpp index c15a324..23f5983 100644 --- a/Triton/src/uniformBuffers/uniformBuffers.cpp +++ b/Triton/src/uniformBuffers/uniformBuffers.cpp @@ -1,5 +1,6 @@ #include #include +#include #define GLM_FORCE_RADIANS #define GLM_FORCE_DEPTH_ZERO_TO_ONE #define GLM_FORCE_LEFT_HANDED @@ -187,4 +188,4 @@ namespace Triton { } } -} \ No newline at end of file +} diff --git a/compile.sh b/compile.sh old mode 100644 new mode 100755 diff --git a/include/core/core.hpp b/include/core/core.hpp index cebef84..14c6394 100644 --- a/include/core/core.hpp +++ b/include/core/core.hpp @@ -50,7 +50,7 @@ namespace Core { void createComputeDescriptorSets(); void createComputeUniformBuffers(); - std::vector FluidSim::readFile(const std::string& filename); + std::vector readFile(const std::string& filename); void createAllComputePipelines(); void destroyAllComputePipelines(); void createComputePipeline(); @@ -85,7 +85,7 @@ namespace Core { glm::vec2 mousePos = { 0,0 }; - std::chrono::steady_clock::time_point prevTime = std::chrono::high_resolution_clock::now(); + std::chrono::high_resolution_clock::time_point prevTime = std::chrono::high_resolution_clock::now(); FluidSim() = default; @@ -95,4 +95,4 @@ namespace Core { }; } -#endif \ No newline at end of file +#endif diff --git a/premake5.lua b/premake5.lua index 19ed38f..e159867 100644 --- a/premake5.lua +++ b/premake5.lua @@ -34,6 +34,7 @@ workspace "FluidSimulation" includedirs { "include", -- Project headers (core/, renderer/) "vendor", + "Triton/include" } -- Link system-installed libraries (e.g., GLFW, OpenGL, GLEW) @@ -41,6 +42,10 @@ workspace "FluidSimulation" links { "vulkan", "glfw", -- GLFW + "Triton" + } + libdirs { + "Triton/bin/" .. outputdir .. "/Triton" } defines { "PLATFORM_LINUX" } diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 diff --git a/src/core/ComputeTexture.cpp b/src/core/ComputeTexture.cpp index 77a3f10..8f9daac 100644 --- a/src/core/ComputeTexture.cpp +++ b/src/core/ComputeTexture.cpp @@ -1,5 +1,6 @@ #include #include +#include #include namespace Core { @@ -105,4 +106,4 @@ namespace Core { vkDestroyImage(*m_device, m_image, nullptr); vkFreeMemory(*m_device, m_memoryRequirements, nullptr); } -} \ No newline at end of file +} diff --git a/src/core/core.cpp b/src/core/core.cpp index 89573e8..10f0a9d 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -575,4 +576,4 @@ namespace Core { } -} \ No newline at end of file +}