1 | /* $Id: packspu_framebuffer.c 23694 2009-10-12 13:46:26Z vboxsync $ */
|
---|
2 |
|
---|
3 | /** @file
|
---|
4 | * VBox OpenGL FBO related functions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2009 Sun Microsystems, Inc.
|
---|
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 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
19 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
20 | * additional information or have any questions.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #include "packspu.h"
|
---|
24 | #include "cr_packfunctions.h"
|
---|
25 | #include "cr_net.h"
|
---|
26 | #include "packspu_proto.h"
|
---|
27 |
|
---|
28 | void PACKSPU_APIENTRY
|
---|
29 | packspu_FramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
30 | {
|
---|
31 | crStateFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
|
---|
32 | crPackFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
|
---|
33 | }
|
---|
34 |
|
---|
35 | void PACKSPU_APIENTRY
|
---|
36 | packspu_FramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
|
---|
37 | {
|
---|
38 | crStateFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
|
---|
39 | crPackFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
|
---|
40 | }
|
---|
41 |
|
---|
42 | void PACKSPU_APIENTRY
|
---|
43 | packspu_FramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
|
---|
44 | {
|
---|
45 | crStateFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
|
---|
46 | crPackFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
|
---|
47 | }
|
---|
48 |
|
---|
49 | void PACKSPU_APIENTRY
|
---|
50 | packspu_BindFramebufferEXT(GLenum target, GLuint framebuffer)
|
---|
51 | {
|
---|
52 | crStateBindFramebufferEXT(target, framebuffer);
|
---|
53 | crPackBindFramebufferEXT(target, framebuffer);
|
---|
54 | }
|
---|
55 |
|
---|
56 | void PACKSPU_APIENTRY
|
---|
57 | packspu_DeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
|
---|
58 | {
|
---|
59 | crStateDeleteFramebuffersEXT(n, framebuffers);
|
---|
60 | crPackDeleteFramebuffersEXT(n, framebuffers);
|
---|
61 | }
|
---|
62 |
|
---|
63 | void PACKSPU_APIENTRY
|
---|
64 | packspu_DeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
|
---|
65 | {
|
---|
66 | crStateDeleteFramebuffersEXT(n, renderbuffers);
|
---|
67 | crPackDeleteFramebuffersEXT(n, renderbuffers);
|
---|
68 | }
|
---|
69 |
|
---|
70 | void PACKSPU_APIENTRY
|
---|
71 | packspu_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
|
---|
72 | {
|
---|
73 | crStateFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
|
---|
74 | crPackFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
|
---|
75 | }
|
---|
76 |
|
---|
77 | GLenum PACKSPU_APIENTRY
|
---|
78 | packspu_CheckFramebufferStatusEXT(GLenum target)
|
---|
79 | {
|
---|
80 | GET_THREAD(thread);
|
---|
81 | int writeback = 1;
|
---|
82 | GLenum status = crStateCheckFramebufferStatusEXT(target);
|
---|
83 |
|
---|
84 | if (status!=GL_FRAMEBUFFER_UNDEFINED)
|
---|
85 | {
|
---|
86 | return status;
|
---|
87 | }
|
---|
88 |
|
---|
89 | crPackCheckFramebufferStatusEXT(target, &status, &writeback);
|
---|
90 |
|
---|
91 | packspuFlush((void *) thread);
|
---|
92 | while (writeback)
|
---|
93 | crNetRecv();
|
---|
94 |
|
---|
95 | crStateSetFramebufferStatus(target, status);
|
---|
96 | return status;
|
---|
97 | }
|
---|