Skip to content

Commit e2cb1ad

Browse files
committed
feat(architecture): add InitWebGPUCPJobEntity
pass unit test;
1 parent 582acd5 commit e2cb1ad

File tree

24 files changed

+1842
-75
lines changed

24 files changed

+1842
-75
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let set = dp => {
2+
DpContainer.setWebGPUCoreDp(dp);
3+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let load = LoadWebGPUDoService.load;

src/construct/domain_layer/dependency/container/DpContainer.re

+18-30
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ type t = {
44
mutable timeRepo: option(ITimeRepoDp.timeRepo),
55
mutable pipelineRepo: option(IPipelineRepoDp.pipelineRepo),
66
mutable time: option(ITimeDp.time),
7-
// mutable webgpuCore: option(IWebGPUCoreDp.webgpuCore),
8-
// mutable webgpuRayTracing: option(IWebGPURayTracingDp.webgpuRayTracing),
9-
// mutable network: option(INetworkDp.network),
7+
mutable webgpuCore: option(IWebGPUCoreDp.webgpuCore),
8+
mutable webgpuRayTracing: option(IWebGPURayTracingDp.webgpuRayTracing),
109
};
1110

1211
let dpContainer = {
@@ -15,9 +14,8 @@ let dpContainer = {
1514
timeRepo: None,
1615
pipelineRepo: None,
1716
time: None,
18-
// webgpuCore: None,
19-
// webgpuRayTracing: None,
20-
// network: None,
17+
webgpuCore: None,
18+
webgpuRayTracing: None,
2119
};
2220

2321
let unsafeGetConfigDp = () => {
@@ -106,32 +104,22 @@ let setTimeDp = dp => {
106104
();
107105
};
108106

109-
// let unsafeGetWebGPUCoreDp = () => {
110-
// dpContainer.webgpuCore->OptionSt.unsafeGet;
111-
// };
112-
113-
// let setWebGPUCoreDp = dp => {
114-
// dpContainer.webgpuCore = dp->Some;
115-
116-
// ();
117-
// };
118-
119-
// let unsafeGetWebGPURayTracingDp = () => {
120-
// dpContainer.webgpuRayTracing->OptionSt.unsafeGet;
121-
// };
107+
let unsafeGetWebGPUCoreDp = () => {
108+
dpContainer.webgpuCore->OptionSt.unsafeGet;
109+
};
122110

123-
// let setWebGPURayTracingDp = dp => {
124-
// dpContainer.webgpuRayTracing = dp->Some;
111+
let setWebGPUCoreDp = dp => {
112+
dpContainer.webgpuCore = dp->Some;
125113

126-
// ();
127-
// };
114+
();
115+
};
128116

129-
// let unsafeGetNetworkDp = () => {
130-
// dpContainer.network->OptionSt.unsafeGet;
131-
// };
117+
let unsafeGetWebGPURayTracingDp = () => {
118+
dpContainer.webgpuRayTracing->OptionSt.unsafeGet;
119+
};
132120

133-
// let setNetworkDp = dp => {
134-
// dpContainer.network = dp->Some;
121+
let setWebGPURayTracingDp = dp => {
122+
dpContainer.webgpuRayTracing = dp->Some;
135123

136-
// ();
137-
// };
124+
();
125+
};

src/construct/domain_layer/dependency/interface/engine/ISceneGraphRepoDp.re

+24-21
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,14 @@ open SceneGraphType;
33
type sceneRepo = {getSceneGameObject: unit => gameObject};
44

55
type gameObjectRepo = {
6-
// getMaxUID: unit => uid,
7-
// setMaxUID: uid => unit,
8-
// addTransform: (gameObject, transform) => unit,
96
getTransform: gameObject => option(transform),
10-
// hasTransform: gameObject => bool,
11-
// addBSDFMaterial: (gameObject, bsdfMaterial) => unit,
12-
// getBSDFMaterial: gameObject => option(bsdfMaterial),
13-
// // hasBSDFMaterial: gameObject => bool,
14-
// // addGeometry: (gameObject, geometry) => unit,
15-
// getGeometry: gameObject => option(geometry),
16-
// // hasGeometry: gameObject => bool,
17-
// // addDirectionLight: (gameObject, directionLight) => unit,
18-
// getDirectionLight: gameObject => option(directionLight),
19-
// // hasDirectionLight: gameObject => bool,
20-
// // addBasicCameraView: (gameObject, basicCameraView) => unit,
21-
// getBasicCameraView: gameObject => option(basicCameraView),
22-
// // hasBasicCameraView: gameObject => bool,
23-
// // addPerspectiveCameraProjection:
24-
// // (gameObject, perspectiveCameraProjection) => unit,
25-
// getPerspectiveCameraProjection:
26-
// gameObject => option(perspectiveCameraProjection),
27-
// hasPerspectiveCameraProjection: gameObject => bool,
7+
// getBSDFMaterial: gameObject => option(bsdfMaterial),
8+
// getGeometry: gameObject => option(geometry),
9+
// getDirectionLight: gameObject => option(directionLight),
10+
// getBasicCameraView: gameObject => option(basicCameraView),
11+
// getPerspectiveCameraProjection:
12+
// gameObject => option(perspectiveCameraProjection),
13+
// hasPerspectiveCameraProjection: gameObject => bool,
2814
getAllGeometryGameObjects: gameObject => list(gameObject),
2915
// getAllGameObjectGeometries: gameObject => list(geometry),
3016
// getAllGameObjectBSDFMaterials: gameObject => list(bsdfMaterial),
@@ -41,6 +27,23 @@ type transformRepo = {
4127
getScale: transform => scale,
4228
};
4329

30+
// type bsdfMaterialRepo = {
31+
// getDiffuseColor: bsdfMaterial => diffuse,
32+
// getSpecular: bsdfMaterial => float,
33+
// getSpecularColor: bsdfMaterial => specularColor,
34+
// getRoughness: bsdfMaterial => float,
35+
// getMetalness: bsdfMaterial => float,
36+
// getTransmission: bsdfMaterial => float,
37+
// getIOR: bsdfMaterial => float,
38+
// getDiffuseMapImageId: bsdfMaterial => option(ImagePOType.id),
39+
// getChannelRoughnessMetallicMapImageId:
40+
// bsdfMaterial => option(ImagePOType.id),
41+
// getEmissionMapImageId: bsdfMaterial => option(ImagePOType.id),
42+
// getNormalMapImageId: bsdfMaterial => option(ImagePOType.id),
43+
// getTransmissionMapImageId: bsdfMaterial => option(ImagePOType.id),
44+
// getSpecularMapImageId: bsdfMaterial => option(ImagePOType.id),
45+
// };
46+
4447
type sceneGraphRepo = {
4548
sceneRepo,
4649
transformRepo,

src/construct/domain_layer/dependency/interface/engine/SceneGraphType.re

+1-12
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,4 @@ type localToWorldMatrix = Js.Typed_array.Float32Array.t;
1010

1111
type normalMatrix = Js.Typed_array.Float32Array.t;
1212

13-
// type transform = {
14-
// localPosition: position,
15-
// localRotation: rotation,
16-
// localScale: scale,
17-
// worldPosition: position,
18-
// worldRotation: rotation,
19-
// worldScale: scale,
20-
// localToWorldMatrix,
21-
// normalMatrix,
22-
// };
23-
24-
type transform;
13+
type transform;

0 commit comments

Comments
 (0)