Skip to content

Commit 9f9acd8

Browse files
Add SGSR2 files
Signed-off-by: Rodrigo Holztrattner <[email protected]>
1 parent 071018b commit 9f9acd8

20 files changed

+3971
-0
lines changed

samples/sgsr2/README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Snapdragon™ Game Super Resolution 2.0 Sample
2+
3+
## Overview
4+
5+
Snapdragon™ Game Super Resolution 2.0 (Snapdragon™ GSR 2.0 or SGSR 2.0) sample demonstrates how to integrate SGSR2.0 to do temporal upscaling.
6+
7+
## Build
8+
9+
### Dependencies
10+
11+
The following dependencies must be installed and the appropriate locations should be referenced in the `PATH` environment variable.
12+
13+
* Android SDK
14+
* Andorid NDK
15+
* Gradle
16+
* CMake
17+
* Android Studio
18+
* Other dependencies
19+
Run following commands at {root_of_this_repo}\GLES_Sample_Framework:
20+
```
21+
.\deps.bat
22+
```
23+
Make sure all the dependencies are cloned correctly. In my case, the submodules of adreno-gpu-opengl-es-code-sample-framework often failed to be cloned, to solve this try following commands repeatedly:
24+
```
25+
cd {root_of_this_repo}\GLES_Sample_Framework\adreno-gpu-opengl-es-code-sample-framework
26+
git submodule update --init --recursive
27+
```
28+
After all the submodules are cloned, run `.\deps.bat` again to build dependencies.
29+
30+
### Build
31+
There are two samples demonstrate 3 variants of SGSR2.0.
32+
- For SGSR2.0 2/3-pass compute shader variant, uses the sgsr2 sample
33+
Open Android Studio and go to `File->New->Import Project...` and select the `adreno-gpu-opengl-es-code-sample-framework\samples\sgsr2\build\android` folder as the source for the import.
34+
35+
- For SGSR2.0 2-pass fragment shader variant, uses the sgsr2_fs sample
36+
Open Android Studio and go to `File->New->Import Project...` and select the `adreno-gpu-opengl-es-code-sample-framework\samples\sgsr2_fs\build\android` folder as the source for the import.
37+
38+
### Evaluation
39+
Tapping the left part of screen switches SGSR 2-pass/3-pass/off.
40+
Tapping the right part of screen switches from camera move to still to compare the visual quality better.
41+
42+
43+
## Implementation Example
44+
The core of the integration of SGSR2.0 is
45+
```
46+
VOID CSample::PrepareSGSR()
47+
```
48+
and
49+
```
50+
VOID CSample::DispatchSGSR()
51+
```

samples/sgsr2/deps.bat

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
set windows-shell := ["pwsh", "-NoLogo", "-NoProfileLoadTime", "-Command"]
2+
3+
set root_dir=%cd%
4+
5+
git config --global http.postBuffer 500M
6+
git config --global http.maxRequestBuffer 100M
7+
git config --global core.compression 0
8+
git clone --recursive https://github.com/quic/adreno-gpu-opengl-es-code-sample-framework
9+
10+
xcopy .\sgsr2 adreno-gpu-opengl-es-code-sample-framework\samples\sgsr2\ /s /e /h /i /y
11+
12+
xcopy .\sgsr2_fs adreno-gpu-opengl-es-code-sample-framework\samples\sgsr2_fs\ /s /e /h /i /y
13+
14+
cd adreno-gpu-opengl-es-code-sample-framework
15+
16+
call .\03_BuildTools.bat
17+

samples/sgsr2/sgsr2/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.iml
2+
build/android/.gradle
3+
build/android/.idea
4+
build/android/app/Media
5+
build/android/app/.cxx
6+
build/android/app/src/main/assets
7+
build/android/app/build
8+
build/android/framework
9+
build/android/local.properties
10+
.vscode
11+
/local.properties
12+
/.idea/caches
13+
/.idea/libraries
14+
/.idea/modules.xml
15+
/.idea/workspace.xml
16+
/.idea/navEditor.xml
17+
/.idea/assetWizardSettings.xml
18+
.DS_Store
19+
/build
20+
/captures
21+
.externalNativeBuild
22+
.cxx
23+
local.properties
24+
external/

samples/sgsr2/sgsr2/README.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Snapdragon™ Game Super Resolution 2.0 Sample
2+
3+
## Overview
4+
5+
Snapdragon™ Game Super Resolution 2.0 (Snapdragon™ GSR 2.0 or SGSR 2.0) sample demonstrates how to integrate SGSR2.0 to do temporal upscaling in two or three GPU shader passes.
6+
7+
### Variants:
8+
9+
- **2-pass-fs (recommended)**: Uses 2 fragment shaders, favors speed, and is often optimal for Mobile and VR/XR applications.
10+
- **2-pass-cs**: Uses 2 compute shaders, favors speed, and is often optimal for Mobile and VR/XR applications.
11+
- **3-pass-cs**: Uses 3 compute shaders, favors visuals, and is often optimal for Desktop/Console and higher-end Mobile applications.
12+
13+
## Build
14+
15+
### Dependencies
16+
17+
The following dependencies must be installed and the appropriate locations should be referenced in the `PATH` environment variable.
18+
19+
* Android SDK
20+
* Andorid NDK
21+
* Gradle
22+
* CMake
23+
* Android Studio
24+
25+
Before building any sample, run 03_BuildTools.bat at the root of the repository to ensure that all executables any sample might need are built.
26+
27+
At this point, building this sample APK is as simple as navigating to the `build\android` folder and on a command prompt using the following gradle command:
28+
29+
```
30+
31+
$ gradlew assembleRelease
32+
33+
```
34+
35+
Building a slightly-slower executable with asserts can be done with:
36+
37+
```
38+
39+
$ gradlew assembleDebug
40+
41+
```
42+
43+
44+
This sample can also be easily imported to Android Studio and be used within the Android Studio ecosystem -- including building, deploying, and native code debugging.
45+
46+
To do this, open Android Studio and go to `File->New->Import Project...` and select the `build\android` folder as the source for the import. This will load the gradle configuration, at which point the sample can be used within Android Studio.
47+
48+
### Evaluation
49+
Tapping the left part of screen switches SGSR 2-pass-fs/2-pass-cs/3-pass-cs/off.
50+
Tapping the right part of screen switches from camera move to still to compare the visual quality better.
51+
52+
53+
## Implementation Example
54+
The core of the integration of SGSR2.0 is
55+
```
56+
VOID CSample::PrepareSGSR()
57+
```
58+
and
59+
```
60+
VOID CSample::DispatchSGSR()
61+
```

0 commit comments

Comments
 (0)