2 * Mesa 3-D graphics library
4 * Copyright (C) 2010 VMware, Inc. All Rights Reserved.
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:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef TRANSFORM_FEEDBACK_H
27 #define TRANSFORM_FEEDBACK_H
30 #include "bufferobj.h"
36 struct dd_function_table
;
40 _mesa_init_transform_feedback(struct gl_context
*ctx
);
43 _mesa_free_transform_feedback(struct gl_context
*ctx
);
46 _mesa_validate_transform_feedback_buffers(struct gl_context
*ctx
);
50 _mesa_init_transform_feedback_functions(struct dd_function_table
*driver
);
53 _mesa_compute_max_transform_feedback_vertices(
54 const struct gl_transform_feedback_object
*obj
,
55 const struct gl_transform_feedback_info
*info
);
58 /*** GL_EXT_transform_feedback ***/
60 extern void GLAPIENTRY
61 _mesa_BeginTransformFeedback(GLenum mode
);
63 extern void GLAPIENTRY
64 _mesa_EndTransformFeedback(void);
67 _mesa_bind_buffer_range_transform_feedback(struct gl_context
*ctx
,
69 struct gl_buffer_object
*bufObj
,
74 _mesa_bind_buffer_base_transform_feedback(struct gl_context
*ctx
,
76 struct gl_buffer_object
*bufObj
);
78 extern void GLAPIENTRY
79 _mesa_BindBufferOffsetEXT(GLenum target
, GLuint index
, GLuint buffer
,
82 extern void GLAPIENTRY
83 _mesa_TransformFeedbackVaryings(GLuint program
, GLsizei count
,
84 const GLchar
* const *varyings
,
87 extern void GLAPIENTRY
88 _mesa_GetTransformFeedbackVarying(GLuint program
, GLuint index
,
89 GLsizei bufSize
, GLsizei
*length
,
90 GLsizei
*size
, GLenum
*type
, GLchar
*name
);
94 /*** GL_ARB_transform_feedback2 ***/
96 _mesa_init_transform_feedback_object(struct gl_transform_feedback_object
*obj
,
99 struct gl_transform_feedback_object
*
100 _mesa_lookup_transform_feedback_object(struct gl_context
*ctx
, GLuint name
);
102 extern void GLAPIENTRY
103 _mesa_GenTransformFeedbacks(GLsizei n
, GLuint
*names
);
105 extern GLboolean GLAPIENTRY
106 _mesa_IsTransformFeedback(GLuint name
);
108 extern void GLAPIENTRY
109 _mesa_BindTransformFeedback(GLenum target
, GLuint name
);
111 extern void GLAPIENTRY
112 _mesa_DeleteTransformFeedbacks(GLsizei n
, const GLuint
*names
);
114 extern void GLAPIENTRY
115 _mesa_PauseTransformFeedback(void);
117 extern void GLAPIENTRY
118 _mesa_ResumeTransformFeedback(void);
121 _mesa_is_xfb_active_and_unpaused(const struct gl_context
*ctx
)
123 return ctx
->TransformFeedback
.CurrentObject
->Active
&&
124 !ctx
->TransformFeedback
.CurrentObject
->Paused
;
128 _mesa_transform_feedback_is_using_program(struct gl_context
*ctx
,
129 struct gl_shader_program
*shProg
);
132 _mesa_set_transform_feedback_binding(struct gl_context
*ctx
,
133 struct gl_transform_feedback_object
*tfObj
, GLuint index
,
134 struct gl_buffer_object
*bufObj
,
135 GLintptr offset
, GLsizeiptr size
)
137 _mesa_reference_buffer_object(ctx
, &tfObj
->Buffers
[index
], bufObj
);
139 tfObj
->BufferNames
[index
] = bufObj
->Name
;
140 tfObj
->Offset
[index
] = offset
;
141 tfObj
->RequestedSize
[index
] = size
;
144 #endif /* TRANSFORM_FEEDBACK_H */