struct blorp_address address, uint32_t delta)
{
struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
- anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
- ss_offset, address.buffer, address.offset + delta);
+ VkResult result =
+ anv_reloc_list_add(&cmd_buffer->surface_relocs, &cmd_buffer->pool->alloc,
+ ss_offset, address.buffer, address.offset + delta);
+ if (result != VK_SUCCESS)
+ anv_batch_set_error(&cmd_buffer->batch, result);
}
static void *
blorp_alloc_dynamic_state(struct blorp_batch *batch,
- enum aub_state_struct_type type,
uint32_t size,
uint32_t alignment,
uint32_t *offset)
struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
uint32_t state_offset;
- struct anv_state bt_state =
+ struct anv_state bt_state;
+
+ VkResult result =
anv_cmd_buffer_alloc_blorp_binding_table(cmd_buffer, num_entries,
- &state_offset);
+ &state_offset, &bt_state);
+ if (result != VK_SUCCESS)
+ return;
uint32_t *bt_map = bt_state.map;
*bt_offset = bt_state.offset;
surface_maps[i] = surface_state.map;
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(bt_state);
+ anv_state_flush(cmd_buffer->device, bt_state);
}
static void *
struct blorp_address *addr)
{
struct anv_cmd_buffer *cmd_buffer = batch->driver_batch;
+
+ /* From the Skylake PRM, 3DSTATE_VERTEX_BUFFERS:
+ *
+ * "The VF cache needs to be invalidated before binding and then using
+ * Vertex Buffers that overlap with any previously bound Vertex Buffer
+ * (at a 64B granularity) since the last invalidation. A VF cache
+ * invalidate is performed by setting the "VF Cache Invalidation Enable"
+ * bit in PIPE_CONTROL."
+ *
+ * This restriction first appears in the Skylake PRM but the internal docs
+ * also list it as being an issue on Broadwell. In order to avoid this
+ * problem, we align all vertex buffer allocations to 64 bytes.
+ */
struct anv_state vb_state =
- anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, size, 16);
+ anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, size, 64);
*addr = (struct blorp_address) {
.buffer = &cmd_buffer->device->dynamic_state_block_pool.bo,
entry_size);
}
-void genX(blorp_exec)(struct blorp_batch *batch,
- const struct blorp_params *params);
-
void
genX(blorp_exec)(struct blorp_batch *batch,
const struct blorp_params *params)
*/
genX(cmd_buffer_enable_pma_fix)(cmd_buffer, false);
+ /* Disable VF statistics */
+ blorp_emit(batch, GENX(3DSTATE_VF_STATISTICS), vf) {
+ vf.StatisticsEnable = false;
+ }
+
blorp_exec(batch, params);
cmd_buffer->state.vb_dirty = ~0;