这是indexloc提供的服务,不要输入任何密码
Skip to content

[Immediate Data] Shall we support per-stage immediate data? #5116

@shaoboyan091

Description

@shaoboyan091

In previous discussion about immediate data, there is a left homework to investigate "push constant range" is unified range or seperated ranges between shader stages.

Here are some findings:

Backends Is Unified Note
Vulkan True According to this validation rule for vkCmdPushConstants, the push constant range is unified
D3D12 True APIs that update RootConstants don't have shader stage parameter
Metal False SetVertexBytes()::index : An integer that represents the entry in the fragment shader argument table for buffers that stores a record of the MTLBuffer the method creates from bytes.
SetFragmentBytes()::index: An integer that represents the entry in the fragment shader argument table for buffers that stores a record of the MTLBuffer the method creates from bytes.
SetBytes()::index: The index the data binds to in the argument table.

According to above result, I tend to not support per-stage immediate data range. Vulkan and D3D12 use unified "immediate data range". Metal supports per-stage "immediate data range" but doesn't have space limitation (Metal doc suggests "Smaller than 4kB"). And Metal could easily support unified "immediate data range" in implementation by calling setXXBytes multiple times for all stages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIapi resolvedResolved - waiting for a change to the API specification

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions