radv: bump the global VRS image size to maximum supported FB dimensions
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 18 May 2023 13:31:51 +0000 (15:31 +0200)
committerMarge Bot <emma+marge@anholt.net>
Mon, 22 May 2023 06:53:03 +0000 (06:53 +0000)
Super sampling on a 4K screen could hit this. 16k seems pretty big
but this image is only created on RDNA2 and on-demand if VRS attachments
are used without depth-stencil attachments, which should be rare
enough to care.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23105>

src/amd/vulkan/radv_device.c

index 6be883d..a455f36 100644 (file)
@@ -295,10 +295,6 @@ radv_device_finish_ps_epilogs(struct radv_device *device)
 VkResult
 radv_device_init_vrs_state(struct radv_device *device)
 {
-   /* FIXME: 4k depth buffers should be large enough for now but we might want to adjust this
-    * dynamically at some point.
-    */
-   uint32_t width = 4096, height = 4096;
    VkDeviceMemory mem;
    VkBuffer buffer;
    VkResult result;
@@ -308,7 +304,7 @@ radv_device_init_vrs_state(struct radv_device *device)
       .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
       .imageType = VK_IMAGE_TYPE_2D,
       .format = VK_FORMAT_D16_UNORM,
-      .extent = {width, height, 1},
+      .extent = {MAX_FRAMEBUFFER_WIDTH, MAX_FRAMEBUFFER_HEIGHT, 1},
       .mipLevels = 1,
       .arrayLayers = 1,
       .samples = VK_SAMPLE_COUNT_1_BIT,