if (!res->bo)
goto fail;
+ if (templ->flags & IRIS_RESOURCE_FLAG_INSTRUCTION_CACHE) {
+ // XXX: p_atomic_add is backwards :(
+ res->bo->gtt_offset = __atomic_fetch_add(&screen->next_instruction_address, res->bo->size, __ATOMIC_ACQ_REL);
+ }
+
return &res->base;
fail:
pscreen->fence_finish = iris_fence_finish;
pscreen->query_memory_info = iris_query_memory_info;
+ /* Put them somewhere non-zero */
+ screen->next_instruction_address = 128 * 1024;
+
return pscreen;
}
struct isl_device isl_dev;
struct iris_bufmgr *bufmgr;
struct brw_compiler *compiler;
+
+ uint32_t next_instruction_address;
};
struct pipe_screen *iris_screen_create(int fd);