Commit 376614a
Flux (#12)
* Add FLUX.2 image generation support and texture reload functionality
- Introduced a new CMake option `USE_FLUX` to enable FLUX.2 image generation.
- Updated `CMakeLists.txt` to conditionally include the cflux2 library based on the new option.
- Added FLUX-related cvars and commands in `cl_main.c` for image generation control.
- Implemented `R_ReloadTexture` function in both OpenGL and Vulkan renderers to reload textures from disk.
- Enhanced documentation in `README.md` to include details about FLUX.2 image generation features and usage.
- Updated renderer initialization to support texture reload functionality across both OpenGL and Vulkan backends.
* Update README.md and cl_main.c for FLUX model variant support
- Enhanced README.md to clarify FLUX.2 and FLUX.1 image generation options, including support for different model variants.
- Modified cl_main.c to implement separate directories for FLUX model variants, improving organization and clarity in model path handling.
- Updated default FLUX model variant to "flux1-schnell" for better user experience.
* Add file existence check and improve FLUX model path handling
- Introduced a helper function `CL_FluxFileExists` to verify the existence of model files, enhancing error handling for model loading.
- Updated the logic in `CL_FluxGetModelPath` to check for the presence of the "flux2-dev" directory before falling back to the default "flux" directory, improving user experience and clarity.
- Enhanced asynchronous job initialization in `CL_FluxGenerate_f` to ensure all parameters are set before marking the job as running, preventing potential race conditions.
- Added warnings for missing FLUX.1 model files, guiding users to download them manually or switch to FLUX.2 if necessary.
* Add external FLUX CLI support and enhance error handling
- Implemented logic in `compile_engine.sh` to copy the `flux_cli` executable from the build directory to the release directory, improving deployment ease.
- Introduced new cvars in `cl_main.c` for external FLUX generation, allowing users to choose between in-process and external CLI execution, enhancing stability.
- Added helper functions for shell argument escaping and CLI path finding, improving command execution reliability.
- Enhanced error handling in the FLUX generation process to provide clearer feedback on failures, improving user experience.
* Add cflux2 source management to build workflow
- Introduced a new step in the GitHub Actions workflow to ensure the cflux2 sources are available by cloning the repository if the directory does not exist.
- This addition enhances the build process by automating the retrieval of necessary external dependencies, improving build reliability and consistency.
* Remove cflux2 source management steps from build workflow
- Eliminated redundant steps in the GitHub Actions workflow that ensured the availability of cflux2 sources by cloning the repository. This streamlines the build process and reduces unnecessary checks, as the sources are now assumed to be managed externally.
* Add cflux2 subproject as a Git submodule
- Introduced cflux2 as a new subproject, allowing for better management of external dependencies within the build system. This addition enhances the overall structure and maintainability of the project.
* Refactor GitHub Actions workflow to remove submodule checkout steps
- Eliminated redundant `submodules: recursive` options from the `actions/checkout@v4` steps in the build workflow. This streamlines the workflow by assuming that submodules are managed externally, improving build efficiency.
* add cflux2 sources
Co-authored-by: Cursor <cursoragent@cursor.com>
* skip flux build on Windows
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add SDL2 include and library paths to build workflow
- Updated the GitHub Actions build workflow to include SDL2 include and library paths, enhancing the configuration for projects that depend on SDL2. This change improves build accuracy and ensures that the necessary SDL2 resources are correctly referenced during the build process.
* Implement platform-specific memory mapping and file handling in safetensors
- Added Windows-specific file handling and memory mapping functions in `flux_safetensors.c` to support proper file operations on Windows systems.
- Introduced a new `safetensors_get_file_size` function for improved file size retrieval.
- Updated `safetensors_open` to handle file opening and memory mapping differently based on the platform, enhancing cross-platform compatibility.
- Modified `safetensors_file_t` structure to include handles for Windows-specific file management.
* Refactor cflux2 build conditions in CMakeLists.txt
- Updated the CMake configuration to always include the cflux2 subdirectory when USE_FLUX is enabled, removing the previous Windows-specific skip condition.
- Adjusted the linking of the cflux2 library to ensure it is only linked if the target exists, improving build robustness.
* Update CMakeLists.txt to use PRIVATE linkage for libraries
- Changed the linking of libraries in the CMake configuration to use PRIVATE visibility for qcommon, botlib, client, q3ui, OpenAL, and Vulkan/OpenGL. This improves encapsulation and ensures that these dependencies are not exposed to other targets, enhancing build integrity.
* Update CMakeLists.txt to enforce PRIVATE linkage for additional libraries
- Modified the CMake configuration to apply PRIVATE visibility for libraries linked to both the dedicated server and client executables, including qcommon, botlib, winmm, comctl32, ws2_32, and m. This change enhances encapsulation and ensures that these dependencies are not exposed to other targets, improving build integrity.
* Refactor memory mapping and cleanup in safetensors
- Renamed the memory mapping function to `safetensors_mmap_fd` for clarity and updated the handling of file size to use a 64-bit integer for compatibility.
- Introduced a new `safetensors_unmap` function to centralize unmapping and resource cleanup, improving code maintainability.
- Updated `safetensors_open` and `safetensors_close` to utilize the new unmap function, ensuring proper resource management across platforms.
* Enhance build configuration and code quality
- Updated the GitHub Actions build workflow to include the `-DCI_BUILD=OFF` flag for all CMake build commands, ensuring consistent behavior across different build types.
- Improved type safety in Vulkan renderer by casting size comparisons to `size_t` in `vk_vbo.c`, preventing potential overflow issues.
- Added clang diagnostic pragmas in `vm_aarch64.c` to suppress specific warnings, enhancing code clarity and maintainability.
- Refined conditional checks in `tr_world.c` to ensure proper type comparison for node contents, improving code robustness.
* Enhance CMake configuration and error handling
- Added SDL2::Core linkage and include directories for the client target in CMake, improving dependency management.
- Updated error messages in `flux.c` to limit the length of file paths displayed, enhancing clarity and preventing potential overflow issues.
- Improved file handling in `terminals.c` for Windows compatibility by conditionally using `mkstemp`, ensuring consistent behavior across platforms.
- Refactored type handling in `tr_surface.c`, `tr_vbo.c`, and `tr_world.c` to improve code safety and maintainability by using appropriate type casts and const qualifiers.
* Refactor CMake configuration and client code for SDL2 compatibility
- Enhanced CMakeLists.txt to conditionally include SDL2 directories based on availability, improving flexibility in build configurations.
- Added a static variable in cl_curl.c to prevent unused variable warnings when CURL is not used.
- Initialized jpeg_decompress_struct in cl_jpeg.c to zero for better safety.
- Updated cl_main.c to handle SDL thread management conditionally, ensuring proper cleanup and error handling in flux operations.
* Refactor error handling and code quality improvements
- Updated error messages in `flux.c` to shorten file path displays, enhancing clarity and preventing overflow issues.
- Changed static variable declaration to an enum in `cl_curl.c` for better type safety when CURL is not used.
- Added MSVC-specific pragmas in `psy.c` and `vorbisfile.c` to suppress warnings, improving code maintainability.
- Marked several functions in `vm_x86.c` as unused to prevent compiler warnings, enhancing code cleanliness.
* Enhance flux generation and CMake configuration
- Added conditional compilation for SDL support in `cl_main.c`, improving thread management for flux generation.
- Updated parameter logging in `CL_FluxGenerationThread` to use `long long` for seed values, enhancing precision.
- Modified CMakeLists.txt to improve shader header generation command and suppress specific compiler warnings for better compatibility across compilers.
- Added unused parameter suppression in JPEG handling files to clean up warnings and improve code quality.
* Add unused parameter suppression in JPEG and OGG codec files
* Refactor OGG codec and enhance flux CLI build configuration
- Changed the static variable declaration in `snd_codec_ogg.c` to an enum for better type safety.
- Updated `CMakeLists.txt` for `flux_cli` to conditionally include `linenoise.c` based on the platform, improving compatibility.
- Added custom `linenoise` implementation in `flux_cli.c` when `FLUX_CLI_NO_LINENOISE` is defined, enhancing flexibility in command line input handling.
- Improved type safety in `win_syscon.c` by casting buffer lengths to `size_t`, preventing potential overflow issues.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 29dc88b commit 376614a
94 files changed
Lines changed: 31970 additions & 91 deletions
File tree
- .github/workflows
- scripts
- src
- client
- external/src
- cflux2
- debug
- images
- test_vectors
- jpeg
- vorbis/lib
- qcommon
- renderers
- openglrenderer
- rendercommon
- vulkanrenderer
- shaders/spirv
- win32
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
| |||
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| 67 | + | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
201 | 199 | | |
202 | 200 | | |
203 | 201 | | |
204 | | - | |
205 | | - | |
206 | 202 | | |
207 | 203 | | |
208 | 204 | | |
| |||
213 | 209 | | |
214 | 210 | | |
215 | 211 | | |
| 212 | + | |
216 | 213 | | |
217 | 214 | | |
218 | 215 | | |
| |||
236 | 233 | | |
237 | 234 | | |
238 | 235 | | |
| 236 | + | |
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
| |||
277 | 275 | | |
278 | 276 | | |
279 | 277 | | |
280 | | - | |
281 | | - | |
282 | 278 | | |
283 | 279 | | |
284 | 280 | | |
| |||
328 | 324 | | |
329 | 325 | | |
330 | 326 | | |
331 | | - | |
332 | | - | |
333 | 327 | | |
334 | 328 | | |
335 | 329 | | |
| |||
339 | 333 | | |
340 | 334 | | |
341 | 335 | | |
| 336 | + | |
342 | 337 | | |
343 | 338 | | |
344 | 339 | | |
| |||
359 | 354 | | |
360 | 355 | | |
361 | 356 | | |
| 357 | + | |
362 | 358 | | |
363 | 359 | | |
364 | 360 | | |
| |||
396 | 392 | | |
397 | 393 | | |
398 | 394 | | |
399 | | - | |
400 | | - | |
401 | 395 | | |
402 | 396 | | |
403 | 397 | | |
| |||
410 | 404 | | |
411 | 405 | | |
412 | 406 | | |
| 407 | + | |
413 | 408 | | |
414 | 409 | | |
| 410 | + | |
| 411 | + | |
415 | 412 | | |
416 | 413 | | |
417 | 414 | | |
| |||
440 | 437 | | |
441 | 438 | | |
442 | 439 | | |
| 440 | + | |
443 | 441 | | |
444 | 442 | | |
| 443 | + | |
| 444 | + | |
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
178 | | - | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
189 | 195 | | |
190 | 196 | | |
191 | 197 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
310 | 320 | | |
311 | 321 | | |
312 | 322 | | |
313 | 323 | | |
314 | 324 | | |
315 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
316 | 330 | | |
317 | 331 | | |
318 | 332 | | |
319 | 333 | | |
320 | 334 | | |
321 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
322 | 344 | | |
| 345 | + | |
323 | 346 | | |
324 | 347 | | |
325 | | - | |
| 348 | + | |
326 | 349 | | |
327 | 350 | | |
328 | 351 | | |
| |||
466 | 489 | | |
467 | 490 | | |
468 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
469 | 498 | | |
470 | 499 | | |
471 | 500 | | |
| |||
505 | 534 | | |
506 | 535 | | |
507 | 536 | | |
508 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
509 | 544 | | |
510 | 545 | | |
511 | | - | |
| 546 | + | |
512 | 547 | | |
513 | 548 | | |
514 | 549 | | |
| |||
520 | 555 | | |
521 | 556 | | |
522 | 557 | | |
523 | | - | |
| 558 | + | |
524 | 559 | | |
525 | | - | |
| 560 | + | |
526 | 561 | | |
527 | 562 | | |
528 | 563 | | |
529 | 564 | | |
530 | 565 | | |
531 | 566 | | |
532 | | - | |
| 567 | + | |
533 | 568 | | |
534 | 569 | | |
535 | 570 | | |
536 | 571 | | |
537 | 572 | | |
538 | 573 | | |
539 | 574 | | |
540 | | - | |
541 | | - | |
| 575 | + | |
| 576 | + | |
542 | 577 | | |
543 | | - | |
544 | | - | |
| 578 | + | |
| 579 | + | |
545 | 580 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | | - | |
20 | | - | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | 34 | | |
34 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
189 | 202 | | |
190 | 203 | | |
191 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1147 | 1147 | | |
1148 | 1148 | | |
1149 | 1149 | | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
0 commit comments