Pipelayer
Ploy3D / Pipelayer
Class: Pipelayer
着色管线装配工。
Hierarchy
↳
Pipelayer
Table of contents
Constructors
Methods
- AddRef
- BindPipeline
- CompileBranches
- CreateBuffer
- CreateCommandEncoder
- CreateRenderTexture
- CreateShader
- CreateTexture
- CreateUniformBinding
- GenerateMipmapRT
- GetRenderTextureAttachment
- GetRenderTexturePixels
- GetShader
- GetTuple
- Init
- Release
- Resize
- ResizeAtlas
- SetIndexBuffer
- SetUniform
- SetVertexBuffer
- SetVertexBuffersCache
- Shutdown
- Status
- Submit
- WriteBuffer
- WriteTexture2D_KTX
- WriteTexture2D_RAW
Constructors
constructor
• new Pipelayer()
构造函数。
Overrides
Device.constructor
Methods
AddRef
▸ AddRef(type
, id
): void
增加资源引用。
Parameters
Name | Type |
---|---|
type | SharedResType |
id | number |
Returns
void
BindPipeline
▸ BindPipeline(subMesh
, shaderBranchID
, renderPassIndex
, passEncoder
, draw
): void
绑定着色器管线,并逐躺触发绘制。
Parameters
Name | Type |
---|---|
subMesh | number |
shaderBranchID | number |
renderPassIndex | number |
passEncoder | GLRenderPassEncoder |
draw | () => void |
Returns
void
CompileBranches
▸ CompileBranches(args
): number
编译着色器分支(提供给网格渲染器组件编译材质用)。
Parameters
Name | Type |
---|---|
args | CompileArgs |
Returns
number
CreateBuffer
▸ CreateBuffer(type
, size_
, offset?
, data?
): number
Parameters
Name | Type | Description |
---|---|---|
type | SharedResType | - |
size_ | number | - |
offset? | number | - |
data? | ArrayBuffer | 初始化数据; |
Returns
number
Inherited from
CreateCommandEncoder
▸ CreateCommandEncoder(): GLCommandEncoder
创建帧命令编码器。
Returns
Inherited from
CreateRenderTexture
▸ CreateRenderTexture(size
, levelCount
, format
, bindable
, resizable
): number
创建渲染贴图。
Parameters
Name | Type |
---|---|
size | number [] |
levelCount | number |
format | GLTextureFormat |
bindable | boolean |
resizable | boolean |
Returns
number
Inherited from
CreateShader
▸ CreateShader(name
): Shader
从着色器资产创建着色器实例。
Parameters
Name | Type |
---|---|
name | string |
Returns
CreateTexture
▸ CreateTexture(size
, levelCount
, format
): number
创建内部贴图(少量特殊贴图使用,不使用图集)。
Parameters
Name | Type |
---|---|
size | number [] |
levelCount | number |
format | GLTextureFormat |
Returns
number
Inherited from
CreateUniformBinding
▸ CreateUniformBinding(group
, blockSize
, bufferID
, blockOffset_1?
, bufferID_1?
, includeRT?
): number
创建统一资源绑定对象,返回对象ID。
Parameters
Name | Type |
---|---|
group | number |
blockSize | number |
bufferID | number |
blockOffset_1? | number |
bufferID_1? | number |
includeRT? | number [] |
Returns
number
Inherited from
GenerateMipmapRT
▸ GenerateMipmapRT(id
): void
生成贴图LOD。
Parameters
Name | Type |
---|---|
id | number |
Returns
void
Inherited from
GetRenderTextureAttachment
▸ GetRenderTextureAttachment(rt
, layer
, level
): GLTextureView
获取渲染贴图附件。
Parameters
Name | Type |
---|---|
rt | number |
layer | number |
level | number |
Returns
Inherited from
Device.GetRenderTextureAttachment
GetRenderTexturePixels
▸ GetRenderTexturePixels(rt
, layer
, level
, x
, y
, width
, height
): ArrayLike
<number
>
获取渲染贴图像素。
Parameters
Name | Type |
---|---|
rt | number |
layer | number |
level | number |
x | number |
y | number |
width | number |
height | number |
Returns
ArrayLike
<number
>
Inherited from
GetShader
▸ GetShader(id
): Shader
获取着色器对象。
Parameters
Name | Type |
---|---|
id | number |
Returns
GetTuple
▸ GetTuple(id
): PropTuple
获取着色器属性组元组。
Parameters
Name | Type |
---|---|
id | number |
Returns
Init
▸ Init(): Promise
<Pipelayer
>
初始化着色管线装配工。
Returns
Promise
<Pipelayer
>
Release
▸ Release(type
, id
): number
释放资源引用。
Parameters
Name | Type |
---|---|
type | SharedResType |
id | number |
Returns
number
Resize
▸ Resize(width
, height
): void
重设渲染目标大小。
Parameters
Name | Type |
---|---|
width | number |
height | number |
Returns
void
Inherited from
ResizeAtlas
▸ ResizeAtlas(format
, depth
): void
扩充纹理集容量。
Parameters
Name | Type |
---|---|
format | number |
depth | number |
Returns
void
Inherited from
SetIndexBuffer
▸ SetIndexBuffer(format
, id
, offset
, size
, passEncoder
): void
应用索引缓存。
Parameters
Name | Type |
---|---|
format | number |
id | number |
offset | number |
size | number |
passEncoder | GLRenderPassEncoder |
Returns
void
Inherited from
SetUniform
▸ SetUniform(id
, offset
, passEncoder
): void
应用统一资源。
Parameters
Name | Type |
---|---|
id | number |
offset | number |
passEncoder | GLRenderPassEncoder |
Returns
void
Inherited from
SetVertexBuffer
▸ SetVertexBuffer(layout
, slot
, id
, offset
, size
, passEncoder
): void
应用顶点缓存。
Parameters
Name | Type |
---|---|
layout | number |
slot | number |
id | number |
offset | number |
size | number |
passEncoder | GLRenderPassEncoder |
Returns
void
Inherited from
SetVertexBuffersCache
▸ SetVertexBuffersCache(cacheID
, layout
, count
, list
, passEncoder
): number
批量应用应用顶点缓存并缓存命令。
Parameters
Name | Type |
---|---|
cacheID | number |
layout | number |
count | number |
list | Mesh_vertex_buffer [] |
passEncoder | GLRenderPassEncoder |
Returns
number
Inherited from
Shutdown
▸ Shutdown(): Promise
<{ bindingCount
: number
; bufferCount
: number
; bufferSize
: number
; destroyCount
: number
; groupLayoutCount
: number
; pipelineLayoutCount
: number
; renderTextureCount
: number
; renderTextureSize
: number
; samplerCount
: number
; shaderBranchCount
: number
; shaderCount
: number
; shaderPassCount
: number
; textureCount
: number
; textureSize
: number
; vertexLayoutCount
: number
}>
关闭着色管线装配工,保留资源池最终状态。
Returns
Promise
<{ bindingCount
: number
; bufferCount
: number
; bufferSize
: number
; destroyCount
: number
; groupLayoutCount
: number
; pipelineLayoutCount
: number
; renderTextureCount
: number
; renderTextureSize
: number
; samplerCount
: number
; shaderBranchCount
: number
; shaderCount
: number
; shaderPassCount
: number
; textureCount
: number
; textureSize
: number
; vertexLayoutCount
: number
}>
Status
▸ Status(final
): Object
状态统计。
Parameters
Name | Type |
---|---|
final | boolean |
Returns
Object
Name | Type |
---|---|
bindingCount | number |
bufferCount | number |
bufferSize | number |
destroyCount | number |
groupLayoutCount | number |
pipelineLayoutCount | number |
renderTextureCount | number |
renderTextureSize | number |
samplerCount | number |
shaderBranchCount | number |
shaderCount | number |
shaderPassCount | number |
textureCount | number |
textureSize | number |
vertexLayoutCount | number |
Submit
▸ Submit(commandBuffers
, onDone
): void
提交帧命令缓存。
Parameters
Name | Type |
---|---|
commandBuffers | GLCommandBuffer [] |
onDone | () => void |
Returns
void
Inherited from
WriteBuffer
▸ WriteBuffer(bufferID
, ptr
, offset
, size
): void
写入缓存数据。
Parameters
Name | Type |
---|---|
bufferID | number |
ptr | io_ptr |
offset | number |
size | number |
Returns
void
Inherited from
WriteTexture2D_KTX
▸ WriteTexture2D_KTX(id
, bitmap
): void
写入2D纹理数据。
Parameters
Name | Type |
---|---|
id | number |
bitmap | Object |
bitmap.data | Image_ktx |
bitmap.layer | number |
bitmap.xoffset | number |
bitmap.yoffset | number |
Returns
void
Inherited from
WriteTexture2D_RAW
▸ WriteTexture2D_RAW(id
, isRT
, bitmap
): void
写入2D纹理数据。
Parameters
Name | Type |
---|---|
id | number |
isRT | boolean |
bitmap | any |
Returns
void