summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/ra.h
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu/ra.h')
-rw-r--r--video/out/gpu/ra.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/video/out/gpu/ra.h b/video/out/gpu/ra.h
index f1037e45c3..05a7c54a66 100644
--- a/video/out/gpu/ra.h
+++ b/video/out/gpu/ra.h
@@ -110,6 +110,7 @@ struct ra_tex_params {
bool blit_src; // must be usable as a blit source
bool blit_dst; // must be usable as a blit destination
bool host_mutable; // texture may be updated with tex_upload
+ bool downloadable; // texture can be read with tex_download
// When used as render source texture.
bool src_linear; // if false, use nearest sampling (whether this can
// be true depends on ra_format.linear_filter)
@@ -151,6 +152,13 @@ struct ra_tex_upload_params {
ptrdiff_t stride; // The size of a horizontal line in bytes (*not* texels!)
};
+struct ra_tex_download_params {
+ struct ra_tex *tex; // Texture to download from
+ // Downloading directly (set by caller, data written to by callee):
+ void *dst; // Address of data (packed with no alignment)
+ ptrdiff_t stride; // The size of a horizontal line in bytes (*not* texels!)
+};
+
// Buffer usage type. This restricts what types of operations may be performed
// on a buffer.
enum ra_buf_type {
@@ -379,6 +387,10 @@ struct ra_fns {
// Returns whether successful.
bool (*tex_upload)(struct ra *ra, const struct ra_tex_upload_params *params);
+ // Copy data from the texture to memory. ra_tex_params.downloadable must
+ // have been set to true on texture creation.
+ bool (*tex_download)(struct ra *ra, struct ra_tex_download_params *params);
+
// Create a buffer. This can be used as a persistently mapped buffer,
// a uniform buffer, a shader storage buffer or possibly others.
// Not all usage types must be supported; may return NULL if unavailable.