Skip to content

Commit

Permalink
feat(architecture): add InitWebGPUCPJobEntity
Browse files Browse the repository at this point in the history
pass unit test;
  • Loading branch information
yyc-git committed Oct 30, 2020
1 parent 582acd5 commit e2cb1ad
Show file tree
Hide file tree
Showing 24 changed files with 1,842 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let set = dp => {
DpContainer.setWebGPUCoreDp(dp);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let load = LoadWebGPUDoService.load;
48 changes: 18 additions & 30 deletions src/construct/domain_layer/dependency/container/DpContainer.re
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ type t = {
mutable timeRepo: option(ITimeRepoDp.timeRepo),
mutable pipelineRepo: option(IPipelineRepoDp.pipelineRepo),
mutable time: option(ITimeDp.time),
// mutable webgpuCore: option(IWebGPUCoreDp.webgpuCore),
// mutable webgpuRayTracing: option(IWebGPURayTracingDp.webgpuRayTracing),
// mutable network: option(INetworkDp.network),
mutable webgpuCore: option(IWebGPUCoreDp.webgpuCore),
mutable webgpuRayTracing: option(IWebGPURayTracingDp.webgpuRayTracing),
};

let dpContainer = {
Expand All @@ -15,9 +14,8 @@ let dpContainer = {
timeRepo: None,
pipelineRepo: None,
time: None,
// webgpuCore: None,
// webgpuRayTracing: None,
// network: None,
webgpuCore: None,
webgpuRayTracing: None,
};

let unsafeGetConfigDp = () => {
Expand Down Expand Up @@ -106,32 +104,22 @@ let setTimeDp = dp => {
();
};

// let unsafeGetWebGPUCoreDp = () => {
// dpContainer.webgpuCore->OptionSt.unsafeGet;
// };

// let setWebGPUCoreDp = dp => {
// dpContainer.webgpuCore = dp->Some;

// ();
// };

// let unsafeGetWebGPURayTracingDp = () => {
// dpContainer.webgpuRayTracing->OptionSt.unsafeGet;
// };
let unsafeGetWebGPUCoreDp = () => {
dpContainer.webgpuCore->OptionSt.unsafeGet;
};

// let setWebGPURayTracingDp = dp => {
// dpContainer.webgpuRayTracing = dp->Some;
let setWebGPUCoreDp = dp => {
dpContainer.webgpuCore = dp->Some;

// ();
// };
();
};

// let unsafeGetNetworkDp = () => {
// dpContainer.network->OptionSt.unsafeGet;
// };
let unsafeGetWebGPURayTracingDp = () => {
dpContainer.webgpuRayTracing->OptionSt.unsafeGet;
};

// let setNetworkDp = dp => {
// dpContainer.network = dp->Some;
let setWebGPURayTracingDp = dp => {
dpContainer.webgpuRayTracing = dp->Some;

// ();
// };
();
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,14 @@ open SceneGraphType;
type sceneRepo = {getSceneGameObject: unit => gameObject};

type gameObjectRepo = {
// getMaxUID: unit => uid,
// setMaxUID: uid => unit,
// addTransform: (gameObject, transform) => unit,
getTransform: gameObject => option(transform),
// hasTransform: gameObject => bool,
// addBSDFMaterial: (gameObject, bsdfMaterial) => unit,
// getBSDFMaterial: gameObject => option(bsdfMaterial),
// // hasBSDFMaterial: gameObject => bool,
// // addGeometry: (gameObject, geometry) => unit,
// getGeometry: gameObject => option(geometry),
// // hasGeometry: gameObject => bool,
// // addDirectionLight: (gameObject, directionLight) => unit,
// getDirectionLight: gameObject => option(directionLight),
// // hasDirectionLight: gameObject => bool,
// // addBasicCameraView: (gameObject, basicCameraView) => unit,
// getBasicCameraView: gameObject => option(basicCameraView),
// // hasBasicCameraView: gameObject => bool,
// // addPerspectiveCameraProjection:
// // (gameObject, perspectiveCameraProjection) => unit,
// getPerspectiveCameraProjection:
// gameObject => option(perspectiveCameraProjection),
// hasPerspectiveCameraProjection: gameObject => bool,
// getBSDFMaterial: gameObject => option(bsdfMaterial),
// getGeometry: gameObject => option(geometry),
// getDirectionLight: gameObject => option(directionLight),
// getBasicCameraView: gameObject => option(basicCameraView),
// getPerspectiveCameraProjection:
// gameObject => option(perspectiveCameraProjection),
// hasPerspectiveCameraProjection: gameObject => bool,
getAllGeometryGameObjects: gameObject => list(gameObject),
// getAllGameObjectGeometries: gameObject => list(geometry),
// getAllGameObjectBSDFMaterials: gameObject => list(bsdfMaterial),
Expand All @@ -41,6 +27,23 @@ type transformRepo = {
getScale: transform => scale,
};

// type bsdfMaterialRepo = {
// getDiffuseColor: bsdfMaterial => diffuse,
// getSpecular: bsdfMaterial => float,
// getSpecularColor: bsdfMaterial => specularColor,
// getRoughness: bsdfMaterial => float,
// getMetalness: bsdfMaterial => float,
// getTransmission: bsdfMaterial => float,
// getIOR: bsdfMaterial => float,
// getDiffuseMapImageId: bsdfMaterial => option(ImagePOType.id),
// getChannelRoughnessMetallicMapImageId:
// bsdfMaterial => option(ImagePOType.id),
// getEmissionMapImageId: bsdfMaterial => option(ImagePOType.id),
// getNormalMapImageId: bsdfMaterial => option(ImagePOType.id),
// getTransmissionMapImageId: bsdfMaterial => option(ImagePOType.id),
// getSpecularMapImageId: bsdfMaterial => option(ImagePOType.id),
// };

type sceneGraphRepo = {
sceneRepo,
transformRepo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,4 @@ type localToWorldMatrix = Js.Typed_array.Float32Array.t;

type normalMatrix = Js.Typed_array.Float32Array.t;

// type transform = {
// localPosition: position,
// localRotation: rotation,
// localScale: scale,
// worldPosition: position,
// worldRotation: rotation,
// worldScale: scale,
// localToWorldMatrix,
// normalMatrix,
// };

type transform;
type transform;
Loading

0 comments on commit e2cb1ad

Please sign in to comment.