mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-28 12:08:24 +02:00
The rectangle to clear, which is the render area for subpass clears, is
specified in framebuffer coordinates, but the hardware uses GMEM
coordinates with FDM. I assumed this was ok for subpass clears, because
the end of the bin in GMEM coordinates is always less than or equal to
the end in framebuffer coordinates, so we would clear past the end of
the bin which is still safe because only the render area would be stored
to sysmem:
bin 0 bin 1 bin 2
|---| |---| |---| GMEM coordinates (what the HW "sees")
|-------|-------|-------| framebuffer coordinates (used e.g.
as STORE_OP_STORE destination)
|-----------------------| render area/clear rectangle (past end of bin
in GMEM coordinates!)
There was a hack for FDM offset, where framebuffer coordinates are
shifted to the left, but that was it. However this breaks down if the
render area doesn't start at (0,0), because it can miss pixels in GMEM
coordinates that should be cleared:
bin 0 bin 1 bin 2
|---| |---| |---| GMEM coordinates (what the HW "sees")
|-------|-------|-------| framebuffer coordinates (used e.g.
as STORE_OP_STORE destination)
|------------------| render area/clear rectangle (we don't clear
bin 0!)
Here we should clear the right half of bin 0 but instead we don't clear
it at all.
Instead of adding yet more hacks to expand the render area, just add a
patchpoint to transform the render area into GMEM coordinates. We
already do this for CmdClearAttachments where we didn't have a choice,
so just reuse that. As a bonus, we can also delete the hack for FDM
offset.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39495>
|
||
|---|---|---|
| .. | ||
| amd | ||
| android_stub | ||
| asahi | ||
| broadcom | ||
| c11 | ||
| compiler | ||
| drm-shim | ||
| egl | ||
| etnaviv | ||
| freedreno | ||
| gallium | ||
| gbm | ||
| getopt | ||
| gfxstream | ||
| glx | ||
| gtest | ||
| imagination | ||
| imgui | ||
| intel | ||
| kosmickrisp | ||
| loader | ||
| mesa | ||
| microsoft | ||
| nouveau | ||
| panfrost | ||
| poly | ||
| tool | ||
| util | ||
| virtio | ||
| vulkan | ||
| x11 | ||
| .clang-format | ||
| meson.build | ||