transformfeedback.h revision 3464ebd5
1/*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 2010  VMware, Inc.  All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23
24
25#ifndef TRANSFORM_FEEDBACK_H
26#define TRANSFORM_FEEDBACK_H
27
28#include "compiler.h"
29#include "glheader.h"
30#include "mfeatures.h"
31
32struct _glapi_table;
33struct dd_function_table;
34struct gl_context;
35
36extern void
37_mesa_init_transform_feedback(struct gl_context *ctx);
38
39extern void
40_mesa_free_transform_feedback(struct gl_context *ctx);
41
42#if FEATURE_EXT_transform_feedback
43
44extern GLboolean
45_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode);
46
47extern GLboolean
48_mesa_validate_transform_feedback_buffers(struct gl_context *ctx);
49
50
51extern void
52_mesa_init_transform_feedback_functions(struct dd_function_table *driver);
53
54extern void
55_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp);
56
57
58/*** GL_EXT_transform_feedback ***/
59
60extern void GLAPIENTRY
61_mesa_BeginTransformFeedback(GLenum mode);
62
63extern void GLAPIENTRY
64_mesa_EndTransformFeedback(void);
65
66extern void GLAPIENTRY
67_mesa_BindBufferRange(GLenum target, GLuint index,
68                      GLuint buffer, GLintptr offset, GLsizeiptr size);
69
70extern void GLAPIENTRY
71_mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer);
72
73extern void GLAPIENTRY
74_mesa_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer,
75                          GLintptr offset);
76
77extern void GLAPIENTRY
78_mesa_TransformFeedbackVaryings(GLuint program, GLsizei count,
79                                const GLchar **varyings, GLenum bufferMode);
80
81extern void GLAPIENTRY
82_mesa_GetTransformFeedbackVarying(GLuint program, GLuint index,
83                                  GLsizei bufSize, GLsizei *length,
84                                  GLsizei *size, GLenum *type, GLchar *name);
85
86
87
88/*** GL_ARB_transform_feedback2 ***/
89
90extern void GLAPIENTRY
91_mesa_GenTransformFeedbacks(GLsizei n, GLuint *names);
92
93extern GLboolean GLAPIENTRY
94_mesa_IsTransformFeedback(GLuint name);
95
96extern void GLAPIENTRY
97_mesa_BindTransformFeedback(GLenum target, GLuint name);
98
99extern void GLAPIENTRY
100_mesa_DeleteTransformFeedbacks(GLsizei n, const GLuint *names);
101
102extern void GLAPIENTRY
103_mesa_PauseTransformFeedback(void);
104
105extern void GLAPIENTRY
106_mesa_ResumeTransformFeedback(void);
107
108extern void GLAPIENTRY
109_mesa_DrawTransformFeedback(GLenum mode, GLuint name);
110
111#else /* FEATURE_EXT_transform_feedback */
112
113static INLINE GLboolean
114_mesa_validate_primitive_mode(struct gl_context *ctx, GLenum mode)
115{
116   return GL_TRUE;
117}
118
119static INLINE GLboolean
120_mesa_validate_transform_feedback_buffers(struct gl_context *ctx)
121{
122   return GL_TRUE;
123}
124
125static INLINE void
126_mesa_init_transform_feedback_functions(struct dd_function_table *driver)
127{
128}
129
130static INLINE void
131_mesa_init_transform_feedback_dispatch(struct _glapi_table *disp)
132{
133}
134
135#endif /* FEATURE_EXT_transform_feedback */
136
137#endif /* TRANSFORM_FEEDBACK_H */
138