const struct anv_format *format =
anv_format_for_descriptor_type(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER);
- anv_fill_buffer_surface_state(cmd_buffer->device, surface_state.map,
+ anv_fill_buffer_surface_state(cmd_buffer->device, surface_state,
format->surface_format, bo_offset, 12, 1);
- if (!cmd_buffer->device->info.has_llc)
- anv_state_clflush(surface_state);
-
bt_map[0] = surface_state.offset + state_offset;
add_surface_state_reloc(cmd_buffer, surface_state, bo, bo_offset);
}
else
view->range = write->pBufferInfo[j].range;
- anv_fill_buffer_surface_state(device, view->surface_state.map,
+ anv_fill_buffer_surface_state(device, view->surface_state,
view->format,
view->offset, view->range, 1);
- if (!device->info.has_llc)
- anv_state_clflush(view->surface_state);
-
desc[j] = (struct anv_descriptor) {
.type = write->descriptorType,
.buffer_view = view,
}
void
-anv_fill_buffer_surface_state(struct anv_device *device, void *state,
+anv_fill_buffer_surface_state(struct anv_device *device, struct anv_state state,
enum isl_format format,
uint32_t offset, uint32_t range, uint32_t stride)
{
switch (device->info.gen) {
case 7:
if (device->info.is_haswell)
- gen75_fill_buffer_surface_state(state, format, offset, range, stride);
+ gen75_fill_buffer_surface_state(state.map, format, offset, range,
+ stride);
else
- gen7_fill_buffer_surface_state(state, format, offset, range, stride);
+ gen7_fill_buffer_surface_state(state.map, format, offset, range,
+ stride);
break;
case 8:
- gen8_fill_buffer_surface_state(state, format, offset, range, stride);
+ gen8_fill_buffer_surface_state(state.map, format, offset, range, stride);
break;
case 9:
- gen9_fill_buffer_surface_state(state, format, offset, range, stride);
+ gen9_fill_buffer_surface_state(state.map, format, offset, range, stride);
break;
default:
unreachable("unsupported gen\n");
}
+
+ if (!device->info.has_llc)
+ anv_state_clflush(state);
}
void anv_DestroySampler(
iview, pCreateInfo,
VK_IMAGE_USAGE_STORAGE_BIT);
else
- anv_fill_buffer_surface_state(device, iview->storage_surface_state.map,
+ anv_fill_buffer_surface_state(device, iview->storage_surface_state,
ISL_FORMAT_RAW,
iview->offset,
iview->bo->size - iview->offset, 1);
view->surface_state =
anv_state_pool_alloc(&device->surface_state_pool, 64, 64);
- anv_fill_buffer_surface_state(device, view->surface_state.map,
+ anv_fill_buffer_surface_state(device, view->surface_state,
view->format,
view->offset, view->range,
format->isl_layout->bs);
isl_lower_storage_image_format(&device->isl_dev, view->format) :
ISL_FORMAT_RAW;
- anv_fill_buffer_surface_state(device, view->storage_surface_state.map,
+ anv_fill_buffer_surface_state(device, view->storage_surface_state,
storage_format,
view->offset, view->range,
(storage_format == ISL_FORMAT_RAW ? 1 :
const struct anv_format *
anv_format_for_descriptor_type(VkDescriptorType type);
-void anv_fill_buffer_surface_state(struct anv_device *device, void *state,
+void anv_fill_buffer_surface_state(struct anv_device *device,
+ struct anv_state state,
enum isl_format format,
uint32_t offset, uint32_t range,
uint32_t stride);