switch (desc->type) {
case ANV_DESCRIPTOR_TYPE_EMPTY:
case ANV_DESCRIPTOR_TYPE_SAMPLER:
+ /* Nothing for us to do here */
continue;
case ANV_DESCRIPTOR_TYPE_BUFFER_VIEW:
surface_state = &desc->buffer_view->surface_state;
break;
}
case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW:
+ case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER:
surface_state = &desc->image_view->nonrt_surface_state;
bo = desc->image_view->bo;
bo_offset = desc->image_view->offset;
break;
- case ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER:
- /* Nothing for us to do here */
- break;
}
bt_map[bias + s] = surface_state->offset + state_offset;
struct anv_sampler *sampler = desc->sampler;
+ /* FIXME: We shouldn't have to do this */
+ if (sampler == NULL)
+ continue;
+
memcpy(state->map + (s * 16),
sampler->state, sizeof(sampler->state));
}
switch (write->descriptorType) {
case VK_DESCRIPTOR_TYPE_SAMPLER:
- case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
for (uint32_t j = 0; j < write->count; j++) {
ANV_FROM_HANDLE(anv_sampler, sampler,
write->pDescriptors[j].sampler);
.sampler = sampler,
};
}
+ break;
- if (write->descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER)
- break;
+ case VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER:
+ for (uint32_t j = 0; j < write->count; j++) {
+ ANV_FROM_HANDLE(anv_image_view, iview,
+ write->pDescriptors[j].imageView);
+ ANV_FROM_HANDLE(anv_sampler, sampler,
+ write->pDescriptors[j].sampler);
- /* fallthrough */
+ set->descriptors[write->destBinding + j] = (struct anv_descriptor) {
+ .type = ANV_DESCRIPTOR_TYPE_IMAGE_VIEW_AND_SAMPLER,
+ .image_view = iview,
+ .sampler = sampler,
+ };
+ }
+ break;
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: