16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00

Enable AVX2 support

This commit is contained in:
2026-05-06 20:02:00 +02:00
parent cde62d42e3
commit 02cffbe4ad
2 changed files with 12 additions and 1 deletions

View File

@@ -81,6 +81,7 @@ option(WITH_BETTER_RENDERER "Experimental multi-backend renderer based on NVRHI"
option(GENERATE_PDB "Generate executable with program debugging symbols" ON)
option(ENABLE_MCC "Enable multicore compilation" ON)
option(WITHDUMPGEN "Enable generating DMP files on crash" ON)
option(ENABLE_AVX2 "Enable AVX2 instruction set (requires AVX2-capable CPU, Haswell/2013 or newer)" ON)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
@@ -508,7 +509,6 @@ else()
target_compile_definitions(${PROJECT_NAME} PUBLIC WITH_DISCORD_RPC=0)
endif()
find_package(OpenAL REQUIRED)
if (TARGET OpenAL::OpenAL)
target_link_libraries(${PROJECT_NAME} OpenAL::OpenAL)
@@ -582,4 +582,13 @@ endif()
if(ENABLE_MCC AND MSVC)
message(STATUS "Enabling multi-processor compilation for MSVC.")
add_compile_options(/MP)
endif()
if(ENABLE_AVX2)
message(STATUS "Enabling AVX2 instruction set.")
if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /arch:AVX2)
else()
target_compile_options(${PROJECT_NAME} PRIVATE -mavx2)
endif()
endif()

View File

@@ -93,6 +93,8 @@
#define GLM_FORCE_SWIZZLE
#define GLM_ENABLE_EXPERIMENTAL
#define GLM_FORCE_CTOR_INIT
#define GLM_FORCE_INLINE
#define GLM_FORCE_INTRINSICS
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtx/matrix_transform_2d.hpp>