struct iris_bufmgr *bufmgr = screen->bufmgr;
struct iris_binder *binder = &ice->state.binder;
- iris_bo_unreference(binder->bo);
+ uint64_t next_address = IRIS_MEMZONE_BINDER_START;
+
+ if (binder->bo) {
+ /* Place the new binder just after the old binder, unless we've hit the
+ * end of the memory zone...then wrap around to the start again.
+ */
+ next_address = binder->bo->gtt_offset + IRIS_BINDER_SIZE;
+ if (next_address >= IRIS_MEMZONE_SURFACE_START)
+ next_address = IRIS_MEMZONE_BINDER_START;
+
+ iris_bo_unreference(binder->bo);
+ }
+
binder->bo =
iris_bo_alloc(bufmgr, "binder", IRIS_BINDER_SIZE, IRIS_MEMZONE_BINDER);
+ binder->bo->gtt_offset = next_address;
binder->map = iris_bo_map(NULL, binder->bo, MAP_WRITE);
binder->insert_point = INIT_INSERT_POINT;
if (!shaders[stage])
continue;
- const struct brw_stage_prog_data *prog_data =
- (const void *) shaders[stage]->prog_data;
-
/* Round up the size so our next table has an aligned starting offset */
- sizes[stage] = align(prog_data->binding_table.size_bytes, BTP_ALIGNMENT);
+ sizes[stage] = align(shaders[stage]->bt.size_bytes, BTP_ALIGNMENT);
}
/* Make space for the new binding tables...this may take two tries. */
for (int stage = 0; stage <= MESA_SHADER_FRAGMENT; stage++) {
if (ice->state.dirty & (IRIS_DIRTY_BINDINGS_VS << stage)) {
binder->bt_offset[stage] = sizes[stage] > 0 ? offset : 0;
+ iris_record_state_size(ice->state.sizes,
+ binder->bo->gtt_offset + offset, sizes[stage]);
offset += sizes[stage];
}
}
return;
struct iris_binder *binder = &ice->state.binder;
- struct brw_stage_prog_data *prog_data =
- ice->shaders.prog[MESA_SHADER_COMPUTE]->prog_data;
+ struct iris_compiled_shader *shader =
+ ice->shaders.prog[MESA_SHADER_COMPUTE];
- unsigned size = prog_data->binding_table.size_bytes;
+ unsigned size = shader->bt.size_bytes;
if (size == 0)
return;