if (!view)
continue;
+ const struct anv_format *format =
+ anv_format_for_vk_format(view->format);
+
struct anv_state state =
anv_cmd_buffer_alloc_surface_state(cmd_buffer, 64, 64);
d->dynamic_offsets[surface_slots[b].dynamic_slot];
offset = view->offset + dynamic_offset;
- anv_fill_buffer_surface_state(state.map, view->format, offset,
+ anv_fill_buffer_surface_state(state.map, format, offset,
view->range - dynamic_offset);
} else {
offset = view->offset;
// Buffer view functions
void
-anv_fill_buffer_surface_state(void *state, VkFormat format,
+anv_fill_buffer_surface_state(void *state, const struct anv_format *format,
uint32_t offset, uint32_t range)
{
- const struct anv_format *info;
-
- info = anv_format_for_vk_format(format);
/* This assumes RGBA float format. */
uint32_t stride = 4;
uint32_t num_elements = range / stride;
struct GEN8_RENDER_SURFACE_STATE surface_state = {
.SurfaceType = SURFTYPE_BUFFER,
.SurfaceArray = false,
- .SurfaceFormat = info->surface_format,
+ .SurfaceFormat = format->surface_format,
.SurfaceVerticalAlignment = VALIGN4,
.SurfaceHorizontalAlignment = HALIGN4,
.TileMode = LINEAR,
view->range = pCreateInfo->range;
anv_fill_buffer_surface_state(view->surface_state.map,
- pCreateInfo->format,
+ anv_format_for_vk_format(pCreateInfo->format),
view->offset, pCreateInfo->range);
*pView = anv_buffer_view_to_handle(bview);
struct anv_device *device,
const VkAttachmentViewCreateInfo* pCreateInfo,
struct anv_cmd_buffer *cmd_buffer);
-void anv_fill_buffer_surface_state(void *state, VkFormat format,
+void anv_fill_buffer_surface_state(void *state, const struct anv_format *format,
uint32_t offset, uint32_t range);
void anv_surface_view_fini(struct anv_device *device,