diff --git a/.gitea/workflows/ci_meson.yaml b/.gitea/workflows/ci_meson.yaml index 6ce30c3..a26d195 100644 --- a/.gitea/workflows/ci_meson.yaml +++ b/.gitea/workflows/ci_meson.yaml @@ -37,6 +37,7 @@ jobs: chmod +x ./scripts/download_dxc_cross.sh ./scripts/download_dxc_cross.sh meson setup --cross-file scripts/x86_64-w64-mingw32.txt -Db_sanitize=none build + cd build && meson devenv && cd .. - name: Compile run: meson compile -C build - name: Run Tests diff --git a/meson.build b/meson.build index dd98c2f..d7c999d 100644 --- a/meson.build +++ b/meson.build @@ -58,7 +58,8 @@ if build_machine.system() == 'linux' and host_machine.system() == 'windows' message('Adding /usr/share/mingw-w64/include to the project include path.') add_project_arguments(['-isystem/usr/share/mingw-w64/include', '-DRT_CROSS_LINUX_WINDOWS', - '-D_WIN32_WINNT=0x600'], + '-D_WIN32_WINNT=0x600', + '-lgcc'], language: ['c', 'cpp'], native: false) endif @@ -133,13 +134,3 @@ if get_option('game_as_subdir') endforeach endif -# For Cross builds, we need libgcc from mingw -if build_machine.system() == 'linux' and host_machine.system() == 'windows' - custom_target('copy libgcc', - input : '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libgcc_s_seh-1.dll', - output : 'libgcc_s_seh-1.dll', - command : [copy_util, '@INPUT@', '@OUTPUT@'], - build_by_default : true) -endif - - diff --git a/src/experimental/meshlets/meshlet_generator.cpp b/src/experimental/meshlets/meshlet_generator.cpp index c98d0de..329482b 100644 --- a/src/experimental/meshlets/meshlet_generator.cpp +++ b/src/experimental/meshlets/meshlet_generator.cpp @@ -1,9 +1,15 @@ #include + +#ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4530) +#endif + #define TINYOBJLOADER_IMPLEMENTATION #include +#ifdef _MSC_VER #pragma warning(pop) +#endif #include "meshlet_generator.hpp" #include @@ -281,4 +287,4 @@ rt_result meshlet_generator::RunHierarchical(uint32_t mesh_idx, uint32_t *out_ro // vertex *vertices = new vertex[MESHLET_VERTICES * 8]; } return RT_SUCCESS; -} \ No newline at end of file +} diff --git a/src/experimental/meshlets/meshlet_renderer.cpp b/src/experimental/meshlets/meshlet_renderer.cpp index 27620da..1357512 100644 --- a/src/experimental/meshlets/meshlet_renderer.cpp +++ b/src/experimental/meshlets/meshlet_renderer.cpp @@ -98,7 +98,7 @@ shader shader::CompileFile(const char *compute_path) { fclose(f); sh = CompileSource(buf); - delete buf; + delete[] buf; return sh; } @@ -386,4 +386,4 @@ void meshlet_renderer::SettingMenu() { ImGui::InputFloat3("Target", sett->target); ImGui::End(); } -} \ No newline at end of file +} diff --git a/src/experimental/meshlets/meson.build b/src/experimental/meshlets/meson.build index 140614f..b7958ab 100644 --- a/src/experimental/meshlets/meson.build +++ b/src/experimental/meshlets/meson.build @@ -1,6 +1,6 @@ glfw_proj = subproject('glfw', default_options: ['default_library=static', 'b_sanitize=none']) glfw_dep = glfw_proj.get_variable('glfw_dep') -imgui_proj = subproject('imgui') +imgui_proj = subproject('imgui', default_options: ['warning_level=0', 'werror=false']) imgui_dep = imgui_proj.get_variable('imgui_dep') glm_proj = subproject('glm') glm_dep = glm_proj.get_variable('glm_dep') @@ -15,4 +15,4 @@ executable('meshlet_experiment', extra_files: ['flat_cull.glsl', 'hierarchical_cull.glsl'], include_directories: [engine_incdir, contrib_incdir], dependencies: [m_dep, meshoptimizer_dep, glfw_dep, imgui_dep, glm_dep], - link_with: runtime_lib) \ No newline at end of file + link_with: runtime_lib) diff --git a/src/runtime/cross_sal.h b/src/runtime/cross_sal.h index 7f24675..96ca2cd 100644 --- a/src/runtime/cross_sal.h +++ b/src/runtime/cross_sal.h @@ -9,9 +9,20 @@ #pragma warning Are you sure that you want to include this file ? #endif +#ifndef _Maybenull_ #define _Maybenull_ +#endif + +#ifndef _In_opt_count_ #define _In_opt_count_(n) +#endif + +#ifndef _In_bytecount_ #define _In_bytecount_(n) +#endif + +#ifndef _In_count_ #define _In_count_(n) +#endif #endif