summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_pbo.h
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-04-26 12:59:29 -0500
committerNicolai Hähnle <[email protected]>2016-06-01 22:37:28 +0200
commite16800226e16137f3a3371151ff2fa9a3ad13df3 (patch)
treee4f0be516863237adec92e1f559bccbc4b16511b /src/mesa/state_tracker/st_pbo.h
parent21e069f7d4294bfe9500e84023df970e87be9059 (diff)
st/mesa: move PBO buffer address calculation to st_pbo.c
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_pbo.h')
-rw-r--r--src/mesa/state_tracker/st_pbo.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_pbo.h b/src/mesa/state_tracker/st_pbo.h
index 7ba426fedd2..392278e8f9d 100644
--- a/src/mesa/state_tracker/st_pbo.h
+++ b/src/mesa/state_tracker/st_pbo.h
@@ -24,8 +24,51 @@
#ifndef ST_PBO_H
#define ST_PBO_H
+struct gl_pixelstore_attrib;
+
struct st_context;
+struct st_pbo_addresses {
+ int xoffset;
+ int yoffset;
+ unsigned width;
+ unsigned height;
+ unsigned depth;
+
+ unsigned bytes_per_pixel;
+
+ /* Everything below is filled in by st_pbo_from_pixelstore */
+ unsigned pixels_per_row;
+ unsigned image_height;
+
+ /* Everything below is filled in by st_pbo_setup_buffer */
+
+ /* Buffer and view. */
+ struct pipe_resource *buffer; /* non-owning pointer */
+ unsigned first_element;
+ unsigned last_element;
+
+ /* Constant buffer for the fragment shader. */
+ struct {
+ int32_t xoffset;
+ int32_t yoffset;
+ int32_t stride;
+ int32_t image_size;
+ } constants;
+};
+
+bool
+st_pbo_addresses_setup(struct st_context *st,
+ struct pipe_resource *buf, intptr_t buf_offset,
+ struct st_pbo_addresses *addr);
+
+bool
+st_pbo_addresses_pixelstore(struct st_context *st,
+ GLenum gl_target, bool skip_images,
+ const struct gl_pixelstore_attrib *store,
+ const void *pixels,
+ struct st_pbo_addresses *addr);
+
void *
st_pbo_create_vs(struct st_context *st);