1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2008 Brian Paul 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 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.
23 */
24
25
26 #ifndef FBOBJECT_H
27 #define FBOBJECT_H
28
29 #include "glheader.h"
30 #include <stdbool.h>
31
32 struct gl_context;
33 struct gl_texture_object;
34
35
36 /**
37 * Is the given FBO a user-created FBO?
38 */
39 static inline GLboolean
_mesa_is_user_fbo(const struct gl_framebuffer * fb)40 _mesa_is_user_fbo(const struct gl_framebuffer *fb)
41 {
42 return fb->Name != 0;
43 }
44
45
46 /**
47 * Is the given FBO a window system FBO (like an X window)?
48 */
49 static inline GLboolean
_mesa_is_winsys_fbo(const struct gl_framebuffer * fb)50 _mesa_is_winsys_fbo(const struct gl_framebuffer *fb)
51 {
52 return fb->Name == 0;
53 }
54
55
56
57 extern struct gl_framebuffer *
58 _mesa_get_incomplete_framebuffer(void);
59
60 extern struct gl_renderbuffer *
61 _mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id);
62
63 extern struct gl_renderbuffer *
64 _mesa_lookup_renderbuffer_err(struct gl_context *ctx, GLuint id,
65 const char *func);
66
67 extern struct gl_framebuffer *
68 _mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id);
69
70 extern struct gl_framebuffer *
71 _mesa_lookup_framebuffer_err(struct gl_context *ctx, GLuint id,
72 const char *func);
73
74 struct gl_framebuffer *
75 _mesa_lookup_framebuffer_dsa(struct gl_context *ctx, GLuint id,
76 const char* func);
77
78
79 void
80 _mesa_update_texture_renderbuffer(struct gl_context *ctx,
81 struct gl_framebuffer *fb,
82 struct gl_renderbuffer_attachment *att);
83
84 extern void
85 _mesa_FramebufferRenderbuffer_sw(struct gl_context *ctx,
86 struct gl_framebuffer *fb,
87 GLenum attachment,
88 struct gl_renderbuffer *rb);
89
90 extern void
91 _mesa_framebuffer_renderbuffer(struct gl_context *ctx,
92 struct gl_framebuffer *fb,
93 GLenum attachment,
94 struct gl_renderbuffer *rb);
95
96 extern void
97 _mesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
98 GLenum internalFormat, GLsizei width,
99 GLsizei height, GLsizei samples,
100 GLsizei storageSamples);
101
102 extern void
103 _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb);
104
105 extern GLboolean
106 _mesa_has_depthstencil_combined(const struct gl_framebuffer *fb);
107
108 extern void
109 _mesa_test_framebuffer_completeness(struct gl_context *ctx,
110 struct gl_framebuffer *fb);
111
112 extern GLboolean
113 _mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat);
114
115 extern GLenum
116 _mesa_base_fbo_format(const struct gl_context *ctx, GLenum internalFormat);
117
118 extern bool
119 _mesa_detach_renderbuffer(struct gl_context *ctx,
120 struct gl_framebuffer *fb,
121 const void *att);
122
123 extern struct gl_renderbuffer_attachment *
124 _mesa_get_and_validate_attachment(struct gl_context *ctx,
125 struct gl_framebuffer *fb,
126 GLenum attachment, const char *caller);
127
128 extern void
129 _mesa_framebuffer_texture(struct gl_context *ctx, struct gl_framebuffer *fb,
130 GLenum attachment,
131 struct gl_renderbuffer_attachment *att,
132 struct gl_texture_object *texObj, GLenum textarget,
133 GLint level, GLsizei samples,
134 GLuint layer, GLboolean layered);
135
136 extern GLenum
137 _mesa_check_framebuffer_status(struct gl_context *ctx,
138 struct gl_framebuffer *fb);
139
140 extern void
141 _mesa_bind_framebuffers(struct gl_context *ctx,
142 struct gl_framebuffer *newDrawFb,
143 struct gl_framebuffer *newReadFb);
144
145 extern GLboolean GLAPIENTRY
146 _mesa_IsRenderbuffer(GLuint renderbuffer);
147
148 extern void GLAPIENTRY
149 _mesa_BindRenderbuffer(GLenum target, GLuint renderbuffer);
150
151 extern void GLAPIENTRY
152 _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
153
154 extern void GLAPIENTRY
155 _mesa_DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers);
156
157 void GLAPIENTRY
158 _mesa_GenRenderbuffers_no_error(GLsizei n, GLuint *renderbuffers);
159
160 extern void GLAPIENTRY
161 _mesa_GenRenderbuffers(GLsizei n, GLuint *renderbuffers);
162
163 void GLAPIENTRY
164 _mesa_CreateRenderbuffers_no_error(GLsizei n, GLuint *renderbuffers);
165
166 extern void GLAPIENTRY
167 _mesa_CreateRenderbuffers(GLsizei n, GLuint *renderbuffers);
168
169 extern void GLAPIENTRY
170 _mesa_RenderbufferStorage(GLenum target, GLenum internalformat,
171 GLsizei width, GLsizei height);
172
173 extern void GLAPIENTRY
174 _mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples,
175 GLenum internalformat,
176 GLsizei width, GLsizei height);
177
178 extern void GLAPIENTRY
179 _mesa_RenderbufferStorageMultisampleAdvancedAMD(
180 GLenum target, GLsizei samples, GLsizei storageSamples,
181 GLenum internalFormat, GLsizei width, GLsizei height);
182
183 extern void GLAPIENTRY
184 _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat,
185 GLsizei width, GLsizei height);
186
187 extern void GLAPIENTRY
188 _mesa_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat,
189 GLsizei width, GLsizei height);
190 extern void GLAPIENTRY
191 _mesa_NamedRenderbufferStorageEXT(GLuint renderbuffer, GLenum internalformat,
192 GLsizei width, GLsizei height);
193
194 extern void GLAPIENTRY
195 _mesa_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples,
196 GLenum internalformat,
197 GLsizei width, GLsizei height);
198
199 extern void GLAPIENTRY
200 _mesa_NamedRenderbufferStorageMultisampleEXT(GLuint renderbuffer, GLsizei samples,
201 GLenum internalformat,
202 GLsizei width, GLsizei height);
203
204 extern void GLAPIENTRY
205 _mesa_NamedRenderbufferStorageMultisampleAdvancedAMD(
206 GLuint renderbuffer, GLsizei samples, GLsizei storageSamples,
207 GLenum internalformat, GLsizei width, GLsizei height);
208
209 extern void GLAPIENTRY
210 _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
211
212 extern void GLAPIENTRY
213 _mesa_GetRenderbufferParameteriv(GLenum target, GLenum pname,
214 GLint *params);
215
216 void GLAPIENTRY
217 _mesa_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname,
218 GLint *params);
219
220 extern GLboolean GLAPIENTRY
221 _mesa_IsFramebuffer(GLuint framebuffer);
222
223 extern void GLAPIENTRY
224 _mesa_BindFramebuffer(GLenum target, GLuint framebuffer);
225
226 extern void GLAPIENTRY
227 _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
228
229 extern void GLAPIENTRY
230 _mesa_DeleteFramebuffers(GLsizei n, const GLuint *framebuffers);
231
232 extern void GLAPIENTRY
233 _mesa_GenFramebuffers(GLsizei n, GLuint *framebuffers);
234
235 extern void GLAPIENTRY
236 _mesa_CreateFramebuffers(GLsizei n, GLuint *framebuffers);
237
238 GLenum GLAPIENTRY
239 _mesa_CheckFramebufferStatus_no_error(GLenum target);
240
241 extern GLenum GLAPIENTRY
242 _mesa_CheckFramebufferStatus(GLenum target);
243
244 extern GLenum GLAPIENTRY
245 _mesa_CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target);
246
247 extern GLenum GLAPIENTRY
248 _mesa_CheckNamedFramebufferStatusEXT(GLuint framebuffer, GLenum target);
249
250 extern void GLAPIENTRY
251 _mesa_FramebufferTexture1D_no_error(GLenum target, GLenum attachment,
252 GLenum textarget, GLuint texture,
253 GLint level);
254 extern void GLAPIENTRY
255 _mesa_FramebufferTexture1D(GLenum target, GLenum attachment,
256 GLenum textarget, GLuint texture, GLint level);
257
258 extern void GLAPIENTRY
259 _mesa_FramebufferTexture2D_no_error(GLenum target, GLenum attachment,
260 GLenum textarget, GLuint texture,
261 GLint level);
262 extern void GLAPIENTRY
263 _mesa_FramebufferTexture2D(GLenum target, GLenum attachment,
264 GLenum textarget, GLuint texture, GLint level);
265
266 void GLAPIENTRY
267 _mesa_FramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment,
268 GLenum textarget, GLuint texture,
269 GLint level, GLsizei samples);
270
271 extern void GLAPIENTRY
272 _mesa_FramebufferTexture3D_no_error(GLenum target, GLenum attachment,
273 GLenum textarget, GLuint texture,
274 GLint level, GLint layer);
275 extern void GLAPIENTRY
276 _mesa_FramebufferTexture3D(GLenum target, GLenum attachment,
277 GLenum textarget, GLuint texture,
278 GLint level, GLint layer);
279
280 extern void GLAPIENTRY
281 _mesa_FramebufferTextureLayer_no_error(GLenum target, GLenum attachment,
282 GLuint texture, GLint level,
283 GLint layer);
284 extern void GLAPIENTRY
285 _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment,
286 GLuint texture, GLint level, GLint layer);
287
288 extern void GLAPIENTRY
289 _mesa_NamedFramebufferTextureLayer_no_error(GLuint framebuffer,
290 GLenum attachment,
291 GLuint texture, GLint level,
292 GLint layer);
293 extern void GLAPIENTRY
294 _mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment,
295 GLuint texture, GLint level, GLint layer);
296
297 extern void GLAPIENTRY
298 _mesa_FramebufferTexture_no_error(GLenum target, GLenum attachment,
299 GLuint texture, GLint level);
300 extern void GLAPIENTRY
301 _mesa_FramebufferTexture(GLenum target, GLenum attachment,
302 GLuint texture, GLint level);
303
304 extern void GLAPIENTRY
305 _mesa_NamedFramebufferTexture_no_error(GLuint framebuffer, GLenum attachment,
306 GLuint texture, GLint level);
307 extern void GLAPIENTRY
308 _mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment,
309 GLuint texture, GLint level);
310
311 extern void GLAPIENTRY
312 _mesa_NamedFramebufferRenderbufferEXT(GLuint framebuffer, GLenum attachment,
313 GLenum renderbuffertarget,
314 GLuint renderbuffer);
315
316 extern void GLAPIENTRY
317 _mesa_NamedFramebufferTexture1DEXT(GLuint framebuffer, GLenum attachment,
318 GLenum textarget, GLuint texture, GLint level);
319
320 extern void GLAPIENTRY
321 _mesa_NamedFramebufferTexture2DEXT(GLuint framebuffer, GLenum attachment,
322 GLenum textarget, GLuint texture, GLint level);
323
324 extern void GLAPIENTRY
325 _mesa_NamedFramebufferTexture3DEXT(GLuint framebuffer, GLenum attachment,
326 GLenum textarget, GLuint texture,
327 GLint level, GLint zoffset);
328
329 void GLAPIENTRY
330 _mesa_FramebufferRenderbuffer_no_error(GLenum target, GLenum attachment,
331 GLenum renderbuffertarget,
332 GLuint renderbuffer);
333
334 extern void GLAPIENTRY
335 _mesa_FramebufferRenderbuffer(GLenum target, GLenum attachment,
336 GLenum renderbuffertarget,
337 GLuint renderbuffer);
338
339 void GLAPIENTRY
340 _mesa_NamedFramebufferRenderbuffer_no_error(GLuint framebuffer,
341 GLenum attachment,
342 GLenum renderbuffertarget,
343 GLuint renderbuffer);
344
345 extern void GLAPIENTRY
346 _mesa_NamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment,
347 GLenum renderbuffertarget,
348 GLuint renderbuffer);
349
350 extern void GLAPIENTRY
351 _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment,
352 GLenum pname, GLint *params);
353
354 extern void GLAPIENTRY
355 _mesa_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
356 GLenum attachment,
357 GLenum pname, GLint *params);
358
359 extern void GLAPIENTRY
360 _mesa_GetNamedFramebufferAttachmentParameterivEXT(GLuint framebuffer,
361 GLenum attachment,
362 GLenum pname, GLint *params);
363
364 extern void GLAPIENTRY
365 _mesa_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname,
366 GLint param);
367
368 extern void GLAPIENTRY
369 _mesa_NamedFramebufferParameteriEXT(GLuint framebuffer, GLenum pname,
370 GLint param);
371
372 extern void GLAPIENTRY
373 _mesa_GetNamedRenderbufferParameterivEXT(GLuint renderbuffer, GLenum pname,
374 GLint *params);
375
376 extern void GLAPIENTRY
377 _mesa_GetFramebufferParameterivEXT(GLuint framebuffer, GLenum pname,
378 GLint *param);
379
380 extern void GLAPIENTRY
381 _mesa_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
382 GLint *param);
383
384 extern void GLAPIENTRY
385 _mesa_GetNamedFramebufferParameterivEXT(GLuint framebuffer, GLenum pname,
386 GLint *param);
387
388 void GLAPIENTRY
389 _mesa_InvalidateSubFramebuffer_no_error(GLenum target, GLsizei numAttachments,
390 const GLenum *attachments, GLint x,
391 GLint y, GLsizei width, GLsizei height);
392
393 extern void GLAPIENTRY
394 _mesa_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments,
395 const GLenum *attachments, GLint x, GLint y,
396 GLsizei width, GLsizei height);
397
398 extern void GLAPIENTRY
399 _mesa_InvalidateNamedFramebufferSubData(GLuint framebuffer,
400 GLsizei numAttachments,
401 const GLenum *attachments,
402 GLint x, GLint y,
403 GLsizei width, GLsizei height);
404 void GLAPIENTRY
405 _mesa_InvalidateFramebuffer_no_error(GLenum target, GLsizei numAttachments,
406 const GLenum *attachments);
407
408 extern void GLAPIENTRY
409 _mesa_InvalidateFramebuffer(GLenum target, GLsizei numAttachments,
410 const GLenum *attachments);
411
412 extern void GLAPIENTRY
413 _mesa_InvalidateNamedFramebufferData(GLuint framebuffer,
414 GLsizei numAttachments,
415 const GLenum *attachments);
416
417 extern void GLAPIENTRY
418 _mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments,
419 const GLenum *attachments);
420
421 extern void GLAPIENTRY
422 _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param);
423
424 extern void GLAPIENTRY
425 _mesa_FramebufferParameteriMESA(GLenum target, GLenum pname, GLint param);
426
427 extern void GLAPIENTRY
428 _mesa_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
429
430 extern void GLAPIENTRY
431 _mesa_GetFramebufferParameterivMESA(GLenum target, GLenum pname, GLint *params);
432
433 extern void GLAPIENTRY
434 _mesa_FramebufferSampleLocationsfvARB(GLenum target, GLuint start,
435 GLsizei count, const GLfloat *v);
436
437 extern void GLAPIENTRY
438 _mesa_NamedFramebufferSampleLocationsfvARB(GLuint framebuffer, GLuint start,
439 GLsizei count, const GLfloat *v);
440
441 extern void GLAPIENTRY
442 _mesa_FramebufferSampleLocationsfvARB_no_error(GLenum target, GLuint start,
443 GLsizei count, const GLfloat *v);
444
445 extern void GLAPIENTRY
446 _mesa_NamedFramebufferSampleLocationsfvARB_no_error(GLuint framebuffer,
447 GLuint start, GLsizei count,
448 const GLfloat *v);
449
450 extern void GLAPIENTRY
451 _mesa_EvaluateDepthValuesARB(void);
452
453 #endif /* FBOBJECT_H */
454