mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
tu: Fix 3d load and clear when FDM bin offsets are in use
Unlike the store/resolve that uses A2D, The FDM load path uses the 3d
pipeline and is therefore affected by the hardware FDM offset registers.
The fallback sysmem clear path also uses the 3d pipeline. Subtract off
the HW offset from the destination coordinates, similar to how it is
subtracted from viewport and scissor.
Fixes: b34b089ca1 ("tu: Use GRAS bin offset registers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37496>
This commit is contained in:
parent
c5acf58fba
commit
964e84d468
1 changed files with 9 additions and 0 deletions
|
|
@ -3977,8 +3977,12 @@ fdm_apply_sysmem_clear_coords(struct tu_cmd_buffer *cmd,
|
|||
|
||||
VkExtent2D frag_area = frag_areas[MIN2(state->view, views - 1)];
|
||||
VkRect2D bin = bins[MIN2(state->view, views - 1)];
|
||||
VkOffset2D hw_viewport_offset =
|
||||
hw_viewport_offsets[MIN2(state->view, views - 1)];
|
||||
|
||||
VkOffset2D offset = tu_fdm_per_bin_offset(frag_area, bin, common_bin_offset);
|
||||
offset.x -= hw_viewport_offset.x;
|
||||
offset.y -= hw_viewport_offset.y;
|
||||
|
||||
unsigned x1 = state->rect.offset.x / frag_area.width + offset.x;
|
||||
unsigned x2 = DIV_ROUND_UP(state->rect.offset.x + state->rect.extent.width,
|
||||
|
|
@ -4886,12 +4890,17 @@ fdm_apply_load_coords(struct tu_cmd_buffer *cmd,
|
|||
(const struct apply_load_coords_state *)data;
|
||||
VkExtent2D frag_area = frag_areas[MIN2(state->view, views - 1)];
|
||||
VkRect2D bin = bins[MIN2(state->view, views - 1)];
|
||||
VkOffset2D hw_viewport_offset =
|
||||
hw_viewport_offsets[MIN2(state->view, views - 1)];
|
||||
|
||||
assert(bin.extent.width % frag_area.width == 0);
|
||||
assert(bin.extent.height % frag_area.height == 0);
|
||||
uint32_t scaled_width = bin.extent.width / frag_area.width;
|
||||
uint32_t scaled_height = bin.extent.height / frag_area.height;
|
||||
|
||||
common_bin_offset.x -= hw_viewport_offset.x;
|
||||
common_bin_offset.y -= hw_viewport_offset.y;
|
||||
|
||||
const float coords[] = {
|
||||
common_bin_offset.x, common_bin_offset.y,
|
||||
bin.offset.x, bin.offset.y,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue