diff options
author | Jason Ekstrand <[email protected]> | 2017-07-11 14:27:25 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-07-22 21:41:12 -0700 |
commit | 5de4209f91c466af6a28fee9c80c398a8ed9b95d (patch) | |
tree | 169317cfcc43d0694c274530c74ba291d1d16a0a /src/intel/isl/isl.h | |
parent | 72bc38cfc592505c207bd5cac54bc8dd8289cf72 (diff) |
intel/isl: Add a helper to get a subimage surface
We already have a helper for doing this in BLORP, this just moves the
logic into ISL where we can share it with other components.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/isl/isl.h')
-rw-r--r-- | src/intel/isl/isl.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h index 1e5b8689542..dafe952298e 100644 --- a/src/intel/isl/isl.h +++ b/src/intel/isl/isl.h @@ -1842,6 +1842,29 @@ isl_surf_get_image_offset_B_tile_sa(const struct isl_surf *surf, uint32_t *y_offset_sa); /** + * Create an isl_surf that represents a particular subimage in the surface. + * + * The newly created surface will have a single miplevel and array slice. The + * surface lives at the returned byte and intratile offsets, in samples. + * + * It is safe to call this function with surf == image_surf. + * + * @invariant level < surface levels + * @invariant logical_array_layer < logical array length of surface + * @invariant logical_z_offset_px < logical depth of surface at level + */ +void +isl_surf_get_image_surf(const struct isl_device *dev, + const struct isl_surf *surf, + uint32_t level, + uint32_t logical_array_layer, + uint32_t logical_z_offset_px, + struct isl_surf *image_surf, + uint32_t *offset_B, + uint32_t *x_offset_sa, + uint32_t *y_offset_sa); + +/** * @brief Calculate the intratile offsets to a surface. * * In @a base_address_offset return the offset from the base of the surface to |