diff --git a/CMakeLists.txt b/CMakeLists.txt index 41360a8..b6e3369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,9 +3,9 @@ cmake_minimum_required(VERSION 3.20) include($ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake) set(CMAKE_CXX_STANDARD 17) -project("ShaderRecomp-ALL") +project("XenosRecomp-ALL") -set(SHADER_RECOMP_THIRDPARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty") +set(XENOS_RECOMP_THIRDPARTY_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty") -add_subdirectory(${SHADER_RECOMP_THIRDPARTY_ROOT}) -add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ShaderRecomp") +add_subdirectory(${XENOS_RECOMP_THIRDPARTY_ROOT}) +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/XenosRecomp") diff --git a/ShaderRecomp/CMakeLists.txt b/XenosRecomp/CMakeLists.txt similarity index 53% rename from ShaderRecomp/CMakeLists.txt rename to XenosRecomp/CMakeLists.txt index bec1ab6..4e0e2d2 100644 --- a/ShaderRecomp/CMakeLists.txt +++ b/XenosRecomp/CMakeLists.txt @@ -1,12 +1,12 @@ -project(ShaderRecomp) +project(XenosRecomp) if (WIN32) - option(SHADER_RECOMP_DXIL "Generate DXIL shader cache" ON) + option(XENOS_RECOMP_DXIL "Generate DXIL shader cache" ON) endif() set(SMOLV_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty/smol-v/source") -add_executable(ShaderRecomp +add_executable(XenosRecomp constant_table.h dxc_compiler.cpp dxc_compiler.h @@ -20,27 +20,27 @@ add_executable(ShaderRecomp find_package(directx-dxc CONFIG REQUIRED) -target_link_libraries(ShaderRecomp PRIVATE +target_link_libraries(XenosRecomp PRIVATE Microsoft::DirectXShaderCompiler Microsoft::DXIL xxHash::xxhash libzstd_static fmt::fmt) -target_include_directories(ShaderRecomp PRIVATE ${SMOLV_SOURCE_DIR}) +target_include_directories(XenosRecomp PRIVATE ${SMOLV_SOURCE_DIR}) -target_precompile_headers(ShaderRecomp PRIVATE pch.h) +target_precompile_headers(XenosRecomp PRIVATE pch.h) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_options(ShaderRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic -fms-extensions) + target_compile_options(XenosRecomp PRIVATE -Wno-switch -Wno-unused-variable -Wno-null-arithmetic -fms-extensions) endif() if (WIN32) - target_compile_definitions(ShaderRecomp PRIVATE _CRT_SECURE_NO_WARNINGS) + target_compile_definitions(XenosRecomp PRIVATE _CRT_SECURE_NO_WARNINGS) find_file(DIRECTX_DXIL_LIBRARY "dxil.dll") file(COPY ${DIRECTX_DXIL_LIBRARY} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) endif() -if (SHADER_RECOMP_DXIL) - target_compile_definitions(ShaderRecomp PRIVATE SHADER_RECOMP_DXIL) +if (XENOS_RECOMP_DXIL) + target_compile_definitions(XenosRecomp PRIVATE XENOS_RECOMP_DXIL) endif() diff --git a/ShaderRecomp/constant_table.h b/XenosRecomp/constant_table.h similarity index 100% rename from ShaderRecomp/constant_table.h rename to XenosRecomp/constant_table.h diff --git a/ShaderRecomp/dxc_compiler.cpp b/XenosRecomp/dxc_compiler.cpp similarity index 100% rename from ShaderRecomp/dxc_compiler.cpp rename to XenosRecomp/dxc_compiler.cpp diff --git a/ShaderRecomp/dxc_compiler.h b/XenosRecomp/dxc_compiler.h similarity index 100% rename from ShaderRecomp/dxc_compiler.h rename to XenosRecomp/dxc_compiler.h diff --git a/ShaderRecomp/main.cpp b/XenosRecomp/main.cpp similarity index 96% rename from ShaderRecomp/main.cpp rename to XenosRecomp/main.cpp index 22234b1..e35b89d 100644 --- a/ShaderRecomp/main.cpp +++ b/XenosRecomp/main.cpp @@ -32,24 +32,24 @@ struct RecompiledShader int main(int argc, char** argv) { const char* input = -#ifdef SHADER_RECOMP_INPUT - SHADER_RECOMP_INPUT +#ifdef XENOS_RECOMP_INPUT + XENOS_RECOMP_INPUT #else argv[1] #endif ; const char* output = -#ifdef SHADER_RECOMP_OUTPUT - SHADER_RECOMP_OUTPUT +#ifdef XENOS_RECOMP_OUTPUT + XENOS_RECOMP_OUTPUT #else argv[2] #endif ; const char* includeInput = -#ifdef SHADER_RECOMP_INCLUDE_INPUT - SHADER_RECOMP_INCLUDE_INPUT +#ifdef XENOS_RECOMP_INCLUDE_INPUT + XENOS_RECOMP_INCLUDE_INPUT #else argv[3] #endif @@ -114,7 +114,7 @@ int main(int argc, char** argv) thread_local DxcCompiler dxcCompiler; -#ifdef SHADER_RECOMP_DXIL +#ifdef XENOS_RECOMP_DXIL shader.dxil = dxcCompiler.compile(recompiler.out, recompiler.isPixelShader, recompiler.specConstantsMask != 0, false); assert(shader.dxil != nullptr); assert(*(reinterpret_cast(shader.dxil->GetBufferPointer()) + 1) != 0 && "DXIL was not signed properly!"); @@ -162,7 +162,7 @@ int main(int argc, char** argv) int level = ZSTD_maxCLevel(); -#ifdef SHADER_RECOMP_DXIL +#ifdef XENOS_RECOMP_DXIL std::vector dxilCompressed(ZSTD_compressBound(dxil.size())); dxilCompressed.resize(ZSTD_compress(dxilCompressed.data(), dxilCompressed.size(), dxil.data(), dxil.size(), level)); diff --git a/ShaderRecomp/pch.h b/XenosRecomp/pch.h similarity index 100% rename from ShaderRecomp/pch.h rename to XenosRecomp/pch.h diff --git a/ShaderRecomp/shader.h b/XenosRecomp/shader.h similarity index 100% rename from ShaderRecomp/shader.h rename to XenosRecomp/shader.h diff --git a/ShaderRecomp/shader_code.h b/XenosRecomp/shader_code.h similarity index 100% rename from ShaderRecomp/shader_code.h rename to XenosRecomp/shader_code.h diff --git a/ShaderRecomp/shader_common.h b/XenosRecomp/shader_common.h similarity index 100% rename from ShaderRecomp/shader_common.h rename to XenosRecomp/shader_common.h diff --git a/ShaderRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp similarity index 100% rename from ShaderRecomp/shader_recompiler.cpp rename to XenosRecomp/shader_recompiler.cpp diff --git a/ShaderRecomp/shader_recompiler.h b/XenosRecomp/shader_recompiler.h similarity index 100% rename from ShaderRecomp/shader_recompiler.h rename to XenosRecomp/shader_recompiler.h diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 9179251..1418b7a 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -1,11 +1,11 @@ if (NOT TARGET fmt::fmt) - add_subdirectory("${SHADER_RECOMP_THIRDPARTY_ROOT}/fmt") + add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/fmt") endif() if (NOT TARGET xxHash::xxhash) - add_subdirectory("${SHADER_RECOMP_THIRDPARTY_ROOT}/xxHash/cmake_unofficial") + add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/xxHash/cmake_unofficial") endif() if (NOT TARGET libzstd) - add_subdirectory("${SHADER_RECOMP_THIRDPARTY_ROOT}/zstd/build/cmake") + add_subdirectory("${XENOS_RECOMP_THIRDPARTY_ROOT}/zstd/build/cmake") endif()