gen8_state: use iview extent to program RENDER_SURFACE_STATE
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 4 Jan 2016 22:53:55 +0000 (14:53 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 27 Jan 2016 23:12:42 +0000 (15:12 -0800)
When creating an uncompressed ImageView on an compressed Image, the
SurfaceFormat is updated to match the ImageView's. The surface
dimensions must also change so that the HW sees the same size image
instead of a 4x larger one.

Fixes the following error which results from running many VulkanCTS
compressed tests in one shot:
  ResourceError (vk.queueSubmit(queue, 1, &submitInfo, *m_fence):
  VK_ERROR_OUT_OF_DEVICE_MEMORY at
  vktPipelineImageSamplingInstance.cpp:921)

Makes all compressed format tests with a height > 1 pass.

src/vulkan/gen8_state.c

index 5b3691d22d05fdbf1dcd96d310e8c85f756ebc41..3fd3187fbe70d28a061a49fef9c01d04b2fdf034 100644 (file)
@@ -206,8 +206,8 @@ genX(fill_image_surface_state)(struct anv_device *device, void *state_map,
       .BaseMipLevel = 0.0,
 
       .SurfaceQPitch = get_qpitch(&surface->isl) >> 2,
-      .Height = image->extent.height - 1,
-      .Width = image->extent.width - 1,
+      .Height = iview->level_0_extent.height - 1,
+      .Width  = iview->level_0_extent.width  - 1,
       .Depth = 0, /* TEMPLATE */
       .SurfacePitch = surface->isl.row_pitch - 1,
       .RenderTargetViewExtent = 0, /* TEMPLATE */