Skip to content

Commit

Permalink
Define standard sample patterns (gpuweb#4054)
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x authored Apr 18, 2023
1 parent f59641d commit b53d15d
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -14237,15 +14237,29 @@ to the 2-dimensional rendering area of the <dfn dfn>framebuffer</dfn> -
the set of render attachments in the current {{GPURenderPassEncoder}}.
This rendering area is split into an even grid of pixels.

Rasterization determines the set of pixels affected by a primitive. In case of multi-sampling,
each pixel is further split into |descriptor|.{{GPURenderPipelineDescriptor/multisample}}.{{GPUMultisampleState/count}}
samples. The locations of samples are the same for each pixel, but not defined in this spec.

Issue: do we want to force-enable the "Standard sample locations" in Vulkan?

The [=framebuffer=] coordinates start from the top-left corner of the render targets.
Each unit corresponds exactly to a pixel. See [[#coordinate-systems]] for more information.

Rasterization determines the set of pixels affected by a primitive. In case of multi-sampling,
each pixel is further split into
|descriptor|.{{GPURenderPipelineDescriptor/multisample}}.{{GPUMultisampleState/count}} samples.
The <dfn dfn noexport>standard sample patterns</dfn> are as follows,
with positions in framebuffer coordinates relative to the top-left corner of the pixel,
such that the pixel ranges from (0, 0) to (1, 1):

<table class=data>
<thead>
<tr><th>{{GPURenderPipelineDescriptor/multisample}}.{{GPUMultisampleState/count}}<th>Sample positions
<tbody>
<tr><td>1<td>
Sample 0: (0.5, 0.5)
<tr><td>4<td>
Sample 0: (0.375, 0.125)<br>
Sample 1: (0.875, 0.375)<br>
Sample 2: (0.125, 0.625)<br>
Sample 3: (0.625, 0.875)
</table>

Let's define a <dfn dfn>FragmentDestination</dfn> to contain:
<dl dfn-for=FragmentDestination>
: <dfn dfn>position</dfn>
Expand Down

0 comments on commit b53d15d

Please sign in to comment.