state = anv_cmd_buffer_alloc_dynamic_state(cmd_buffer, size, alignment);
memcpy(state.map, data, size);
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
VG(VALGRIND_CHECK_MEM_IS_DEFINED(state.map, size));
for (uint32_t i = 0; i < dwords; i++)
p[i] = a[i] | b[i];
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
VG(VALGRIND_CHECK_MEM_IS_DEFINED(p, dwords * 4));
u32_map[i] = *(uint32_t *)((uint8_t *)data + offset);
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
return state;
}
}
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
return state;
}
state = anv_state_pool_alloc(pool, size, align);
memcpy(state.map, p, size);
- if (!pool->block_pool->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(pool->block_pool->device, state);
return state;
}
.format = format,
.stride = stride);
- if (!device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(device, state);
}
void anv_DestroySampler(
.aux_usage = surf_usage,
.mocs = device->default_mocs);
- if (!device->info.has_llc)
- anv_state_flush(iview->sampler_surface_state);
+ anv_state_flush(device, iview->sampler_surface_state);
} else {
iview->sampler_surface_state.alloc_size = 0;
}
&iview->storage_image_param,
&surface->isl, &iview->isl);
- if (!device->info.has_llc) {
- anv_state_flush(iview->storage_surface_state);
- anv_state_flush(iview->writeonly_storage_surface_state);
- }
+ anv_state_flush(device, iview->storage_surface_state);
+ anv_state_flush(device, iview->writeonly_storage_surface_state);
} else {
iview->storage_surface_state.alloc_size = 0;
iview->writeonly_storage_surface_state.alloc_size = 0;
__builtin_ia32_mfence();
}
-static void inline
-anv_state_flush(struct anv_state state)
-{
- anv_flush_range(state.map, state.alloc_size);
-}
-
VkResult anv_block_pool_init(struct anv_block_pool *pool,
struct anv_device *device, uint32_t block_size);
void anv_block_pool_finish(struct anv_block_pool *pool);
pthread_cond_t queue_submit;
};
+static void inline
+anv_state_flush(struct anv_device *device, struct anv_state state)
+{
+ if (device->info.has_llc)
+ return;
+
+ anv_flush_range(state.map, state.alloc_size);
+}
+
void anv_device_init_blorp(struct anv_device *device);
void anv_device_finish_blorp(struct anv_device *device);
ssp.ScissorRectPointer = scissor_state.offset;
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(scissor_state);
+ anv_state_flush(cmd_buffer->device, scissor_state);
}
#endif
.BackfaceStencilReferenceValue = d->stencil_reference.back & 0xff,
};
GENX(COLOR_CALC_STATE_pack)(NULL, cc_state.map, &cc);
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(cc_state);
+ anv_state_flush(cmd_buffer->device, cc_state);
anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS), ccp) {
ccp.ColorCalcStatePointer = cc_state.offset;
&sf_clip_viewport);
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(sf_clip_state);
+ anv_state_flush(cmd_buffer->device, sf_clip_state);
anv_batch_emit(&cmd_buffer->batch,
GENX(3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP), clip) {
GENX(CC_VIEWPORT_pack)(NULL, cc_state.map + i * 8, &cc_viewport);
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(cc_state);
+ anv_state_flush(cmd_buffer->device, cc_state);
anv_batch_emit(&cmd_buffer->batch,
GENX(3DSTATE_VIEWPORT_STATE_POINTERS_CC), cc) {
};
GENX(COLOR_CALC_STATE_pack)(NULL, cc_state.map, &cc);
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(cc_state);
+ anv_state_flush(cmd_buffer->device, cc_state);
anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS), ccp) {
ccp.ColorCalcStatePointer = cc_state.offset;
};
GEN9_COLOR_CALC_STATE_pack(NULL, cc_state.map, &cc);
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(cc_state);
+ anv_state_flush(cmd_buffer->device, cc_state);
anv_batch_emit(&cmd_buffer->batch, GEN9_3DSTATE_CC_STATE_POINTERS, ccp) {
ccp.ColorCalcStatePointer = cc_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 *
}
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state->render_pass_states);
+ anv_state_flush(cmd_buffer->device, state->render_pass_states);
}
}
assert(image == map->image_count);
out:
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(*bt_state);
+ anv_state_flush(cmd_buffer->device, *bt_state);
return VK_SUCCESS;
}
sampler->state, sizeof(sampler->state));
}
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(*state);
+ anv_state_flush(cmd_buffer->device, *state);
return VK_SUCCESS;
}
((uint32_t *)id_state.map)[0] = base_vertex;
((uint32_t *)id_state.map)[1] = base_instance;
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(id_state);
+ anv_state_flush(cmd_buffer->device, id_state);
emit_base_vertex_instance_bo(cmd_buffer,
&cmd_buffer->device->dynamic_state_block_pool.bo, id_state.offset);
((uint32_t *)state.map)[0] = draw_index;
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
emit_vertex_bo(cmd_buffer,
&cmd_buffer->device->dynamic_state_block_pool.bo,
sizes[0] = x;
sizes[1] = y;
sizes[2] = z;
- if (!cmd_buffer->device->info.has_llc)
- anv_state_flush(state);
+ anv_state_flush(cmd_buffer->device, state);
cmd_buffer->state.num_workgroups_offset = state.offset;
cmd_buffer->state.num_workgroups_bo =
&cmd_buffer->device->dynamic_state_block_pool.bo;
#endif
GENX(BLEND_STATE_pack)(NULL, pipeline->blend_state.map, &blend_state);
- if (!device->info.has_llc)
- anv_state_flush(pipeline->blend_state);
+ anv_state_flush(device, pipeline->blend_state);
anv_batch_emit(&pipeline->batch, GENX(3DSTATE_BLEND_STATE_POINTERS), bsp) {
bsp.BlendStatePointer = pipeline->blend_state.offset;