mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 08:08:06 +02:00
tu: Fix FDM texel size calculation
It turns out that it was intended to round down when dividing the framebuffer size by FDM size and all other implementations of VK_EXT_fragment_density_map did that. We followed the spec, which doesn't say to round (which is equivalent to rounding up), but the spec will be updated to reflect the intended behavior. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39434>
This commit is contained in:
parent
fbc97b24d1
commit
09b9205117
1 changed files with 2 additions and 2 deletions
|
|
@ -1428,8 +1428,8 @@ tu_fragment_density_map_sample(const struct tu_image_view *fdm,
|
|||
{
|
||||
assert(fdm->image->layout[0].tile_mode == TILE6_LINEAR);
|
||||
|
||||
uint32_t fdm_shift_x = util_logbase2_ceil(DIV_ROUND_UP(width, fdm->vk.extent.width));
|
||||
uint32_t fdm_shift_y = util_logbase2_ceil(DIV_ROUND_UP(height, fdm->vk.extent.height));
|
||||
uint32_t fdm_shift_x = util_logbase2_ceil(width / fdm->vk.extent.width);
|
||||
uint32_t fdm_shift_y = util_logbase2_ceil(height / fdm->vk.extent.height);
|
||||
|
||||
fdm_shift_x = CLAMP(fdm_shift_x, MIN_FDM_TEXEL_SIZE_LOG2, MAX_FDM_TEXEL_SIZE_LOG2);
|
||||
fdm_shift_y = CLAMP(fdm_shift_y, MIN_FDM_TEXEL_SIZE_LOG2, MAX_FDM_TEXEL_SIZE_LOG2);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue