uint32_t *dynamic_offset_count,
const uint32_t **dynamic_offsets)
{
+ /* Either we have no pool because it's a push descriptor or the pool is not
+ * host only :
+ *
+ * VUID-vkCmdBindDescriptorSets-pDescriptorSets-04616:
+ *
+ * "Each element of pDescriptorSets must not have been allocated from a
+ * VkDescriptorPool with the
+ * VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE flag set"
+ */
+ assert(!set->pool || !set->pool->host_only);
+
struct anv_descriptor_set_layout *set_layout =
layout->set[set_index].layout;
pool->size = pool_size;
pool->next = 0;
pool->free_list = EMPTY;
- pool->allocate_surface_states = (pCreateInfo->flags & VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE) == 0;
+ pool->host_only = pCreateInfo->flags & VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE;
if (descriptor_bo_size > 0) {
VkResult result = anv_device_alloc_bo(device,
static struct anv_state
anv_descriptor_pool_alloc_state(struct anv_descriptor_pool *pool)
{
- assert(pool->allocate_surface_states);
+ assert(!pool->host_only);
struct surface_state_free_list_entry *entry =
pool->surface_state_free_list;
anv_isl_format_for_descriptor_type(device,
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER);
- if (pool->allocate_surface_states) {
+ if (!pool->host_only) {
set->desc_surface_state = anv_descriptor_pool_alloc_state(pool);
anv_fill_buffer_surface_state(device, set->desc_surface_state, format,
ISL_SURF_USAGE_CONSTANT_BUFFER_BIT,
/* Allocate null surface state for the buffer views since
* we lazy allocate this in the write anyway.
*/
- if (pool->allocate_surface_states) {
+ if (!pool->host_only) {
for (uint32_t b = 0; b < set->buffer_view_count; b++) {
set->buffer_views[b].surface_state =
anv_descriptor_pool_alloc_state(pool);
anv_descriptor_pool_free_state(pool, set->desc_surface_state);
}
- if (pool->allocate_surface_states) {
+ if (!pool->host_only) {
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);
.sampler = sampler,
};
- if (set->pool && !set->pool->allocate_surface_states)
+ if (set->pool && set->pool->host_only)
return;
void *desc_map = set->desc_mem.map + bind_layout->descriptor_offset +
.buffer_view = buffer_view,
};
- if (set->pool && !set->pool->allocate_surface_states)
+ if (set->pool && set->pool->host_only)
return;
enum anv_descriptor_data data =
.buffer = buffer,
};
- if (set->pool && !set->pool->allocate_surface_states)
+ if (set->pool && set->pool->host_only)
return;
void *desc_map = set->desc_mem.map + bind_layout->descriptor_offset +
.accel_struct = accel,
};
- if (set->pool && !set->pool->allocate_surface_states)
+ if (set->pool && set->pool->host_only)
return;
struct anv_address_range_descriptor desc_data = { };