Cocos Creator version
3.8.8
System information
Win10
Issue description
on WebGPU i need to use plane argument to read stencil, but for now there is no way to do so.
Relevant error log output
No response
Steps to reproduce
In the BasicRenderPassBuilder base class, addTexture is already declared as:
|
/** |
|
* @en Add texture for sampling |
|
* The texture must have registered in pipeline. |
|
* @zh 添加采样用的贴图,贴图必须已注册。 |
|
* @param name @en name of the texture @zh 贴图的注册名 |
|
* @param slotName @en name of descriptor in the shader @zh 着色器中描述符的名字 |
|
* @param sampler @en the sampler to use @zh 采样器名字 |
|
* @param plane @en the image plane ID to sample (color|depth|stencil|video) @zh 需要采样的贴图平面(颜色|深度|模板|视频) |
|
*/ |
|
addTexture ( |
|
name: string, |
|
slotName: string, |
|
sampler?: Sampler, |
|
plane?: number): void; |
However, the
WebRenderPassBuilder
|
addTexture (name: string, slotName: string, sampler: Sampler | null = null): void { |
|
this._addComputeResource(name, AccessType.READ, slotName); |
|
if (sampler) { |
|
const descriptorID = this._lg.attributeIndex.get(slotName)!; |
|
this._data.samplers.set(descriptorID, sampler); |
|
} |
|
} |
drops the plane parameter, likely under the assumption that the web doesn't need it... but WebGPU does support this parameter!
Simply modifying _addComputeResource
|
private _addComputeResource (name: string, accessType: AccessType, slotName: string): void { |
|
const view = renderGraphPool.createComputeView(slotName); |
|
view.accessType = accessType; |
|
if (this._pass.computeViews.has(name)) { |
|
this._pass.computeViews.get(name)?.push(view); |
|
} else { |
|
this._pass.computeViews.set(name, [view]); |
|
} |
|
} |
to add a
plane: number = 0 argument in that class to pass
plane through to
view.plane is still insufficient, because when the
executor actually binds the prepared texture, it doesn't bind the corresponding
textureView based on the provided plane.
P.S.: The native side works correctly.
Minimal reproduction project
No response
Cocos Creator version
3.8.8
System information
Win10
Issue description
on WebGPU i need to use
planeargument to read stencil, but for now there is no way to do so.Relevant error log output
No response
Steps to reproduce
In the
BasicRenderPassBuilderbase class,addTextureis already declared as:cocos4/cocos/rendering/custom/pipeline.ts
Lines 601 to 614 in f5eaf97
However, the
WebRenderPassBuildercocos4/cocos/rendering/custom/web-pipeline.ts
Lines 683 to 689 in f5eaf97
drops the plane parameter, likely under the assumption that the web doesn't need it... but WebGPU does support this parameter!
Simply modifying
_addComputeResourcecocos4/cocos/rendering/custom/web-pipeline.ts
Lines 674 to 682 in f5eaf97
to add a
plane: number = 0argument in that class to passplanethrough toview.planeis still insufficient, because when theexecutoractually binds the prepared texture, it doesn't bind the correspondingtextureViewbased on the provided plane.P.S.: The native side works correctly.
Minimal reproduction project
No response