2 * Copyright 2016 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 struct gl_pixelstore_attrib
;
31 struct st_pbo_addresses
{
38 unsigned bytes_per_pixel
;
40 /* Everything below is filled in by st_pbo_from_pixelstore */
41 unsigned pixels_per_row
;
42 unsigned image_height
;
44 /* Everything below is filled in by st_pbo_setup_buffer */
46 /* Buffer and view. */
47 struct pipe_resource
*buffer
; /* non-owning pointer */
48 unsigned first_element
;
49 unsigned last_element
;
51 /* Constant buffer for the fragment shader. */
61 st_pbo_addresses_setup(struct st_context
*st
,
62 struct pipe_resource
*buf
, intptr_t buf_offset
,
63 struct st_pbo_addresses
*addr
);
66 st_pbo_addresses_pixelstore(struct st_context
*st
,
67 GLenum gl_target
, bool skip_images
,
68 const struct gl_pixelstore_attrib
*store
,
70 struct st_pbo_addresses
*addr
);
73 st_pbo_draw(struct st_context
*st
, const struct st_pbo_addresses
*addr
,
74 unsigned surface_width
, unsigned surface_height
);
77 st_pbo_create_vs(struct st_context
*st
);
80 st_pbo_create_gs(struct st_context
*st
);
83 st_pbo_create_upload_fs(struct st_context
*st
);
86 st_init_pbo_helpers(struct st_context
*st
);
89 st_destroy_pbo_helpers(struct st_context
*st
);