Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test commits for debug on Windows #64

Open
wants to merge 26 commits into
base: arm-gcc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
53bc03a
conan: use find_package to add SDL2 dependency in Linux (without conan)
q4a Nov 24, 2022
27c1cb5
linux: add basic support for Gallium Nine on Linux
q4a Nov 23, 2022
cdfbd99
[arm] add sse2neon.h from
q4a Apr 29, 2022
ed5c6a9
arm: add arm support in *.cpp, *.h, *.hpp
q4a Nov 24, 2022
e2c4ac1
arm: add armhf support to cmake file
q4a Nov 24, 2022
e378dad
nine-native: improve d3d9types.h to support Perimeter game
q4a Nov 24, 2022
bc4f4b2
conan: use find_package to add SDL2 dependency in Linux (without cona…
q4a Dec 4, 2022
7c82d77
[arm] Add -fsigned-char to avoid differences between x86 and arm
q4a May 8, 2022
1c16aee
nine: don't use Vulkan window if defined STORM_MESA_NINE
q4a Dec 13, 2022
935576a
gcc: fix unions in math3d/color.h and math3d/plane.h
q4a Dec 18, 2022
1c81834
gcc: fix unions in matrix.h and math3d/matrix.h
q4a Dec 18, 2022
8d7bdb6
gcc: fix unions in math3d/vector4.h
q4a Dec 18, 2022
d04f22b
gcc: fix unions in math3d/sphere.h
q4a Dec 19, 2022
2fe6a42
gcc: add name cv to 2nd struct in SAILGEOMETRY from sailone.h
q4a Dec 19, 2022
4470c18
gcc: fix few errors with static_cast and #include <cstdarg>
q4a Dec 19, 2022
bc81516
gcc: replace "using struct" with "typedef struct" in types3d.h
q4a Dec 19, 2022
a10de18
arm: update sse2neon.h with version from 2022.12.11
q4a Dec 19, 2022
8c34269
arm: rename _rdtsc to storm_rdtsc
q4a Dec 19, 2022
be9b720
arm: simple fix for aligning asm vldr
q4a Dec 19, 2022
fadc0a3
nine: add armhf and aarch64 search paths for d3dadapter9.so
q4a Dec 22, 2022
ca4d81e
Revert "gcc: fix unions in matrix.h and math3d/matrix.h"
q4a Feb 20, 2023
0affcd8
gcc: fix unions in matrix.h and math3d/matrix.h
q4a Feb 20, 2023
90839e0
clean: replace FLOAT with float, part 1
q4a Feb 22, 2023
285b4ab
test: replace "def _WIN32" with "def false // _WIN32" except:
q4a Feb 23, 2023
955bd14
test: revert disabling S_DEBUG and HINSTANCE
q4a Feb 23, 2023
e764793
CTechnique: use `free` instead of "delete", if var was realloc-ed
q4a Feb 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ include(StormSetup)

option(STORM_ENABLE_CRASH_REPORTS "Enable automatic crash reports" OFF)
option(STORM_ENABLE_STEAM "Enable Steam integration" OFF)
if (NOT WIN32)
option(STORM_MESA_NINE "Use Gallium Nine from Mesa (without WINE) for D3D9 API" OFF)
endif()

### Set up output paths
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -15,6 +18,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug

set(STORM_WATERMARK_FILE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/watermark.hpp CACHE FILEPATH "Include file containing build revision, etc." FORCE)

message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})
if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv*")
set(PROJECT_PLATFORM_ARM TRUE)
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(PROJECT_PLATFORM_ARM64 TRUE)
endif()

if (PROJECT_PLATFORM_ARM)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -fsigned-char")
endif()

### Set up third-party dependencies
set(ENV{CONAN_REVISIONS_ENABLED} 1)
conan_add_remote(NAME bincrafters
Expand All @@ -37,12 +52,35 @@ conan_cmake_run(CONANFILE conanfile.py
)

if (NOT WIN32)
find_package(SDL2 REQUIRED)
message(STATUS "SDL2_LIBRARIES="${SDL2_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I${SDL2_INCLUDE_DIRS} -fsigned-char")
message(STATUS "CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS})
endif()

if (WIN32)
message("Using Windows D3D9 API")
set(SDL2_LIBRARIES "sdl")
elseif (STORM_MESA_NINE) # for Gallium Nine
message("Using Gallium Nine for native D3D9 API")

#sudo apt install libd3dadapter9-mesa-dev
find_package(PkgConfig REQUIRED)
pkg_check_modules(D3D REQUIRED IMPORTED_TARGET d3d)

add_subdirectory(nine-native)
set(NINE_NATIVE_INCLUDE_DIRS
"${CMAKE_CURRENT_SOURCE_DIR}/nine-native/include"
"${CMAKE_CURRENT_SOURCE_DIR}/nine-native/include/D3D9"
)
include_directories("${NINE_NATIVE_INCLUDE_DIRS}")
else() # for DXVK Native
message("Using DXVK-native for D3D9 API")

include(ExternalProject)
ExternalProject_Add(dxvk-native
GIT_REPOSITORY https://github.com/Joshua-Ashton/dxvk-native
GIT_TAG a2dc99c407340432d4ba5bfa29efa685c27942ea
GIT_REPOSITORY https://github.com/IonAgorria/dxvk-native
GIT_TAG 2e91e784a86bc1355100518cd90eee48433551ac
GIT_SHALLOW ON
BUILD_ALWAYS OFF
CONFIGURE_HANDLED_BY_BUILD ON
Expand Down
3 changes: 2 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StormEngine(ConanFile):

# dependencies used in deploy binaries
# conan-center
requires = ["zlib/1.2.11", "spdlog/1.9.2", "fast_float/3.4.0", "sdl/2.0.18", "mimalloc/2.0.3", "sentry-native/0.5.0",
requires = ["zlib/1.2.11", "spdlog/1.9.2", "fast_float/3.4.0", "mimalloc/2.0.3", "sentry-native/0.5.0",
# storm.jfrog.io
"directx/9.0@storm/prebuilt", "fmod/2.02.05@storm/prebuilt"]
# aux dependencies (e.g. for tests)
Expand All @@ -27,6 +27,7 @@ def requirements(self):
if self.settings.os == "Windows":
# conan-center
self.requires("7zip/19.00")
self.requires("sdl/2.0.18")
else:
# conan-center
self.requires("libsafec/3.6.0")
Expand Down
23 changes: 23 additions & 0 deletions nine-native/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project(nine-native)

add_library(${PROJECT_NAME} STATIC
include/nine_sdl.h
src/nine_sdl.c
src/dri3.c
src/dri3.h
)

target_include_directories(${PROJECT_NAME} PRIVATE
include
include/D3D9
)

target_link_libraries(${PROJECT_NAME} PRIVATE
SDL2
X11
xcb
xcb-present
xcb-dri3
xcb-xfixes
X11-xcb
)
2,011 changes: 2,011 additions & 0 deletions nine-native/include/D3D9/d3d9.h

Large diffs are not rendered by default.

Loading