Skip to content

Commit 4ce1d58

Browse files
authored
Merge pull request #9 from aosoft/aosoft/#7
Add new interfaces
2 parents 84f4cd6 + f2d716e commit 4ce1d58

File tree

17 files changed

+28889
-13867
lines changed

17 files changed

+28889
-13867
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin-sample-profiler"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
edition = "2018"
66
publish = false
@@ -11,8 +11,8 @@ crate-type = ["cdylib"]
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
unity-native-plugin = { version = "0.5.0", path = "../unity-native-plugin", features = ["profiler_callbacks"] }
15-
unity-native-plugin-sys = { version = "0.5.0", path = "../unity-native-plugin-sys" }
14+
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["profiler_callbacks"] }
15+
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
1616
log = "0.4"
1717
env_logger = "0.8"
1818
flume = "0.10"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin-sample"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
edition = "2018"
66
publish = false
@@ -11,10 +11,10 @@ crate-type = ["cdylib"]
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
unity-native-plugin = { version = "0.5.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12", "profiler"] }
15-
unity-native-plugin-vulkan = { version = "0.5.0", path = "../unity-native-plugin-vulkan" }
14+
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12", "profiler"] }
15+
unity-native-plugin-vulkan = { version = "0.6.0", path = "../unity-native-plugin-vulkan" }
1616
winapi = { version = "0.3.9", features = ["winuser", "d3d11", "dxgiformat"] }
1717
wio = "0.2.2"
1818

1919
[dev-dependencies]
20-
unity-native-plugin-tester = { version = "0.5.0", path = "../unity-native-plugin-tester", features = ["d3d11"] }
20+
unity-native-plugin-tester = { version = "0.6.0", path = "../unity-native-plugin-tester", features = ["d3d11"] }

unity-native-plugin-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin-sys"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
edition = "2018"
66
license = "MIT"

unity-native-plugin-sys/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
unity-native-plugin-rs
22
====
33

4-
* based on Unity 6000.0.5f1
5-
* Vulkan SDK 1.3.268.1
4+
* based on Unity 6000.0.10f1
5+
* Vulkan SDK 1.3.283.0
66
* bindgen 0.69.4
7-
* clang version 10.0.0-4ubuntu1
7+
* clang version 14.0.0-1ubuntu1.1

unity-native-plugin-sys/src/plugin_api.rs

Lines changed: 28697 additions & 13806 deletions
Large diffs are not rendered by default.

unity-native-plugin-sys/wrapper.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ struct ID3D12CommandQueue {};
3636
#include <IUnityProfilerCallbacks.h>
3737

3838
#include <IUnityMemoryManager.h>
39-
Assert(bool);
39+
40+
#define Assert(x)
41+
4042
#include <IUnityEventQueue.h>
4143
#include <IUnityLog.h>

unity-native-plugin-tester/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin-tester"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
edition = "2018"
66
license = "MIT"
@@ -25,8 +25,8 @@ d3d11 = []
2525
d3d12 = []
2626

2727
[dependencies]
28-
unity-native-plugin-sys = { version = "0.5.0", path = "../unity-native-plugin-sys" }
29-
unity-native-plugin = { version = "0.5.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12"] }
28+
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
29+
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin", features = ["d3d11", "d3d12"] }
3030
winapi = { version = "0.3.9", features = ["winuser", "dxgi", "d3d11", "dxgiformat", "dxgitype", "d3dcommon"] }
3131
winit = "0.23.0"
3232
wio = "0.2.2"

unity-native-plugin-vulkan/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin-vulkan"
3-
version = "0.5.1"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
license = "MIT"
66
description = "Unity Native Plugin API (Vulkan) for Rust"
@@ -19,6 +19,6 @@ include = [
1919
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
2020

2121
[dependencies]
22-
unity-native-plugin = { version = "0.5.0", path = "../unity-native-plugin" }
23-
unity-native-plugin-sys = { version = "0.5.0", path = "../unity-native-plugin-sys" }
24-
ash = "0.33.1"
22+
unity-native-plugin = { version = "0.6.0", path = "../unity-native-plugin" }
23+
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }
24+
ash = "0.38.0+1.3.281.1"

unity-native-plugin/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "unity-native-plugin"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
authors = ["Yasuhiro Taniuchi"]
55
license = "MIT"
66
description = "Unity Native Plugin API for Rust"
@@ -26,4 +26,4 @@ profiler = []
2626
profiler_callbacks = ["profiler"]
2727

2828
[dependencies]
29-
unity-native-plugin-sys = { version = "0.5.0", path = "../unity-native-plugin-sys" }
29+
unity-native-plugin-sys = { version = "0.6.0", path = "../unity-native-plugin-sys" }

unity-native-plugin/src/d3d11.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,24 @@ impl UnityGraphicsD3D11 {
3939
.SRVFromNativeTexture
4040
.expect("SRVFromNativeTexture")(texture) as ComPtr
4141
}
42+
43+
pub unsafe fn swap_chain(&self) -> ComPtr {
44+
self.interface().GetSwapChain.expect("GetSwapChain")() as ComPtr
45+
}
46+
47+
pub fn sync_interval(&self) -> u32 {
48+
unsafe {
49+
self.interface()
50+
.GetSyncInterval
51+
.expect("GetSyncInterval")()
52+
}
53+
}
54+
55+
pub fn present_flags(&self) -> u32 {
56+
unsafe {
57+
self.interface()
58+
.GetPresentFlags
59+
.expect("GetPresentFlags")()
60+
}
61+
}
4262
}

0 commit comments

Comments
 (0)