Merge branch '635-nvrhi2-arm' into 635-nvrhi2

This commit is contained in:
Robert Beckebans 2022-04-29 17:52:48 +02:00
commit f792b68ba6
23 changed files with 59 additions and 99 deletions

View file

@ -23,9 +23,6 @@ option(FORCE_COLOR_OUTPUT
option(COMPILE_COMMANDS
"Generate compile_commands.json" OFF)
option(USE_MFC_TOOLS
"Compile the legacy MFC based tools (unsupported)" OFF)
option(USE_PRECOMPILED_HEADERS
"Use precompiled headers during build" ON)
@ -35,12 +32,6 @@ option(SDL2
option(OPENAL
"Use OpenAL soft instead of XAudio2" OFF)
option(FFMPEG
"Use FMPEG to render Bink videos" ON)
option(BINKDEC
"Use included libbinkdec to render Bink videos" OFF)
option(USE_VULKAN
"Use Vulkan instead of OpenGL" OFF)
@ -54,7 +45,7 @@ option(ONATIVE
"Optimize for the host CPU" OFF)
option(WINDOWS10
"Build for Windows 10+" OFF)
"Build for Windows 10+" ON)
option(USE_SYSTEM_ZLIB
"Use the system zlib instead of the bundled one" OFF)
@ -88,10 +79,18 @@ if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)" OR CMAKE_OSX_AR
endif()
# SRS - Turn off MMX/SSE intrinsics when cross-compiling from Apple x86_64 to arm64
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)|(e2k)|(E2K)" AND NOT CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)|(e2k)|(E2K)" AND NOT CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(x64)")
option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" ON)
option(FFMPEG "Use FMPEG to render Bink videos" ON)
option(BINKDEC "Use included libbinkdec to render Bink videos" OFF)
else()
option(USE_INTRINSICS_SSE "Compile using SSE intrinsics (e.g mmx, sse, msse2)" OFF)
option(FFMPEG "Use FMPEG to render Bink videos" OFF)
option(BINKDEC "Use included libbinkdec to render Bink videos" ON)
endif()
if(FFMPEG AND BINKDEC)
@ -102,8 +101,9 @@ if(UNIX)
set(OPENAL ON)
# SRS - Disable precompiled headers when cross-compiling on OSX, e.g. when creating universal binaries
if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR
(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64"))
if((CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64" AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" ) OR
# (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64") OR (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x64"))
set(USE_PRECOMPILED_HEADERS OFF)
endif()
@ -307,15 +307,6 @@ elseif(MSVC)
if(NOT CMAKE_CL_64)
add_definitions(-D_USE_32BIT_TIME_T)
endif()
if(USE_MFC_TOOLS)
add_definitions(-D_AFXDLL)
# 0: Use Standard Windows Libraries
# 1: Use MFC in a Static Library
# 2: Use MFC in a Shared DLL
set(CMAKE_MFC_FLAG 2)
endif()
endif()
@ -1167,13 +1158,6 @@ set(WIN32_RESOURCES
#if(USE_MFC_TOOLS)
list(APPEND WIN32_RESOURCES sys/win32/rc/doom.rc)
#else()
# list(APPEND WIN32_RESOURCES sys/win32/rc/doom_nomfc.rc)
#endif()
file(GLOB POSIX_INCLUDES sys/posix/*.h)
file(GLOB POSIX_SOURCES sys/posix/*.cpp)
@ -1667,34 +1651,6 @@ if(MSVC)
swresample)
endif()
if(USE_MFC_TOOLS)
include_directories(libs/atlmfc/include)
if(CMAKE_CL_64)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/atlmfc/lib/amd64)
else()
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/atlmfc/lib)
endif()
add_definitions(-DUSE_MFC_TOOLS)
list(APPEND RBDOOM3_SOURCES
${TOOLS_COMAFX_INCLUDES} ${TOOLS_COMAFX_SOURCES}
${TOOLS_COMMON_INCLUDES} ${TOOLS_COMMON_SOURCES}
${TOOLS_COMMON_PROPTREE_INCLUDES} ${TOOLS_COMMON_PROPTREE_SOURCES}
${EDITOR_AF_INCLUDES} ${EDITOR_AF_SOURCES}
${EDITOR_DEBUGGER_INCLUDES} ${EDITOR_DEBUGGER_SOURCES}
${EDITOR_DECL_INCLUDES} ${EDITOR_DECL_SOURCES}
${EDITOR_GUIED_INCLUDES} ${EDITOR_GUIED_SOURCES}
${EDITOR_MATERIALEDITOR_INCLUDES} ${EDITOR_MATERIALEDITOR_SOURCES}
${EDITOR_PARTICLE_INCLUDES} ${EDITOR_PARTICLE_SOURCES}
${EDITOR_PDA_INCLUDES} ${EDITOR_PDA_SOURCES}
${EDITOR_RADIANT_INCLUDES} ${EDITOR_RADIANT_SOURCES}
${EDITOR_SCRIPT_INCLUDES} ${EDITOR_SCRIPT_SOURCES}
${EDITOR_SOUND_INCLUDES} ${EDITOR_SOUND_SOURCES})
endif()
list(APPEND RBDOOM3_INCLUDES
${SYS_INCLUDES}

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=ON -DOPENAL=ON ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=ON -DUSE_VULKAN=ON -DSPIRV_SHADERC=OFF -DFFMPEG=ON ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=ON ../neo
pause

View file

@ -0,0 +1,6 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=OFF ../neo
pause

View file

@ -2,5 +2,5 @@ cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 15 Win64" ../neo
cmake -G "Visual Studio 15 Win64" -DWINDOWS10=ON ../neo
pause

View file

@ -1,6 +0,0 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 -DWINDOWS10=ON -DUSE_OPENAL=ON ../neo
pause

View file

@ -2,5 +2,5 @@ cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 -DWINDOWS10=ON ../neo
cmake -G "Visual Studio 16" -A x64 ../neo
pause

View file

@ -0,0 +1,6 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A arm64 -D WINDOWS10=ON -D USE_INTRINSICS_SSE=OFF ../neo
pause

View file

@ -0,0 +1,6 @@
cd ..
del /s /q build
mkdir build
cd build
cmake -G "Visual Studio 16" -A x64 -DUSE_OPENAL=ON ../neo
pause

View file

@ -40,8 +40,11 @@ If you have questions concerning this license or the applicable additional terms
// Win32
#if defined(WIN32) || defined(_WIN32)
#if defined(_WIN64)
#define CPUSTRING "x64"
#elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
#define CPUSTRING "arm64"
#else
#define CPUSTRING "x86"
#endif
@ -185,7 +188,9 @@ Defines and macros usable in all code
#define ALIGN( x, a ) ( ( ( x ) + ((a)-1) ) & ~((a)-1) )
// RB: changed UINT_PTR to uintptr_t
#include <malloc.h>
#define _alloca16( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 16 ) + 16 ), 16 ) )
#define _alloca128( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 128 ) + 128 ), 128 ) )
// RB end

View file

@ -15,6 +15,8 @@
#ifndef RAPIDJSON_RAPIDJSON_H_
#define RAPIDJSON_RAPIDJSON_H_
//#define RAPIDJSON_ENDIAN 0
/*!\file rapidjson.h
\brief common definitions and configuration
@ -209,7 +211,7 @@
// Detect with architecture macros
# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__)
# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
# elif defined(_M_ARM64) || defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
# elif defined(RAPIDJSON_DOXYGEN_RUNNING)
# define RAPIDJSON_ENDIAN

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
@ -54,7 +54,7 @@ half Distribution_GGX_1886( half hdotN, half alpha )
}
// Fresnel term F( v, h )
// Fnone( v, h ) = F(0°) = specularColor
// Fnone( v, h ) = F(0) = specularColor
half3 Fresnel_Schlick( half3 specularColor, half vDotN )
{
return specularColor + ( 1.0 - specularColor ) * pow( 1.0 - vDotN, 5.0 );

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
@ -190,7 +190,7 @@ void main( PS_IN fragment, out PS_OUT result )
const half roughness = specMapSRGB.r;
const half glossiness = 1.0 - roughness;
// the vast majority of real-world materials (anything not metal or gems) have F(0°)
// the vast majority of real-world materials (anything not metal or gems) have F(0)
// values in a very narrow range (~0.02 - 0.08)
// approximate non-metals with linear RGB 0.04 which is 0.08 * 0.5 (default in UE4)

View file

@ -211,7 +211,7 @@ void main( PS_IN fragment, out PS_OUT result )
const half roughness = specMapSRGB.r;
const half glossiness = 1.0 - roughness;
// the vast majority of real-world materials (anything not metal or gems) have F(0°)
// the vast majority of real-world materials (anything not metal or gems) have F(0)
// values in a very narrow range (~0.02 - 0.08)
// approximate non-metals with linear RGB 0.04 which is 0.08 * 0.5 (default in UE4)

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
@ -107,7 +107,7 @@ void main( PS_IN fragment, out PS_OUT result )
const float roughness = specMapSRGB.r;
const float glossiness = 1.0 - roughness;
// the vast majority of real-world materials (anything not metal or gems) have F(0<EFBFBD>)
// the vast majority of real-world materials (anything not metal or gems) have F(0)
// values in a very narrow range (~0.02 - 0.08)
// approximate non-metals with linear RGB 0.04 which is 0.08 * 0.5 (default in UE4)

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code
@ -462,7 +462,7 @@ void main( PS_IN fragment, out PS_OUT result )
const float roughness = specMapSRGB.r;
const float glossiness = 1.0 - roughness;
// the vast majority of real-world materials (anything not metal or gems) have F(0<EFBFBD>)
// the vast majority of real-world materials (anything not metal or gems) have F(0)
// values in a very narrow range (~0.02 - 0.08)
// approximate non-metals with linear RGB 0.04 which is 0.08 * 0.5 (default in UE4)

View file

@ -1,4 +1,4 @@
/*
/*
===========================================================================
Doom 3 BFG Edition GPL Source Code

View file

@ -1,4 +1,4 @@
/**
/**
* Copyright (C) 2013 Jorge Jimenez (jorge@iryoku.com)
* Copyright (C) 2013 Jose I. Echevarria (joseignacioechevarria@gmail.com)
* Copyright (C) 2013 Belen Masia (bmasia@unizar.es)
@ -44,7 +44,7 @@
*
* The shader has three passes, chained together as follows:
*
* |input|------------------·
* |input|------------------
* v |
* [ SMAA*EdgeDetection ] |
* v |
@ -54,7 +54,7 @@
* v |
* |blendTex| |
* v |
* [ SMAANeighborhoodBlending ] <------·
* [ SMAANeighborhoodBlending ] <------
* v
* |output|
*

View file

@ -1 +1 @@
BRDF.inc.hlslglobal_inc.hlslBRDF.inc.hlslglobal_inc.hlsl
BRDF.inc.hlsl global_inc.hlsl BRDF.inc.hlsl global_inc.hlsl

View file

@ -115,6 +115,9 @@ void CinematicAudio_XAudio2::InitAudio( void* audioContext )
bool use_ext = false;
voiceFormatcine.nChannels = binkInfo->nChannels; //fixed
voiceFormatcine.nSamplesPerSec = binkInfo->sampleRate; //fixed
#else
int format_byte = 2;
bool use_ext = false;
#endif
WAVEFORMATEXTENSIBLE exvoice = { 0 };