1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Mesa 3-D graphics library
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
5bf215546Sopenharmony_ci * Copyright (C) 2009-2011  VMware, Inc.  All Rights Reserved.
6bf215546Sopenharmony_ci *
7bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
8bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
9bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
10bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
12bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
13bf215546Sopenharmony_ci *
14bf215546Sopenharmony_ci * The above copyright notice and this permission notice shall be included
15bf215546Sopenharmony_ci * in all copies or substantial portions of the Software.
16bf215546Sopenharmony_ci *
17bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18bf215546Sopenharmony_ci * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21bf215546Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22bf215546Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23bf215546Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
24bf215546Sopenharmony_ci */
25bf215546Sopenharmony_ci
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci#ifndef PBO_H
28bf215546Sopenharmony_ci#define PBO_H
29bf215546Sopenharmony_ci
30bf215546Sopenharmony_ci
31bf215546Sopenharmony_ci#include "glheader.h"
32bf215546Sopenharmony_ci
33bf215546Sopenharmony_cistruct gl_context;
34bf215546Sopenharmony_cistruct gl_pixelstore_attrib;
35bf215546Sopenharmony_ci
36bf215546Sopenharmony_ciextern GLboolean
37bf215546Sopenharmony_ci_mesa_validate_pbo_access(GLuint dimensions,
38bf215546Sopenharmony_ci                          const struct gl_pixelstore_attrib *pack,
39bf215546Sopenharmony_ci                          GLsizei width, GLsizei height, GLsizei depth,
40bf215546Sopenharmony_ci                          GLenum format, GLenum type, GLsizei clientMemSize,
41bf215546Sopenharmony_ci                          const GLvoid *ptr);
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ciextern const GLvoid *
44bf215546Sopenharmony_ci_mesa_map_pbo_source(struct gl_context *ctx,
45bf215546Sopenharmony_ci                     const struct gl_pixelstore_attrib *unpack,
46bf215546Sopenharmony_ci                     const GLvoid *src);
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_ciextern const GLvoid *
49bf215546Sopenharmony_ci_mesa_map_validate_pbo_source(struct gl_context *ctx,
50bf215546Sopenharmony_ci                              GLuint dimensions,
51bf215546Sopenharmony_ci                              const struct gl_pixelstore_attrib *unpack,
52bf215546Sopenharmony_ci                              GLsizei width, GLsizei height, GLsizei depth,
53bf215546Sopenharmony_ci                              GLenum format, GLenum type, GLsizei clientMemSize,
54bf215546Sopenharmony_ci                              const GLvoid *ptr, const char *where);
55bf215546Sopenharmony_ci
56bf215546Sopenharmony_ciextern void
57bf215546Sopenharmony_ci_mesa_unmap_pbo_source(struct gl_context *ctx,
58bf215546Sopenharmony_ci                       const struct gl_pixelstore_attrib *unpack);
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ciextern void *
61bf215546Sopenharmony_ci_mesa_map_pbo_dest(struct gl_context *ctx,
62bf215546Sopenharmony_ci                   const struct gl_pixelstore_attrib *pack,
63bf215546Sopenharmony_ci                   GLvoid *dest);
64bf215546Sopenharmony_ci
65bf215546Sopenharmony_ciextern GLvoid *
66bf215546Sopenharmony_ci_mesa_map_validate_pbo_dest(struct gl_context *ctx,
67bf215546Sopenharmony_ci                            GLuint dimensions,
68bf215546Sopenharmony_ci                            const struct gl_pixelstore_attrib *unpack,
69bf215546Sopenharmony_ci                            GLsizei width, GLsizei height, GLsizei depth,
70bf215546Sopenharmony_ci                            GLenum format, GLenum type, GLsizei clientMemSize,
71bf215546Sopenharmony_ci                            GLvoid *ptr, const char *where);
72bf215546Sopenharmony_ci
73bf215546Sopenharmony_ciextern void
74bf215546Sopenharmony_ci_mesa_unmap_pbo_dest(struct gl_context *ctx,
75bf215546Sopenharmony_ci                     const struct gl_pixelstore_attrib *pack);
76bf215546Sopenharmony_ci
77bf215546Sopenharmony_ci
78bf215546Sopenharmony_ciextern const GLvoid *
79bf215546Sopenharmony_ci_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions,
80bf215546Sopenharmony_ci			    GLsizei width, GLsizei height, GLsizei depth,
81bf215546Sopenharmony_ci			    GLenum format, GLenum type, const GLvoid *pixels,
82bf215546Sopenharmony_ci			    const struct gl_pixelstore_attrib *unpack,
83bf215546Sopenharmony_ci			    const char *funcName);
84bf215546Sopenharmony_ci
85bf215546Sopenharmony_ciextern const GLvoid *
86bf215546Sopenharmony_ci_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx,
87bf215546Sopenharmony_ci                                    GLuint dimensions, GLsizei imageSize,
88bf215546Sopenharmony_ci                                    const GLvoid *pixels,
89bf215546Sopenharmony_ci                                    const struct gl_pixelstore_attrib *packing,
90bf215546Sopenharmony_ci                                    const char *funcName);
91bf215546Sopenharmony_ci
92bf215546Sopenharmony_ciextern void
93bf215546Sopenharmony_ci_mesa_unmap_teximage_pbo(struct gl_context *ctx,
94bf215546Sopenharmony_ci                         const struct gl_pixelstore_attrib *unpack);
95bf215546Sopenharmony_ci
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_ciextern bool
98bf215546Sopenharmony_ci_mesa_validate_pbo_source(struct gl_context *ctx, GLuint dimensions,
99bf215546Sopenharmony_ci                          const struct gl_pixelstore_attrib *unpack,
100bf215546Sopenharmony_ci                          GLsizei width, GLsizei height, GLsizei depth,
101bf215546Sopenharmony_ci                          GLenum format, GLenum type,
102bf215546Sopenharmony_ci                          GLsizei clientMemSize,
103bf215546Sopenharmony_ci                          const GLvoid *ptr, const char *where);
104bf215546Sopenharmony_ci
105bf215546Sopenharmony_ciextern bool
106bf215546Sopenharmony_ci_mesa_validate_pbo_source_compressed(struct gl_context *ctx, GLuint dimensions,
107bf215546Sopenharmony_ci                                     const struct gl_pixelstore_attrib *unpack,
108bf215546Sopenharmony_ci                                     GLsizei imageSize, const GLvoid *ptr,
109bf215546Sopenharmony_ci                                     const char *where);
110bf215546Sopenharmony_ci
111bf215546Sopenharmony_ci#endif
112