VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/pack/packspu_framebuffer.c@ 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: packspu_framebuffer.c 76553 2019-01-01 01:45:53Z vboxsync $ */
2
3/** @file
4 * VBox OpenGL FBO related functions
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#include "packspu.h"
20#include "cr_packfunctions.h"
21#include "cr_net.h"
22#include "packspu_proto.h"
23
24void PACKSPU_APIENTRY
25packspu_FramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
26{
27 crStateFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
28 crPackFramebufferTexture1DEXT(target, attachment, textarget, texture, level);
29}
30
31void PACKSPU_APIENTRY
32packspu_FramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
33{
34 crStateFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
35 crPackFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
36}
37
38void PACKSPU_APIENTRY
39packspu_FramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)
40{
41 crStateFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
42 crPackFramebufferTexture3DEXT(target, attachment, textarget, texture, level, zoffset);
43}
44
45void PACKSPU_APIENTRY
46packspu_BindFramebufferEXT(GLenum target, GLuint framebuffer)
47{
48 crStateBindFramebufferEXT(target, framebuffer);
49 crPackBindFramebufferEXT(target, framebuffer);
50}
51
52void PACKSPU_APIENTRY
53packspu_DeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers)
54{
55 crStateDeleteFramebuffersEXT(n, framebuffers);
56 crPackDeleteFramebuffersEXT(n, framebuffers);
57}
58
59void PACKSPU_APIENTRY
60packspu_DeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers)
61{
62 crStateDeleteRenderbuffersEXT(n, renderbuffers);
63 crPackDeleteRenderbuffersEXT(n, renderbuffers);
64}
65
66void PACKSPU_APIENTRY
67packspu_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
68{
69 crStateFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
70 crPackFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
71}
72
73void PACKSPU_APIENTRY
74packspu_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
75{
76 crStateBindRenderbufferEXT(target, renderbuffer);
77 crPackBindRenderbufferEXT(target, renderbuffer);
78}
79
80GLenum PACKSPU_APIENTRY
81packspu_CheckFramebufferStatusEXT(GLenum target)
82{
83 GET_THREAD(thread);
84 int writeback = 1;
85 GLenum status = crStateCheckFramebufferStatusEXT(target);
86
87 if (status!=GL_FRAMEBUFFER_UNDEFINED)
88 {
89 return status;
90 }
91
92 crPackCheckFramebufferStatusEXT(target, &status, &writeback);
93
94 packspuFlush((void *) thread);
95 CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
96
97 crStateSetFramebufferStatus(target, status);
98 return status;
99}
100
101void PACKSPU_APIENTRY packspu_GenFramebuffersEXT( GLsizei n, GLuint * framebuffers )
102{
103 GET_THREAD(thread);
104 int writeback = 1;
105 if (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))
106 {
107 crError( "packspu_GenFramebuffersEXT doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" );
108 }
109 if (pack_spu.swap)
110 {
111 crPackGenFramebuffersEXTSWAP( n, framebuffers, &writeback );
112 }
113 else
114 {
115 crPackGenFramebuffersEXT( n, framebuffers, &writeback );
116 }
117 packspuFlush( (void *) thread );
118 CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
119
120 crStateRegFramebuffers(n, framebuffers);
121}
122
123void PACKSPU_APIENTRY packspu_GenRenderbuffersEXT( GLsizei n, GLuint * renderbuffers )
124{
125 GET_THREAD(thread);
126 int writeback = 1;
127 if (!CRPACKSPU_IS_WDDM_CRHGSMI() && !(pack_spu.thread[pack_spu.idxThreadInUse].netServer.conn->actual_network))
128 {
129 crError( "packspu_GenRenderbuffersEXT doesn't work when there's no actual network involved!\nTry using the simplequery SPU in your chain!" );
130 }
131 if (pack_spu.swap)
132 {
133 crPackGenRenderbuffersEXTSWAP( n, renderbuffers, &writeback );
134 }
135 else
136 {
137 crPackGenRenderbuffersEXT( n, renderbuffers, &writeback );
138 }
139 packspuFlush( (void *) thread );
140 CRPACKSPU_WRITEBACK_WAIT(thread, writeback);
141
142 crStateRegRenderbuffers(n, renderbuffers);
143}
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