/* Allocate null surface state for the buffer views since
* we lazy allocate this in the write anyway.
*/
- for (uint32_t b = 0; b < set->buffer_view_count; b++) {
- set->buffer_views[b].surface_state = ANV_STATE_NULL;
- set->buffer_views[b].range = 0;
+ if (pool->allocate_surface_states) {
+ for (uint32_t b = 0; b < set->buffer_view_count; b++) {
+ set->buffer_views[b].surface_state =
+ anv_descriptor_pool_alloc_state(pool);
+ }
}
list_addtail(&set->pool_link, &pool->desc_sets);
anv_descriptor_pool_free_state(pool, set->desc_surface_state);
}
- for (uint32_t b = 0; b < set->buffer_view_count; b++) {
- if (set->buffer_views[b].surface_state.alloc_size)
- anv_descriptor_pool_free_state(pool, set->buffer_views[b].surface_state);
+ if (pool->allocate_surface_states) {
+ for (uint32_t b = 0; b < set->buffer_view_count; b++) {
+ if (set->buffer_views[b].surface_state.alloc_size)
+ anv_descriptor_pool_free_state(pool, set->buffer_views[b].surface_state);
+ }
}
list_del(&set->pool_link);
* vkAllocateDescriptorSets. */
if (alloc_stream) {
bview->surface_state = anv_state_stream_alloc(alloc_stream, 64, 64);
- } else if (bview->surface_state.alloc_size == 0) {
- bview->surface_state = anv_descriptor_pool_alloc_state(set->pool);
}
+ assert(bview->surface_state.alloc_size);
+
isl_surf_usage_flags_t usage =
(type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER ||
type == VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC) ?