summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_resource.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_resource.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_resource.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_resource.h b/src/gallium/drivers/freedreno/freedreno_resource.h
index 7e10d7a6416..1073eb7547e 100644
--- a/src/gallium/drivers/freedreno/freedreno_resource.h
+++ b/src/gallium/drivers/freedreno/freedreno_resource.h
@@ -67,6 +67,14 @@ fd_resource_slice(struct fd_resource *rsc, unsigned level)
return &rsc->slices[level];
}
+/* get offset for specified mipmap level and texture/array layer */
+static INLINE uint32_t
+fd_resource_offset(struct fd_resource *rsc, unsigned level, unsigned layer)
+{
+ struct fd_resource_slice *slice = fd_resource_slice(rsc, level);
+ return slice->offset + (slice->size0 * layer);
+}
+
void fd_resource_screen_init(struct pipe_screen *pscreen);
void fd_resource_context_init(struct pipe_context *pctx);