uint32_t bo_offset;
switch (desc->type) {
- case ANV_DESCRIPTOR_TYPE_EMPTY:
- case ANV_DESCRIPTOR_TYPE_SAMPLER:
+ case VK_DESCRIPTOR_TYPE_SAMPLER:
/* Nothing for us to do here */
continue;
- case ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET: {
+
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER:
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER:
+ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
+ case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: {
bo = desc->buffer->bo;
bo_offset = desc->buffer->offset + desc->offset;
bo_offset, desc->range);
break;
}
- case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW:
- case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER:
+
+ case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
+ case VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT:
surface_state = desc->image_view->nonrt_surface_state;
bo = desc->image_view->bo;
bo_offset = desc->image_view->offset;
break;
+
+ case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE:
+ case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER:
+ case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER:
+ assert(!"Unsupported descriptor type");
+ break;
}
bt_map[bias + s] = surface_state.offset + state_offset;
cmd_buffer->state.descriptors[binding->set];
struct anv_descriptor *desc = &set->descriptors[binding->offset];
- if (desc->type != ANV_DESCRIPTOR_TYPE_SAMPLER &&
- desc->type != ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER)
+ if (desc->type != VK_DESCRIPTOR_TYPE_SAMPLER &&
+ desc->type != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
continue;
struct anv_sampler *sampler = desc->sampler;
- /* FIXME: We shouldn't have to do this */
+ /* This can happen if we have an unfilled slot since TYPE_SAMPLER
+ * happens to be zero.
+ */
if (sampler == NULL)
continue;
write->pDescriptors[j].sampler);
desc[j] = (struct anv_descriptor) {
- .type = ANV_DESCRIPTOR_TYPE_SAMPLER,
+ .type = VK_DESCRIPTOR_TYPE_SAMPLER,
.sampler = sampler,
};
}
ANV_FROM_HANDLE(anv_sampler, sampler,
write->pDescriptors[j].sampler);
- desc[j].type = ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER;
+ desc[j].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
desc[j].image_view = iview;
/* If this descriptor has an immutable sampler, we don't want
write->pDescriptors[j].imageView);
desc[j] = (struct anv_descriptor) {
- .type = ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
+ .type = write->descriptorType,
.image_view = iview,
};
}
assert(buffer);
desc[j] = (struct anv_descriptor) {
- .type = ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
+ .type = write->descriptorType,
.buffer = buffer,
.offset = write->pDescriptors[j].bufferInfo.offset,
.range = write->pDescriptors[j].bufferInfo.range,
struct anv_descriptor_set_binding_layout binding[0];
};
-enum anv_descriptor_type {
- ANV_DESCRIPTOR_TYPE_EMPTY = 0,
- ANV_DESCRIPTOR_TYPE_BUFFER_AND_OFFSET,
- ANV_DESCRIPTOR_TYPE_IMAGE_VIEW,
- ANV_DESCRIPTOR_TYPE_SAMPLER,
- ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER,
-};
-
struct anv_descriptor {
- enum anv_descriptor_type type;
+ VkDescriptorType type;
union {
struct {