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. */
62 st_pbo_addresses_setup(struct st_context
*st
,
63 struct pipe_resource
*buf
, intptr_t buf_offset
,
64 struct st_pbo_addresses
*addr
);
67 st_pbo_addresses_pixelstore(struct st_context
*st
,
68 GLenum gl_target
, bool skip_images
,
69 const struct gl_pixelstore_attrib
*store
,
71 struct st_pbo_addresses
*addr
);
74 st_pbo_addresses_invert_y(struct st_pbo_addresses
*addr
,
75 unsigned viewport_height
);
78 st_pbo_draw(struct st_context
*st
, const struct st_pbo_addresses
*addr
,
79 unsigned surface_width
, unsigned surface_height
);
82 st_pbo_create_vs(struct st_context
*st
);
85 st_pbo_create_gs(struct st_context
*st
);
88 st_pbo_get_upload_fs(struct st_context
*st
,
89 enum pipe_format src_format
,
90 enum pipe_format dst_format
);
93 st_pbo_get_download_fs(struct st_context
*st
, enum pipe_texture_target target
,
94 enum pipe_format src_format
,
95 enum pipe_format dst_format
);
98 st_init_pbo_helpers(struct st_context
*st
);
101 st_destroy_pbo_helpers(struct st_context
*st
);
103 #endif /* ST_PBO_H */