From c80e18201973bd80de36532b795ca56cccdea168 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 18 Oct 2024 19:05:01 +0200 Subject: [PATCH] panvk: Fix the maximum sampler LOD bias The LOD bias in encoded in a signed 8.8 fixed point, meaning the valid range is [-128,+127.966] not [-255,+255]. Since .maxSamplerLodBias encodes an absolute value not a range, we make it [-127.996,+127,996]. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Reviewed-by: Lars-Ivar Hesselberg Simonsen Acked-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_physical_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_physical_device.c b/src/panfrost/vulkan/panvk_physical_device.c index 286db7e8ebf..8f97490f01d 100644 --- a/src/panfrost/vulkan/panvk_physical_device.c +++ b/src/panfrost/vulkan/panvk_physical_device.c @@ -513,7 +513,7 @@ get_device_properties(const struct panvk_instance *instance, .maxDrawIndexedIndexValue = UINT32_MAX, /* Make it one for now. */ .maxDrawIndirectCount = 1, - .maxSamplerLodBias = 255, + .maxSamplerLodBias = (float)INT16_MAX / 256.0f, .maxSamplerAnisotropy = 16, .maxViewports = 1, /* Same as the framebuffer limit. */