* 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)
+ if (next_address >= IRIS_MEMZONE_BINDLESS_START)
next_address = IRIS_MEMZONE_BINDER_START;
iris_bo_unreference(binder->bo);
memzone_name(enum iris_memory_zone memzone)
{
const char *names[] = {
- [IRIS_MEMZONE_SHADER] = "shader",
- [IRIS_MEMZONE_BINDER] = "binder",
- [IRIS_MEMZONE_SURFACE] = "surface",
- [IRIS_MEMZONE_DYNAMIC] = "dynamic",
- [IRIS_MEMZONE_OTHER] = "other",
+ [IRIS_MEMZONE_SHADER] = "shader",
+ [IRIS_MEMZONE_BINDER] = "binder",
+ [IRIS_MEMZONE_BINDLESS] = "scratchsurf",
+ [IRIS_MEMZONE_SURFACE] = "surface",
+ [IRIS_MEMZONE_DYNAMIC] = "dynamic",
+ [IRIS_MEMZONE_OTHER] = "other",
[IRIS_MEMZONE_BORDER_COLOR_POOL] = "bordercolor",
};
assert(memzone < ARRAY_SIZE(names));
enum iris_memory_zone
iris_memzone_for_address(uint64_t address)
{
- STATIC_ASSERT(IRIS_MEMZONE_OTHER_START > IRIS_MEMZONE_DYNAMIC_START);
- STATIC_ASSERT(IRIS_MEMZONE_DYNAMIC_START > IRIS_MEMZONE_SURFACE_START);
- STATIC_ASSERT(IRIS_MEMZONE_SURFACE_START > IRIS_MEMZONE_BINDER_START);
- STATIC_ASSERT(IRIS_MEMZONE_BINDER_START > IRIS_MEMZONE_SHADER_START);
+ STATIC_ASSERT(IRIS_MEMZONE_OTHER_START > IRIS_MEMZONE_DYNAMIC_START);
+ STATIC_ASSERT(IRIS_MEMZONE_DYNAMIC_START > IRIS_MEMZONE_SURFACE_START);
+ STATIC_ASSERT(IRIS_MEMZONE_SURFACE_START > IRIS_MEMZONE_BINDLESS_START);
+ STATIC_ASSERT(IRIS_MEMZONE_BINDLESS_START > IRIS_MEMZONE_BINDER_START);
+ STATIC_ASSERT(IRIS_MEMZONE_BINDER_START > IRIS_MEMZONE_SHADER_START);
STATIC_ASSERT(IRIS_BORDER_COLOR_POOL_ADDRESS == IRIS_MEMZONE_DYNAMIC_START);
if (address >= IRIS_MEMZONE_OTHER_START)
if (address >= IRIS_MEMZONE_SURFACE_START)
return IRIS_MEMZONE_SURFACE;
+ if (address >= IRIS_MEMZONE_BINDLESS_START)
+ return IRIS_MEMZONE_BINDLESS;
+
if (address >= IRIS_MEMZONE_BINDER_START)
return IRIS_MEMZONE_BINDER;
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SHADER],
PAGE_SIZE, _4GB_minus_1 - PAGE_SIZE);
+ util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_BINDLESS],
+ IRIS_MEMZONE_BINDLESS_START, IRIS_BINDLESS_SIZE);
util_vma_heap_init(&bufmgr->vma_allocator[IRIS_MEMZONE_SURFACE],
IRIS_MEMZONE_SURFACE_START,
- _4GB_minus_1 - IRIS_MAX_BINDERS * IRIS_BINDER_SIZE);
+ _4GB_minus_1 - IRIS_MAX_BINDERS * IRIS_BINDER_SIZE -
+ IRIS_BINDLESS_SIZE);
/* TODO: Why does limiting to 2GB help some state items on gfx12?
* - CC Viewport Pointer
* - Blend State Pointer
enum iris_memory_zone {
IRIS_MEMZONE_SHADER,
IRIS_MEMZONE_BINDER,
+ IRIS_MEMZONE_BINDLESS,
IRIS_MEMZONE_SURFACE,
IRIS_MEMZONE_DYNAMIC,
IRIS_MEMZONE_OTHER,
#define IRIS_BINDER_SIZE (64 * 1024)
#define IRIS_MAX_BINDERS 100
+#define IRIS_BINDLESS_SIZE (8 * 1024 * 1024)
#define IRIS_MEMZONE_SHADER_START (0ull * (1ull << 32))
#define IRIS_MEMZONE_BINDER_START (1ull * (1ull << 32))
-#define IRIS_MEMZONE_SURFACE_START (IRIS_MEMZONE_BINDER_START + IRIS_MAX_BINDERS * IRIS_BINDER_SIZE)
+#define IRIS_MEMZONE_BINDLESS_START (IRIS_MEMZONE_BINDER_START + IRIS_MAX_BINDERS * IRIS_BINDER_SIZE)
+#define IRIS_MEMZONE_SURFACE_START (IRIS_MEMZONE_BINDLESS_START + IRIS_BINDLESS_SIZE)
#define IRIS_MEMZONE_DYNAMIC_START (2ull * (1ull << 32))
#define IRIS_MEMZONE_OTHER_START (3ull * (1ull << 32))
iris_destroy_ctx_measure(ice);
u_upload_destroy(ice->state.surface_uploader);
+ u_upload_destroy(ice->state.bindless_uploader);
u_upload_destroy(ice->state.dynamic_uploader);
u_upload_destroy(ice->query_buffer_uploader);
ice->state.surface_uploader =
u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
IRIS_RESOURCE_FLAG_SURFACE_MEMZONE);
+ ice->state.bindless_uploader =
+ u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
+ IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE);
ice->state.dynamic_uploader =
u_upload_create(ctx, 64 * 1024, PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE,
IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE);
struct iris_state_ref null_fb;
struct u_upload_mgr *surface_uploader;
+ struct u_upload_mgr *bindless_uploader;
struct u_upload_mgr *dynamic_uploader;
struct iris_binder binder;
} else if (templ->flags & IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE) {
memzone = IRIS_MEMZONE_DYNAMIC;
name = "dynamic state";
+ } else if (templ->flags & IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE) {
+ memzone = IRIS_MEMZONE_BINDLESS;
+ name = "bindless surface state";
}
unsigned flags = iris_resource_alloc_flags(screen, templ);
/* These are for u_upload_mgr buffers only */
assert(!(templ->flags & (IRIS_RESOURCE_FLAG_SHADER_MEMZONE |
IRIS_RESOURCE_FLAG_SURFACE_MEMZONE |
- IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE)));
+ IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE |
+ IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE)));
if (!iris_resource_configure_aux(screen, res, false))
goto fail;
struct isl_swizzle swizzle;
};
-#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_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_RESOURCE_FLAG_BINDLESS_MEMZONE (PIPE_RESOURCE_FLAG_DRV_PRIV << 3)
/**
* Resources represent a GPU buffer object or image (mipmap tree).
sba.GeneralStateBufferSizeModifyEnable = true;
sba.DynamicStateBufferSizeModifyEnable = true;
#if (GFX_VER >= 9)
+ sba.BindlessSurfaceStateBaseAddress = ro_bo(NULL, IRIS_MEMZONE_BINDLESS_START);
+ sba.BindlessSurfaceStateSize = (IRIS_BINDLESS_SIZE >> 12) - 1;
sba.BindlessSurfaceStateBaseAddressModifyEnable = true;
sba.BindlessSurfaceStateMOCS = mocs;
#endif