VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_framebuffer.h@ 76553

Last change on this file since 76553 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.7 KB
Line 
1/* $Id: cr_framebuffer.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2
3/** @file
4 * VBox crOpenGL: FBO related state info
5 */
6
7/*
8 * Copyright (C) 2009-2019 Oracle Corporation
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 */
18
19
20#ifndef CR_STATE_FRAMEBUFFEROBJECT_H
21#define CR_STATE_FRAMEBUFFEROBJECT_H
22
23#include "cr_hash.h"
24#include "state/cr_statetypes.h"
25#include "state/cr_statefuncs.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#define CR_MAX_COLOR_ATTACHMENTS 16
32
33typedef struct {
34 GLenum type; /*one of GL_NONE GL_TEXTURE GL_RENDERBUFFER_EXT*/
35 GLuint name;
36 GLint level;
37 GLint face;
38 GLint zoffset;
39} CRFBOAttachmentPoint;
40
41typedef struct {
42 GLuint id, hwid;
43 CRFBOAttachmentPoint color[CR_MAX_COLOR_ATTACHMENTS];
44 CRFBOAttachmentPoint depth;
45 CRFBOAttachmentPoint stencil;
46 GLenum readbuffer;
47 /*@todo: we don't support drawbufferS yet, so it's a stub*/
48 GLenum drawbuffer[1];
49#ifdef IN_GUEST
50 GLenum status;
51#endif
52 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
53 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
54} CRFramebufferObject;
55
56typedef struct {
57 GLuint id, hwid;
58 GLsizei width, height;
59 GLenum internalformat;
60 GLuint redBits, greenBits, blueBits, alphaBits, depthBits, stencilBits;
61 /* bitfield representing the object usage. 1 means the object is used by the context with the given bitid */
62 CRbitvalue ctxUsage[CR_MAX_BITARRAY];
63} CRRenderbufferObject;
64
65typedef struct {
66 CRFramebufferObject *readFB, *drawFB;
67 CRRenderbufferObject *renderbuffer;
68} CRFramebufferObjectState;
69
70DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectInit(CRContext *ctx);
71DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDestroy(CRContext *ctx);
72DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectSwitch(CRContext *from, CRContext *to);
73
74DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectDisableHW(CRContext *ctx, GLuint idDrawFBO, GLuint idReadFBO);
75DECLEXPORT(void) STATE_APIENTRY crStateFramebufferObjectReenableHW(CRContext *fromCtx, CRContext *toCtx, GLuint idDrawFBO, GLuint idReadFBO);
76
77DECLEXPORT(GLuint) STATE_APIENTRY crStateGetFramebufferHWID(GLuint id);
78DECLEXPORT(GLuint) STATE_APIENTRY crStateGetRenderbufferHWID(GLuint id);
79
80DECLEXPORT(void) STATE_APIENTRY crStateBindRenderbufferEXT(GLenum target, GLuint renderbuffer);
81DECLEXPORT(void) STATE_APIENTRY crStateDeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers);
82DECLEXPORT(void) STATE_APIENTRY crStateRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
83DECLEXPORT(void) STATE_APIENTRY crStateGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params);
84DECLEXPORT(void) STATE_APIENTRY crStateBindFramebufferEXT(GLenum target, GLuint framebuffer);
85DECLEXPORT(void) STATE_APIENTRY crStateDeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers);
86DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
87DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
88DECLEXPORT(void) STATE_APIENTRY crStateFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
89DECLEXPORT(void) STATE_APIENTRY crStateFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
90DECLEXPORT(void) STATE_APIENTRY crStateGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint *params);
91DECLEXPORT(void) STATE_APIENTRY crStateGenerateMipmapEXT(GLenum target);
92
93DECLEXPORT(GLuint) STATE_APIENTRY crStateFBOHWIDtoID(GLuint hwid);
94DECLEXPORT(GLuint) STATE_APIENTRY crStateRBOHWIDtoID(GLuint hwid);
95
96DECLEXPORT(void) crStateRegFramebuffers(GLsizei n, GLuint *buffers);
97DECLEXPORT(void) crStateRegRenderbuffers(GLsizei n, GLuint *buffers);
98
99#ifdef IN_GUEST
100DECLEXPORT(GLenum) STATE_APIENTRY crStateCheckFramebufferStatusEXT(GLenum target);
101DECLEXPORT(GLenum) STATE_APIENTRY crStateSetFramebufferStatus(GLenum target, GLenum status);
102#endif
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* CR_STATE_FRAMEBUFFEROBJECT_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette