Skip to content

Commit

Permalink
Add gpu priority control using native plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Guerra24 committed Jun 14, 2024
1 parent c2cd5c1 commit 92171a5
Show file tree
Hide file tree
Showing 18 changed files with 220 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .github/game-ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG GAMECI_IMAGE=unityci/editor:ubuntu-6000.0.4f1-windows-mono-3
ARG GAMECI_IMAGE=unityci/editor:ubuntu-6000.0.5f1-windows-mono-3
FROM $GAMECI_IMAGE

ARG BLENDER_SHORT_VERSION=3.5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
strategy:
matrix:
build:
- { target-platform: StandaloneWindows64, image: 'unityci/editor:ubuntu-6000.0.4f1-windows-mono-3' }
- { target-platform: StandaloneLinux64, image: 'unityci/editor:ubuntu-6000.0.4f1-linux-il2cpp-3' }
- { target-platform: StandaloneWindows64, image: 'unityci/editor:ubuntu-6000.0.5f1-windows-mono-3' }
- { target-platform: StandaloneLinux64, image: 'unityci/editor:ubuntu-6000.0.5f1-linux-il2cpp-3' }
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 8 additions & 0 deletions Assets/Plugins/AvatarViewer.Native.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Assets/Plugins/AvatarViewer.Native/AvatarViewer.Native.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "AvatarViewer.Native",
"rootNamespace": "",
"references": [],
"includePlatforms": [
"Editor",
"WindowsStandalone64"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": true
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Assets/Plugins/AvatarViewer.Native/GPUPriority.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Runtime.InteropServices;

namespace AvatarViewer.Native.Win
{
public enum _D3DKMT_SCHEDULINGPRIORITYCLASS
{
D3DKMT_SCHEDULINGPRIORITYCLASS_IDLE,
D3DKMT_SCHEDULINGPRIORITYCLASS_BELOW_NORMAL,
D3DKMT_SCHEDULINGPRIORITYCLASS_NORMAL,
D3DKMT_SCHEDULINGPRIORITYCLASS_ABOVE_NORMAL,
D3DKMT_SCHEDULINGPRIORITYCLASS_HIGH,
D3DKMT_SCHEDULINGPRIORITYCLASS_REALTIME
}

public static class GPUPriority
{

[DllImport("AvatarViewer.Native.Win", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void ChangePriority(_D3DKMT_SCHEDULINGPRIORITYCLASS processPriority, int gpuThreadPriority);

}
}
2 changes: 2 additions & 0 deletions Assets/Plugins/AvatarViewer.Native/GPUPriority.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 92171a5

Please sign in to comment.