summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BUILD.md52
-rw-r--r--TODO.md4
-rw-r--r--src/gpu/gpu.h4
3 files changed, 60 insertions, 0 deletions
diff --git a/BUILD.md b/BUILD.md
new file mode 100644
index 0000000..1217745
--- /dev/null
+++ b/BUILD.md
@@ -0,0 +1,52 @@
+# Building the Project with Xcode
+
+This document provides instructions for building the 64k Demo project using Xcode on macOS.
+
+## Prerequisites
+
+- **Xcode:** Ensure you have Xcode installed. You can download it from the Mac App Store.
+- **CMake:** This project uses CMake as its build system. Ensure CMake is installed on your system.
+
+## Build Steps
+
+1. **Open Terminal:** Navigate to the root directory of the project (`/Users/skal/demo`).
+
+2. **Create Build Directory:** It is recommended to build out-of-source. Create a build directory:
+ ```bash
+ mkdir build
+ cd build
+ ```
+
+3. **Configure with CMake for Xcode:** Generate the Xcode project files using CMake. For Xcode, you typically specify the generator as `Xcode`.
+ ```bash
+ cmake .. -G "Xcode"
+ ```
+ This command will configure the project and create an `.xcodeproj` file within the `build` directory.
+
+4. **Open Xcode Project:** Open the generated `.xcodeproj` file in Xcode:
+ ```bash
+ open YourProjectName.xcodeproj
+ ```
+ (Replace `YourProjectName.xcodeproj` with the actual name of the generated project file, usually `demo.xcodeproj` or similar).
+
+5. **Build and Run in Xcode:**
+ * Select your desired target (e.g., `demo64k`, `test_3d_render`).
+ * Choose a build scheme (e.g., `Debug` or `Release`).
+ * Click the "Run" button (or press `Cmd+R`) to build and launch the application.
+
+## GPU Performance Capture (Future Task)
+
+To enable future GPU performance analysis, a conditional compilation macro `ENABLE_GPU_PERF_CAPTURE` can be defined. This can be controlled via CMake build types or specific flags when configuring the project:
+
+```bash
+# Example of defining the macro via CMake (add to CMakeLists.txt)
+# if (MY_GPU_PERF_BUILD)
+# target_compile_definitions(demo64k PRIVATE ENABLE_GPU_PERF_CAPTURE=1)
+# endif
+```
+
+This macro can then be used within the code (e.g., in `gpu.h` or `platform.h`) to conditionally compile performance monitoring or capture code.
+
+## Shader Performance Analysis Task
+
+For detailed shader performance analysis on macOS, **Xcode's Metal debugger** is the recommended tool. A task has been added to `TODO.md` to integrate this into our workflow for future optimization efforts.
diff --git a/TODO.md b/TODO.md
index 8b5651d..f0c16ae 100644
--- a/TODO.md
+++ b/TODO.md
@@ -24,6 +24,10 @@ This file tracks prioritized tasks with detailed attack plans.
- [ ] **Task #5: Spectrogram Editor**: Web-based visual tool for extreme audio compression.
- [ ] **Task #18: 3D System Enhancements**: Blender exporter and GPU-based BVH for complex scenes.
- [ ] **Task #22: Windows Native Platform**: Replace GLFW with direct Win32 API calls for the final 64k push.
+- [ ] **Task #23: Shader Performance Analysis**: Analyze shader performance using Xcode Metal debugger on macOS.
+
+## Phase 2: Advanced Size Optimization
+- [ ] **Task #8**: Implement Final Build Stripping
## Recently Completed
- [x] **WGSL Library (Task 21.1)**: Implemented ShaderComposer for modular WGSL snippet management.
diff --git a/src/gpu/gpu.h b/src/gpu/gpu.h
index 3aff729..f25d242 100644
--- a/src/gpu/gpu.h
+++ b/src/gpu/gpu.h
@@ -106,6 +106,10 @@ void gpu_simulate_until(float time);
#endif
void gpu_shutdown();
+// Placeholder for GPU performance capture.
+// This define can be controlled via CMake to conditionally enable profiling code.
+// #define ENABLE_GPU_PERF_CAPTURE
+
// Helper functions (exposed for internal/future use)
struct ResourceBinding {
GpuBuffer buffer;