anv/device: Add support for combined image and sampler descriptors

This commit is contained in:
Jason Ekstrand
2015-10-15 15:17:27 -07:00
parent b459b3d82c
commit 03952b1513
2 changed files with 20 additions and 7 deletions

View File

@@ -608,6 +608,7 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
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;
@@ -626,13 +627,11 @@ anv_cmd_buffer_emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
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;
@@ -677,6 +676,10 @@ anv_cmd_buffer_emit_samplers(struct anv_cmd_buffer *cmd_buffer,
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));
}