diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-05-23 14:17:59 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-06-03 14:14:45 -0700 |
commit | 97cd865be28b3ef7508b243ed59e43cbc2a936f5 (patch) | |
tree | d4f6c3fd27dbd6474d0ff35dd423a7dc88f83fe2 /src/gallium/drivers/iris/iris_context.h | |
parent | 79f1529ae03f9f85c0844eaa08e84abe7ba0882f (diff) |
iris: Compact binding tables
Change the iris_binding_table to keep track of what surfaces are
actually going to be used, then assign binding table indices just for
those. Reducing unused bytes on those are valuable because we use a
reduced space for those tables in Iris.
The rest of the driver can go from "group indices" (i.e. UBO #2) to
BTI and vice-versa using helper functions. The value
IRIS_SURFACE_NOT_USED is returned to indicate a certain group index is
not used or a certain BTI is not valid.
The environment variable INTEL_DISABLE_COMPACT_BINDING_TABLE can be
set to skip compacting binding table.
v2: (all from Ken)
Use BITFIELD64_MASK helper. Improve comments.
Assert all group is marked as used when we have indirects.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_context.h')
-rw-r--r-- | src/gallium/drivers/iris/iris_context.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h index f7dcf8d64ec..4e544f830fd 100644 --- a/src/gallium/drivers/iris/iris_context.h +++ b/src/gallium/drivers/iris/iris_context.h @@ -292,10 +292,22 @@ enum iris_surface_group { IRIS_SURFACE_GROUP_COUNT, }; +enum { + /* Invalid value for a binding table index. */ + IRIS_SURFACE_NOT_USED = 0xa0a0a0a0, +}; + struct iris_binding_table { uint32_t size_bytes; + /** Number of surfaces in each group, before compacting. */ + uint32_t sizes[IRIS_SURFACE_GROUP_COUNT]; + + /** Initial offset of each group. */ uint32_t offsets[IRIS_SURFACE_GROUP_COUNT]; + + /** Mask of surfaces used in each group. */ + uint64_t used_mask[IRIS_SURFACE_GROUP_COUNT]; }; /** @@ -814,6 +826,12 @@ const struct shader_info *iris_get_shader_info(const struct iris_context *ice, struct iris_bo *iris_get_scratch_space(struct iris_context *ice, unsigned per_thread_scratch, gl_shader_stage stage); +uint32_t iris_group_index_to_bti(const struct iris_binding_table *bt, + enum iris_surface_group group, + uint32_t index); +uint32_t iris_bti_to_group_index(const struct iris_binding_table *bt, + enum iris_surface_group group, + uint32_t bti); /* iris_disk_cache.c */ |