u_upload_destroy(ctx->stream_uploader);
iris_destroy_program_cache(ice);
+ u_upload_destroy(ice->state.surface_uploader);
+ u_upload_destroy(ice->state.dynamic_uploader);
iris_batch_free(&ice->render_batch);
iris_init_program_cache(ice);
+ ice->state.surface_uploader =
+ u_upload_create(&ice->ctx, 16384, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
+ IRIS_RESOURCE_FLAG_SURFACE_MEMZONE);
+ ice->state.dynamic_uploader =
+ u_upload_create(&ice->ctx, 16384, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
+ IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE);
+
genX_call(devinfo, init_state, ice);
ice->state.init_render_context(screen, &ice->render_batch, &ice->dbg);
struct iris_bo;
struct iris_batch;
-#define IRIS_RESOURCE_FLAG_INSTRUCTION_CACHE (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
+#define IRIS_RESOURCE_FLAG_SHADER_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 0)
+#define IRIS_RESOURCE_FLAG_SURFACE_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 1)
+#define IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 2)
#define IRIS_MAX_TEXTURE_SAMPLERS 32
#define IRIS_MAX_VIEWPORTS 16
struct iris_sampler_state *samplers[MESA_SHADER_STAGES][IRIS_MAX_TEXTURE_SAMPLERS];
+ struct u_upload_mgr *surface_uploader;
+ struct u_upload_mgr *dynamic_uploader;
+
void (*destroy_state)(struct iris_context *ice);
void (*init_render_context)(struct iris_screen *screen,
struct iris_batch *batch,
ice->shaders.uploader =
u_upload_create(&ice->ctx, 16384, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
- IRIS_RESOURCE_FLAG_INSTRUCTION_CACHE);
+ IRIS_RESOURCE_FLAG_SHADER_MEMZONE);
}
void
enum iris_memory_zone memzone = IRIS_MEMZONE_OTHER;
const char *name = "resource";
- if (templ->flags & IRIS_RESOURCE_FLAG_INSTRUCTION_CACHE) {
+ if (templ->flags & IRIS_RESOURCE_FLAG_SHADER_MEMZONE) {
memzone = IRIS_MEMZONE_SHADER;
name = "shader kernels";
+ } else if (templ->flags & IRIS_RESOURCE_FLAG_SURFACE_MEMZONE) {
+ memzone = IRIS_MEMZONE_SURFACE;
+ name = "surface state";
+ } else if (templ->flags & IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE) {
+ memzone = IRIS_MEMZONE_DYNAMIC;
+ name = "dynamic state";
}
res->bo = iris_bo_alloc_tiled(screen->bufmgr, name, res->surf.size_B,