Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
187J3X1-114514 committed Oct 1, 2024
1 parent 2eb39c8 commit 99d593a
Show file tree
Hide file tree
Showing 12 changed files with 1,618 additions and 1,636 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ CMakeUserPresets.json
build/
bin/
tools/test.ipynb
.vscode/
.vscode/
.vs/
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmake_minimum_required(VERSION 3.15)
project (fsr2_java_lib)

set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")

set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -g")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g")
add_definitions(-D_DEBUG)
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
add_definitions(-DON_LINUX)
add_definitions(-DFFX_GCC)

endif()

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
Expand Down Expand Up @@ -39,8 +42,6 @@ set_target_properties(lib_shared PROPERTIES OUTPUT_NAME "fsr2javalib")

target_link_libraries(lib_shared ${LIB_NVML} ${LIB_FSR2_GL} ${LIB_FSR2_API})



set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin)

#mingw32-make
124 changes: 53 additions & 71 deletions include/io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api.h
Original file line number Diff line number Diff line change
@@ -1,89 +1,71 @@
/* DO NOT EDIT THIS FILE - it is machine generated */


#ifdef ON_LINUX
#include "jni_linux64.h"
#else
#include "jni.h"
#endif
/* Header for class io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper */

/* Header for class io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api */

#ifndef _Included_io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
#define _Included_io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
#ifndef _Included_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
#define _Included_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: init
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_init(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2GetScratchMemorySizeGL
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2GetScratchMemorySizeGL(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2CreateContext
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2CreateContext(JNIEnv *, jobject);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: ffxFsr2GetScratchMemorySizeGL
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_ffxFsr2GetScratchMemorySizeGL
(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2GetInterfaceGL
* Signature: (IFIII)I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2GetInterfaceGL(JNIEnv *, jobject, jint, jfloat, jint, jint, jint);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: ffxFsr2CreateGL
* Signature: (IFIII)I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_ffxFsr2CreateGL
(JNIEnv *, jobject, jint, jfloat, jint, jint, jint);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2Test
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2Test(JNIEnv *, jobject);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: ffxFsr2Test
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_ffxFsr2Test
(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2ContextDestroy
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2ContextDestroy(JNIEnv *, jobject);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: getGPUInfoNV
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_getGPUInfoNV
(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: getGPUInfoNV
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_getGPUInfoNV(JNIEnv *, jobject);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: getGPUInfoAMD
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_getGPUInfoAMD
(JNIEnv *, jobject);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: getGPUInfoAMD
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_getGPUInfoAMD(JNIEnv *, jobject);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: ffxFsr2ContextDispatch
* Signature: (Lio/homo/superresolution/fsr2/types/FfxResource;Lio/homo/superresolution/fsr2/types/FfxResource;Lio/homo/superresolution/fsr2/types/FfxResource;Lio/homo/superresolution/fsr2/types/FfxResource;Lio/homo/superresolution/fsr2/types/FfxResource;Lio/homo/superresolution/fsr2/types/FfxResource;FFFFIIZFFFZFFFFZII)I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_ffxFsr2ContextDispatch
(JNIEnv *, jobject, jobject, jobject, jobject, jobject, jobject, jobject, jfloat, jfloat, jfloat, jfloat, jint, jint, jboolean, jfloat, jfloat, jfloat, jboolean, jfloat, jfloat, jfloat, jfloat, jboolean, jint, jint);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxFsr2ContextDispatch
* Signature: (IIIIIIFFFFIIZFFFZFFFFZII)I
*/
JNIEXPORT jint JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxFsr2ContextDispatch(JNIEnv *, jobject, jint, jint, jint, jint, jint, jint, jfloat, jfloat, jfloat, jfloat, jint, jint, jboolean, jfloat, jfloat, jfloat, jboolean, jfloat, jfloat, jfloat, jfloat, jboolean, jint, jint);
/*
* Class: io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper
* Method: ffxGetTextureResourceGL
* Signature: (JIII)Lio/homo/superresolution/fsr2/types/FfxResource;
*/
JNIEXPORT jobject JNICALL Java_io_homo_superresolution_fsr2_nativelib_FSR2ApiHelper_ffxGetTextureResourceGL
(JNIEnv *, jobject, jlong, jint, jint, jint);

/*
* Class: io_homo_superresolution_fsr2_nativelib_ffx_fsr2_api
* Method: ffxGetTextureResourceGL
* Signature: (JIII)Lio/homo/superresolution/fsr2/types/FfxResource;
*/
JNIEXPORT jobject JNICALL Java_io_homo_superresolution_fsr2_nativelib_ffx_1fsr2_1api_ffxGetTextureResourceGL(JNIEnv *, jobject, jlong, jint, jint, jint);
#ifdef __cplusplus
}
#endif
Expand Down
15 changes: 0 additions & 15 deletions include/pch.h

This file was deleted.

12 changes: 6 additions & 6 deletions src/ffx-fsr2-api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ cmake_minimum_required(VERSION 3.15)
set(CMAKE_DEBUG_POSTFIX d)
option (FFX_FSR2_API_GL "Build FSR 2.0 OpenGL backend" ON)

set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -g")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -Wall -g")

set(FSR2_AUTO_COMPILE_SHADERS ON CACHE BOOL "Compile shaders automatically as a prebuild step.")

Expand All @@ -38,10 +38,10 @@ set(FSR2_PLATFORM_NAME x64)
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
add_compile_definitions(FFX_GCC) # Should work with gcc and others
endif()
# Embed PDBs in the debug versions of the libs
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_HOME_DIRECTORY}/bin/ffx_fsr2_api/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_HOME_DIRECTORY}/bin/ffx_fsr2_api/)
## Embed PDBs in the debug versions of the libs
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Z7")
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_HOME_DIRECTORY}/bin)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_HOME_DIRECTORY}/bin)

add_compile_definitions(_UNICODE)
add_compile_definitions(UNICODE)
Expand Down
Loading

0 comments on commit 99d593a

Please sign in to comment.