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

Consider adding a [[sample_position]] #1994

@Kangz

Description

@Kangz

This fragment input builtin gives the position inside the pixel of the current fragment. (as a vec2<f32> with each coordinate in [0, 1])

Metal

This is the same as [[point_coord]] in Metal.

Vulkan

This is the same as SPIR-V's SamplePosition builtin. It requires the sampleRateShading but that's pretty much ubiquitous and already required by [[sample_index]] that maps to SampleID in SPIR-V.

D3D12

D3D12 doesn't have an equivalent builtin. However the multisampling pattern is known at pipeline compilation time (and in most implementations I expect it to be known statically). So this builtin could be emulated by using [[sample_index]] to index a static array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions