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