Skip to content

Commit

Permalink
Merge pull request #7 from Wonder-Technology/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
奇变偶不变 authored Sep 18, 2020
2 parents 475dd58 + be542f0 commit 56268ab
Show file tree
Hide file tree
Showing 120 changed files with 1,491 additions and 1,351 deletions.
1 change: 1 addition & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = {
{ name: "scene" },
{ name: "gameObject" },
{ name: "transform" },
{ name: "geometry" },
{ name: "pipeline" },
{ name: "dependency" },
{ name: "cloud-picture" },
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
<a name="2.0.0-alpha.3"></a>
# [2.0.0-alpha.3](https://github.com/Wonder-Technology/Wonder.js/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2020-09-16)


### Bug Fixes

* **cloud-picture:** fix "if create gameObject(should use gameObject repo dp) before init and after prepare, will error" bug ([ec5b0f8](https://github.com/Wonder-Technology/Wonder.js/commit/ec5b0f8))
* **cloud-picture:** fix glsl ([2346c0a](https://github.com/Wonder-Technology/Wonder.js/commit/2346c0a))
* **cloud-picture:** fix glsl ([d808234](https://github.com/Wonder-Technology/Wonder.js/commit/d808234))
* **cloud-picture:** fix glsl ([540c991](https://github.com/Wonder-Technology/Wonder.js/commit/540c991))
* **cloud-picture:** fix InitAccumulationCPJobEntity->_createAndSetPipeline->baseShaderPath ([3aa29ea](https://github.com/Wonder-Technology/Wonder.js/commit/3aa29ea))
* **cloud-picture:** fix InitAccumulationCPJobEntity->bind group and layout: add commonBuffer ([1a7bc7e](https://github.com/Wonder-Technology/Wonder.js/commit/1a7bc7e))
* **cloud-picture:** fix InitPathTracingCPJobEntity->_createShaderBindingTable->groups ([1026c93](https://github.com/Wonder-Technology/Wonder.js/commit/1026c93))
* **cloud-picture:** fix InitPathTracingCPJobEntity->camera,directionLight bind group layout->visibility ([7f9154d](https://github.com/Wonder-Technology/Wonder.js/commit/7f9154d))
* **cloud-picture:** fix maxPayloadSize ([7facf78](https://github.com/Wonder-Technology/Wonder.js/commit/7facf78))
* **cloud-picture:** fix UpdatePathTracingCPJobEntity->_buildAndSetPointIndexBufferData->set vertexIndex data ([e670a46](https://github.com/Wonder-Technology/Wonder.js/commit/e670a46))
* **cloud-picture:** fix UpdatePathTracingCPJobEntity->_buildAndSetSceneDescBufferData->set localToWorldMatrix data ([da96b11](https://github.com/Wonder-Technology/Wonder.js/commit/da96b11))
* **cloud-picture:** fix UpdatePathTracingCPJobEntity->bind group layout->visibility ([7dbfdc8](https://github.com/Wonder-Technology/Wonder.js/commit/7dbfdc8))
* **cloud-picture:** fix UpdatePathTracingCPJobEntity->set vertex buffer's and index buffer's data ([eb74b19](https://github.com/Wonder-Technology/Wonder.js/commit/eb74b19))
* **cloud-picture:** initWebGPUCPJobEntity should set window ([1130503](https://github.com/Wonder-Technology/Wonder.js/commit/1130503))
* **cloud-picture:** move "build all path tracing buffer data" to UpdateTransformCPJobEntity ([adcd873](https://github.com/Wonder-Technology/Wonder.js/commit/adcd873))
* **cloud-picture:** the index buffer's data should be new type arr! ([46f39f0](https://github.com/Wonder-Technology/Wonder.js/commit/46f39f0))
* **dependency:** fix IWebGPUCoreDp->passEncoderCompute->setDynamicBindGroup ([f92298b](https://github.com/Wonder-Technology/Wonder.js/commit/f92298b))
* **dependency:** fix IWebGPUCoreDp->pollEvents type ([fc070bc](https://github.com/Wonder-Technology/Wonder.js/commit/fc070bc))
* **pipeline:** now if one job in the pipeline stream err, it will trigger the stream's error handler ([8e11d5a](https://github.com/Wonder-Technology/Wonder.js/commit/8e11d5a))


### Features

* **geometry:** GeometryRunAPI add createPlaneGeometry api ([9bfb1bb](https://github.com/Wonder-Technology/Wonder.js/commit/9bfb1bb))
* **pipeline:** add end_render job ([2c20a0a](https://github.com/Wonder-Technology/Wonder.js/commit/2c20a0a))



<a name="2.0.0-alpha.2"></a>
# [2.0.0-alpha.2](https://github.com/Wonder-Technology/Wonder.js/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2020-09-09)

Expand Down
1 change: 1 addition & 0 deletions jest_coverage.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"<rootDir>/lib/js/src/.+/data/",
"<rootDir>/lib/js/src/.+/interface/",
"<rootDir>/lib/js/src/.+/type/",
"<rootDir>/lib/js/src/run/cloud_picture/domain_layer/domain/shader/",
"<rootDir>/lib/js/src/.+/ParseDataPipelineDoService.*"

],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var IndicesGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene
var NormalsGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/geometry/NormalsGeometryDoService.bs.js");
var VerticesGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/geometry/VerticesGeometryDoService.bs.js");
var GameObjectGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/geometry/GameObjectGeometryDoService.bs.js");
var CreatePlaneGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/geometry/CreatePlaneGeometryDoService.bs.js");
var CreateSphereGeometryDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/geometry/CreateSphereGeometryDoService.bs.js");

function create(param) {
Expand All @@ -15,6 +16,10 @@ var getGameObjects = GameObjectGeometryDoService$Wonderjs.getGameObjects;

var createSphereGeometry = CreateSphereGeometryDoService$Wonderjs.create;

function createPlaneGeometry(param) {
return CreatePlaneGeometryDoService$Wonderjs.create(undefined);
}

var getVertices = VerticesGeometryDoService$Wonderjs.getVertices;

var setVertices = VerticesGeometryDoService$Wonderjs.setVertices;
Expand All @@ -38,6 +43,7 @@ var getIndicesCount = IndicesGeometryDoService$Wonderjs.getIndicesCount;
exports.create = create;
exports.getGameObjects = getGameObjects;
exports.createSphereGeometry = createSphereGeometry;
exports.createPlaneGeometry = createPlaneGeometry;
exports.getVertices = getVertices;
exports.setVertices = setVertices;
exports.getNormals = getNormals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var DirtyPerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/DirtyPerspectiveCameraProjectionDoService.bs.js");
var CreatePerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/CreatePerspectiveCameraProjectionDoService.bs.js");
var UpdatePerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/UpdatePerspectiveCameraProjectionDoService.bs.js");
var FrustumPerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/FrustumPerspectiveCameraProjectionDoService.bs.js");
var PMatrixPerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/PMatrixPerspectiveCameraProjectionDoService.bs.js");
var GameObjectPerspectiveCameraProjectionDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/perspective_camera_projection/GameObjectPerspectiveCameraProjectionDoService.bs.js");
Expand Down Expand Up @@ -34,6 +35,8 @@ var markDirty = DirtyPerspectiveCameraProjectionDoService$Wonderjs.markDirty;

var markNotDirty = DirtyPerspectiveCameraProjectionDoService$Wonderjs.markNotDirty;

var update = UpdatePerspectiveCameraProjectionDoService$Wonderjs.update;

exports.create = create;
exports.getGameObject = getGameObject;
exports.getPMatrix = getPMatrix;
Expand All @@ -47,4 +50,5 @@ exports.getFar = getFar;
exports.setFar = setFar;
exports.markDirty = markDirty;
exports.markNotDirty = markNotDirty;
/* No side effect */
exports.update = update;
/* UpdatePerspectiveCameraProjectionDoService-Wonderjs Not a pure module */
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

var IndexTransformDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/transform/IndexTransformDoService.bs.js");
var CreateTransformDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/transform/CreateTransformDoService.bs.js");
var RotateTransformDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/transform/RotateTransformDoService.bs.js");
var UpdateTransformDoService$Wonderjs = require("../../domain_layer/domain/scene/scene_graph/service/transform/UpdateTransformDoService.bs.js");
Expand Down Expand Up @@ -73,6 +74,10 @@ var getLocalToWorldMatrix = ModelMatrixTransformDoService$Wonderjs.getLocalToWor

var getNormalMatrix = ModelMatrixTransformDoService$Wonderjs.getNormalMatrix;

var getMaxIndex = IndexTransformDoService$Wonderjs.getMaxIndex;

var mutableUpdate = UpdateTransformDoService$Wonderjs.mutableUpdate;

exports.create = create;
exports.getGameObject = getGameObject;
exports.getParent = getParent;
Expand Down Expand Up @@ -100,4 +105,6 @@ exports.rotateLocalOnAxis = rotateLocalOnAxis;
exports.rotateWorldOnAxis = rotateWorldOnAxis;
exports.getLocalToWorldMatrix = getLocalToWorldMatrix;
exports.getNormalMatrix = getNormalMatrix;
exports.getMaxIndex = getMaxIndex;
exports.mutableUpdate = mutableUpdate;
/* No side effect */
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var TimeDoService$Wonderjs = require("../../domain_layer/domain/statistic/time/service/TimeDoService.bs.js");

var start = TimeDoService$Wonderjs.start;

exports.start = start;
/* No side effect */
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var LoadWebGPUDoService$Wonderjs = require("../../domain_layer/domain/webgpu/core/service/LoadWebGPUDoService.bs.js");

var load = LoadWebGPUDoService$Wonderjs.load;

exports.load = load;
/* LoadWebGPUDoService-Wonderjs Not a pure module */
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict';

var BuildAccerlerationContainerDoService$Wonderjs = require("../../domain_layer/domain/webgpu/ray_tracing/service/BuildAccerlerationContainerDoService.bs.js");

var buildContainers = BuildAccerlerationContainerDoService$Wonderjs.buildContainers;

exports.buildContainers = buildContainers;
/* No side effect */
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ function parse(param) {
var partial_arg = PipelineEntity$Wonderjs.create(name);
return Result$Wonderjs.mapSuccess(Result$Wonderjs.bind(_findGroup(param.firstGroup, groups), (function (group) {
return Result$Wonderjs.mapSuccess(_buildPipelineStream(name, group, groups), (function (pipelineStream) {
var __x = Most.map((function (param) {
return Result$Wonderjs.succeed(undefined);
}), pipelineStream);
return Most.recoverWith((function (err) {
return Most.just(Result$Wonderjs.fail(err));
}), __x);
return Most.map((function (param) {
return Result$Wonderjs.succeed(undefined);
}), pipelineStream);
}));
})), (function (param) {
return Tuple2$Wonderjs.create(partial_arg, param);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
'use strict';

var CreateDefaultGeometryDoService$Wonderjs = require("./CreateDefaultGeometryDoService.bs.js");

function create(param) {
var vertices = [
1.0,
0.0,
-1.0,
1.0,
0.0,
1.0,
-1.0,
0.0,
1.0,
-1.0,
0.0,
-1.0
];
var normals = [
0.0,
1.0,
0.0,
0.0,
1.0,
0.0,
0.0,
1.0,
0.0,
0.0,
1.0,
0.0
];
var indices = [
2,
1,
0,
0,
3,
2
];
return CreateDefaultGeometryDoService$Wonderjs.create([
vertices,
normals,
indices
]);
}

exports.create = create;
/* No side effect */
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,35 @@ function getFovy(cameraProjection) {
}

function setFovy(cameraProjection, fovy) {
return Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setFovy, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), FovyVO$Wonderjs.value(fovy));
Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setFovy, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), FovyVO$Wonderjs.value(fovy));
return Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).markDirty, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection));
}

function getAspect(cameraProjection) {
return OptionSt$Wonderjs.map(Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).getAspect, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection)), AspectVO$Wonderjs.create);
}

function setAspect(cameraProjection, aspect) {
return Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setAspect, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), AspectVO$Wonderjs.value(aspect));
Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setAspect, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), AspectVO$Wonderjs.value(aspect));
return Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).markDirty, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection));
}

function getNear(cameraProjection) {
return OptionSt$Wonderjs.map(Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).getNear, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection)), NearVO$Wonderjs.create);
}

function setNear(cameraProjection, near) {
return Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setNear, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), NearVO$Wonderjs.value(near));
Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setNear, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), NearVO$Wonderjs.value(near));
return Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).markDirty, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection));
}

function getFar(cameraProjection) {
return OptionSt$Wonderjs.map(Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).getFar, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection)), FarVO$Wonderjs.create);
}

function setFar(cameraProjection, far) {
return Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setFar, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), FarVO$Wonderjs.value(far));
Curry._2(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).setFar, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection), FarVO$Wonderjs.value(far));
return Curry._1(DpContainer$Wonderjs.unsafeGetPerspectiveCameraProjectionRepoDp(undefined).markDirty, PerspectiveCameraProjectionEntity$Wonderjs.value(cameraProjection));
}

function computeAspect(param) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,30 @@ var Curry = require("bs-platform/lib/js/curry.js");
var DpContainer$Wonderjs = require("../../../../dependency/container/DpContainer.bs.js");

function load($$window) {
var __x = Most.fromPromise(Curry._1(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).gpu.requestAdapter, {
window: $$window,
preferredBackend: "Vulkan"
}));
return Most.flatMap((function (adapter) {
var __x = Most.fromPromise(Curry._2(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).adapter.requestDevice, {
extensions: ["ray_tracing"]
}, adapter));
return Most.flatMap((function (device) {
var context = Curry._1(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).window.getContext, $$window);
var queue = Curry._1(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).device.getQueue, device);
var __x = Most.fromPromise(Curry._2(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).context.getSwapChainPreferredFormat, device, context));
return Most.map((function (swapChainFormat) {
return [
$$window,
adapter,
device,
context,
queue,
swapChainFormat
];
}), __x);
}), Most.fromPromise(Curry._2(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).adapter.requestDevice, {
extensions: ["ray_tracing"]
}, adapter)));
}), Most.fromPromise(Curry._1(DpContainer$Wonderjs.unsafeGetWebGPUCoreDp(undefined).gpu.requestAdapter, {
window: $$window,
preferredBackend: "Vulkan"
})));
}), __x);
}), __x);
}

exports.load = load;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var VerticesVO$Wonderjs = require("../../../scene/scene_graph/value_object/Verti
var DpContainer$Wonderjs = require("../../../../dependency/container/DpContainer.bs.js");
var EulerAnglesVO$Wonderjs = require("../../../scene/scene_graph/value_object/EulerAnglesVO.bs.js");
var GeometryEntity$Wonderjs = require("../../../scene/scene_graph/entity/GeometryEntity.bs.js");
var GameObjectRunAPI$Wonderjs = require("../../../../../external_layer/api/run/GameObjectRunAPI.bs.js");
var GameObjectRunAPI$Wonderjs = require("../../../../../external_layer/api/run/domain/GameObjectRunAPI.bs.js");
var ImmutableSparseMap$Wonderjs = require("../../../../library/structure/sparse_map/ImmutableSparseMap.bs.js");
var RayTracingBufferVO$Wonderjs = require("../value_object/RayTracingBufferVO.bs.js");
var IndicesGeometryDoService$Wonderjs = require("../../../scene/scene_graph/service/geometry/IndicesGeometryDoService.bs.js");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function ignoreTraverseResultValue(traverseResult) {
}

function range(start, end_) {
return Belt_List.makeBy((end_ - start | 0) + 1 | 0, (function (i) {
return Belt_List.makeBy(end_ - start | 0, (function (i) {
return i + start | 0;
}));
}
Expand Down Expand Up @@ -73,6 +73,10 @@ function remove(list, value) {
}));
}

function getLast(list) {
return Belt_List.get(list, Belt_List.length(list) - 1 | 0);
}

function removeDuplicateItems(list) {
var arr = Belt_List.toArray(list);
var resultArr = [];
Expand Down Expand Up @@ -105,6 +109,8 @@ var length = Belt_List.length;

var head = Belt_List.head;

var nth = Belt_List.get;

exports.traverseResultM = traverseResultM;
exports.traverseReduceResultM = traverseReduceResultM;
exports._id = _id;
Expand All @@ -123,5 +129,7 @@ exports.fromArray = fromArray;
exports.remove = remove;
exports.length = length;
exports.head = head;
exports.nth = nth;
exports.getLast = getLast;
exports.removeDuplicateItems = removeDuplicateItems;
/* No side effect */
Loading

0 comments on commit 56268ab

Please sign in to comment.