diff --git a/README.md b/README.md index f32f37e4..3cdd3e95 100644 --- a/README.md +++ b/README.md @@ -420,10 +420,12 @@ Existing repositories can be updated manually: 3. Download and install the latest Vulkan SDK from LunarG: https://www.lunarg.com/vulkan-sdk/ You can skip this step if you compile with DX12 only by adding -DUSE_VULKAN=OFF to the CMake options. -4. Generate the VS2022 projects using CMake by doubleclicking a matching configuration .bat file in the `DoomCode/neo/` folder. +4. Download ISPC from https://github.com/ispc/ispc/releases and unpack the binary to `DoomCode/tools/ispc/bin/ispc.exe` + +5. Generate the VS2022 projects using CMake by doubleclicking a matching configuration .bat file in the `DoomCode/neo/` folder. Recommended in this case is `cmake-vs2022-win64-no-ffmpeg.bat` -5. Use the VS2022 solution to compile what you need: +6. Use the VS2022 solution to compile what you need: `DoomCode/build/RBDoom3BFG.sln` @@ -447,7 +449,8 @@ Recommended in this case is `cmake-vs2022-win64-no-ffmpeg.bat` On Debian or Ubuntu: - > sudo apt install cmake ispc libsdl2-dev libopenal-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libvulkan-dev libncurses-dev + > sudo apt install cmake libsdl2-dev libopenal-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libvulkan-dev libncurses-dev + > sudo snap install ispc On Fedora diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 9236dc1b..1e852503 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -446,14 +446,14 @@ endif() if(USE_INTRINSICS_SSE) add_subdirectory(libs/moc) set(MASKED_OCCLUSION_LIBRARY MaskedOcclusionCulling) - - #set(ISPC_TEXCOMP_LIBRARY Compressonator_MD) - #link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/compressonator/lib) endif() if(USE_INTRINSICS_SSE OR USE_INTRINSICS_NEON) add_subdirectory(libs/ispc_texcomp) set(ISPC_TEXCOMP_LIBRARY ispc_texcomp) + + #set(ISPC_TEXCOMP_LIBRARY Compressonator_MD) + #link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/compressonator/lib) endif() file(GLOB NATVIS_SOURCES .natvis) diff --git a/neo/libs/ispc_texcomp/CMakeLists.txt b/neo/libs/ispc_texcomp/CMakeLists.txt index 4cdaad1d..ee92af42 100644 --- a/neo/libs/ispc_texcomp/CMakeLists.txt +++ b/neo/libs/ispc_texcomp/CMakeLists.txt @@ -6,7 +6,21 @@ cmake_minimum_required(VERSION 3.10) set(LIB_NAME ispc_texcomp) # Find the ISPC compiler -find_program(ISPC_EXECUTABLE ispc) +if (MSVC) + find_program(ISPC_EXECUTABLE + NAMES ispc ispc.exe + PATHS ${CMAKE_SOURCE_DIR}/../tools/ispc/bin + NO_DEFAULT_PATH) + + if (NOT ISPC_EXECUTABLE) + find_program(ISPC_EXECUTABLE ispc) + endif() + + message(STATUS "Setting 'ISPC_EXECUTABLE' to '${ISPC_EXECUTABLE}'") +else() + find_program(ISPC_EXECUTABLE ispc) +endif() + if(NOT ISPC_EXECUTABLE) message(FATAL_ERROR "ISPC compiler not found. Please install ISPC and ensure it is in the PATH.") endif() @@ -36,7 +50,8 @@ if (USE_INTRINSICS_SSE) COMMAND ${ISPC_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${ISPC_SOURCE} -o ${ISPC_OBJ} -h ${ISPC_HEADER} - --target=avx2-i32x8 --arch=x86-64 ${ISPC_PIC} + #--target=avx2-i32x8 --arch=x86-64 ${ISPC_PIC} + --target=sse4-i32x4 --arch=x86-64 ${ISPC_PIC} # supports more CPUs beginning from 2008 DEPENDS ${ISPC_SOURCE} COMMENT "Compiling ISPC file ${ISPC_SOURCE}" ) diff --git a/neo/renderer/DXT/DXTEncoder.cpp b/neo/renderer/DXT/DXTEncoder.cpp index 434942c8..0229553e 100644 --- a/neo/renderer/DXT/DXTEncoder.cpp +++ b/neo/renderer/DXT/DXTEncoder.cpp @@ -6111,6 +6111,7 @@ void idDxtEncoder::CompressImageR11G11B10_BC6Fast_SIMD( const byte* inBuf, byte* options.dwSize = sizeof( CMP_CompressOptions ); options.fquality = 0.5f; // Medium quality for speed (0.0 to 1.0) options.dwnumThreads = 0; // 0 = auto-detect number of threads based on CPU cores + options.nEncodeWith = CMP_GPU_OCL; // Execute compression (single call) CMP_ERROR cmp_status = CMP_ConvertTexture( &srcTexture, &destTexture, &options, nullptr ); diff --git a/neo/renderer/Image_load.cpp b/neo/renderer/Image_load.cpp index 780c0fa9..d732133c 100644 --- a/neo/renderer/Image_load.cpp +++ b/neo/renderer/Image_load.cpp @@ -914,7 +914,10 @@ void idImage::ActuallyLoadImage( bool fromBackEnd, nvrhi::ICommandList* commandL void idImage::DeferredLoadImage() { - globalImages->imagesToLoad.AddUnique( this ); + if( !globalImages->cacheImages ) + { + globalImages->imagesToLoad.AddUnique( this ); + } } void idImage::DeferredPurgeImage()