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

Should the spec mention location aliasing? #956

@iraiter2

Description

@iraiter2

In <section 20.1.1> of the Vulkan spec there is a paragraph explaining:

"Location aliasing is causing two variables to have the same location number. Component aliasing is assigning the same (or overlapping) component number for two location aliases. Location aliasing is allowed only if it does not cause component aliasing. Further, when location aliasing, the aliases sharing the location must all have the same SPIR-V floating-point component type or all have the same width integer-type components."

Similarly, the GLSL wiki explains use-cases for location aliasing in the "Interface components" section <here>. Mainly it seems to be useful for putting data into unused space, such as when passing a buffer full of mat2's (which internally are represented as vec4's, leading to 4 unused floats per mat2).

Are these limits something we should specify in the WebGPU or WGSL specs?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionwgslWebGPU Shading Language Issueswgsl resolvedResolved - waiting for a change to the WGSL specification

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions