-
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add examples * Update patch * Update patch * Add Pipeline * Update patch * Delete examples * Update more built declaration files
- Loading branch information
1 parent
35612df
commit 9b284e6
Showing
12 changed files
with
640 additions
and
49 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js"; | ||
import Attributes from "./Attributes.js"; | ||
import Backend from "./Backend.js"; | ||
import Binding from "./Binding.js"; | ||
import DataMap from "./DataMap.js"; | ||
import Info from "./Info.js"; | ||
import Nodes from "./nodes/Nodes.js"; | ||
import Pipelines from "./Pipelines.js"; | ||
import RenderObject from "./RenderObject.js"; | ||
import Textures from "./Textures.js"; | ||
interface Data { | ||
bindings?: Binding[] | undefined; | ||
} | ||
declare class Bindings extends DataMap<{ | ||
renderObject: { | ||
key: RenderObject; | ||
value: Data; | ||
}; | ||
computeNode: { | ||
key: ComputeNode; | ||
value: Data; | ||
}; | ||
}> { | ||
backend: Backend; | ||
textures: Textures; | ||
pipelines: Pipelines; | ||
attributes: Attributes; | ||
nodes: Nodes; | ||
info: Info; | ||
constructor( | ||
backend: Backend, | ||
nodes: Nodes, | ||
textures: Textures, | ||
attributes: Attributes, | ||
pipelines: Pipelines, | ||
info: Info, | ||
); | ||
getForRender(renderObject: RenderObject): Binding[]; | ||
getForCompute(computeNode: ComputeNode): Binding[]; | ||
updateForCompute(computeNode: ComputeNode): void; | ||
updateForRender(renderObject: RenderObject): void; | ||
_init(bindings: Binding[]): void; | ||
_update(object: ComputeNode | RenderObject, bindings: Binding[]): void; | ||
} | ||
export default Bindings; |
8 changes: 8 additions & 0 deletions
8
types/three/examples/jsm/renderers/common/ComputePipeline.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Pipeline from "./Pipeline.js"; | ||
import ProgrammableStage from "./ProgrammableStage.js"; | ||
declare class ComputePipeline extends Pipeline { | ||
computeProgram: ProgrammableStage; | ||
readonly isComputePipeline: true; | ||
constructor(cacheKey: string, computeProgram: ProgrammableStage); | ||
} | ||
export default ComputePipeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { BufferAttribute, BufferGeometry } from "three"; | ||
import Attributes from "./Attributes.js"; | ||
import { AttributeType } from "./Constants.js"; | ||
import DataMap from "./DataMap.js"; | ||
import Info from "./Info.js"; | ||
import RenderObject from "./RenderObject.js"; | ||
interface GeometryData { | ||
initialized?: boolean | undefined; | ||
} | ||
declare class Geometries extends DataMap<{ | ||
geometry: { | ||
key: BufferGeometry; | ||
value: GeometryData; | ||
}; | ||
}> { | ||
attributes: Attributes; | ||
info: Info; | ||
wireframes: WeakMap<BufferGeometry, BufferAttribute>; | ||
attributeCall: WeakMap<BufferAttribute, number>; | ||
constructor(attributes: Attributes, info: Info); | ||
has(renderObject: RenderObject | BufferGeometry): boolean; | ||
updateForRender(renderObject: RenderObject): void; | ||
initGeometry(renderObject: RenderObject): void; | ||
updateAttributes(renderObject: RenderObject): void; | ||
updateAttribute(attribute: BufferAttribute, type: AttributeType): void; | ||
getIndex(renderObject: RenderObject): BufferAttribute | null; | ||
} | ||
export default Geometries; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare class Pipeline { | ||
cacheKey: string; | ||
usedTimes: number; | ||
constructor(cacheKey: string); | ||
} | ||
export default Pipeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js"; | ||
import Backend from "./Backend.js"; | ||
import Binding from "./Binding.js"; | ||
import Bindings from "./Bindings.js"; | ||
import ComputePipeline from "./ComputePipeline.js"; | ||
import DataMap from "./DataMap.js"; | ||
import Nodes from "./nodes/Nodes.js"; | ||
import Pipeline from "./Pipeline.js"; | ||
import ProgrammableStage from "./ProgrammableStage.js"; | ||
import RenderObject from "./RenderObject.js"; | ||
import RenderPipeline from "./RenderPipeline.js"; | ||
interface ComputeNodeData { | ||
version: number; | ||
pipeline: ComputePipeline; | ||
} | ||
interface RenderObjectData { | ||
pipeline: RenderPipeline; | ||
} | ||
declare class Pipelines extends DataMap<{ | ||
computeNode: { | ||
key: ComputeNode; | ||
value: ComputeNodeData; | ||
}; | ||
renderObject: { | ||
key: RenderObject; | ||
value: RenderObjectData; | ||
}; | ||
}> { | ||
backend: Backend; | ||
nodes: Nodes; | ||
bindings: Bindings | null; | ||
caches: Map<string, Pipeline>; | ||
programs: { | ||
vertex: Map<string, ProgrammableStage>; | ||
fragment: Map<string, ProgrammableStage>; | ||
compute: Map<string, ProgrammableStage>; | ||
}; | ||
constructor(backend: Backend, nodes: Nodes); | ||
getForCompute(computeNode: ComputeNode, bindings: Binding[]): ComputePipeline; | ||
getForRender(renderObject: RenderObject, promises?: Promise<void>[] | null): RenderPipeline; | ||
delete(object: ComputeNode | RenderObject): RenderObjectData | ComputeNodeData; | ||
dispose(): void; | ||
updateForRender(renderObject: RenderObject): void; | ||
_getComputePipeline( | ||
computeNode: ComputeNode, | ||
stageCompute: ProgrammableStage, | ||
cacheKey: string, | ||
bindings: Binding[], | ||
): ComputePipeline; | ||
_getRenderPipeline( | ||
renderObject: RenderObject, | ||
stageVertex: ProgrammableStage, | ||
stageFragment: ProgrammableStage, | ||
cacheKey: string, | ||
promises: Promise<void>[] | null, | ||
): RenderPipeline; | ||
_getComputeCacheKey(computeNode: ComputeNode, stageCompute: ProgrammableStage): string; | ||
_getRenderCacheKey( | ||
renderObject: RenderObject, | ||
stageVertex: ProgrammableStage, | ||
stageFragment: ProgrammableStage, | ||
): string; | ||
_releasePipeline(pipeline: Pipeline): void; | ||
_releaseProgram(program: ProgrammableStage): void; | ||
_needsComputeUpdate(computeNode: ComputeNode): boolean; | ||
_needsRenderUpdate(renderObject: RenderObject): true | void; | ||
} | ||
export default Pipelines; |
15 changes: 15 additions & 0 deletions
15
types/three/examples/jsm/renderers/common/ProgrammableStage.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import NodeAttribute from "../../nodes/core/NodeAttribute.js"; | ||
declare class ProgrammableStage { | ||
id: number; | ||
code: string; | ||
stage: "compute" | "vertex" | "fragment"; | ||
attributes: NodeAttribute[] | null; | ||
usedTimes: number; | ||
constructor( | ||
code: string, | ||
type: "compute" | "vertex" | "fragment", | ||
transforms?: null, | ||
attributes?: NodeAttribute[] | null, | ||
); | ||
} | ||
export default ProgrammableStage; |
8 changes: 8 additions & 0 deletions
8
types/three/examples/jsm/renderers/common/RenderPipeline.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Pipeline from "./Pipeline.js"; | ||
import ProgrammableStage from "./ProgrammableStage.js"; | ||
declare class RenderPipeline extends Pipeline { | ||
vertexProgram: ProgrammableStage; | ||
fragmentProgram: ProgrammableStage; | ||
constructor(cacheKey: string, vertexProgram: ProgrammableStage, fragmentProgram: ProgrammableStage); | ||
} | ||
export default RenderPipeline; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters