diff options
author | Jason Ekstrand <[email protected]> | 2020-02-06 21:18:59 -0600 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-28 22:55:25 +0000 |
commit | fd817291c7f87985d9ef9015cc086d1b5fd86825 (patch) | |
tree | 6151023c58b1e305b86cee0d39a5fbfa58445872 /src/intel/vulkan/anv_device.c | |
parent | ac581a06a4d33905eedcf5f18ae7be8ca3bca32c (diff) |
anv: Handle NULL descriptors
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4767>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index c5c56fbc20f..82b73bc0595 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -2890,6 +2890,18 @@ VkResult anv_CreateDevice( if (result != VK_SUCCESS) goto fail_workaround_bo; + /* Allocate a null surface state at surface state offset 0. This makes + * NULL descriptor handling trivial because we can just memset structures + * to zero and they have a valid descriptor. + */ + device->null_surface_state = + anv_state_pool_alloc(&device->surface_state_pool, + device->isl_dev.ss.size, + device->isl_dev.ss.align); + isl_null_fill_state(&device->isl_dev, device->null_surface_state.map, + isl_extent3d(1, 1, 1) /* This shouldn't matter */); + assert(device->null_surface_state.offset == 0); + if (device->info.gen >= 10) { result = anv_device_init_hiz_clear_value_bo(device); if (result != VK_SUCCESS) |