KhronosGroup / KhronosGroup/Vulkan-Docs

Sample Shading and FragCoord interpolation not fully specified for Z and W.

Open
#1,544 0 comments 0 reactions 1 assignee Claimed by @TomOlson View on GitHub
Dominant language
JavaScript
Stars
3.3k
Forks
549
Avg merge
5d 5h
Merged PRs (30d)
2

Description

With regard to FragCoord and sample shading, the standard says this:

> When Sample Shading is enabled, the x and y components of FragCoord reflect the location of one of the samples corresponding to the shader invocation.
>
> Otherwise, the x and y components of FragCoord reflect the location of the center of the fragment.
>
> The z component of FragCoord is the interpolated depth value of the primitive.
>
> The w component is the interpolated 1/w​.

This makes it clear that the XY components represent the sample being processed. But it doesn't explicitly say that the interpolation for Z and W work the same way, only that they are "interpolated". That is, it doesn't say where it is interpolated *to*, unlike X and Y.

Obviously it wouldn't make sense for X and Y to be interpolated to one of the samples but Z and W not to be. But it doesn't explicitly say.

Also, "depth value of the primitive" probably ought to be "depth value of the fragment".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.