VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_bufferobject.h@ 37613

Last change on this file since 37613 was 34107, checked in by vboxsync, 14 years ago

crOpenGL/wddm: resync shared data only once

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef CR_STATE_BUFFEROBJECT_H
8#define CR_STATE_BUFFEROBJECT_H
9
10#include "cr_hash.h"
11#include "state/cr_statetypes.h"
12#include "state/cr_statefuncs.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef struct {
19 CRbitvalue dirty[CR_MAX_BITARRAY];
20 CRbitvalue arrayBinding[CR_MAX_BITARRAY];
21 CRbitvalue elementsBinding[CR_MAX_BITARRAY];
22 CRbitvalue packBinding[CR_MAX_BITARRAY];
23 CRbitvalue unpackBinding[CR_MAX_BITARRAY];
24} CRBufferObjectBits;
25
26
27/*
28 * Buffer object, like a texture object, but encapsulates arbitrary
29 * data (vertex, image, etc).
30 */
31typedef struct {
32 GLuint refCount;
33 GLuint id;
34 GLuint hwid;
35 GLenum usage;
36 GLenum access;
37 GLuint size; /* buffer size in bytes */
38 GLvoid *pointer; /* only valid while buffer is mapped */
39 GLvoid *data; /* the buffer data, if retainBufferData is true */
40 GLboolean bResyncOnRead; /* buffer data could be changed on server side,
41 so we need to resync every time guest wants to read from it*/
42 CRbitvalue dirty[CR_MAX_BITARRAY]; /* dirty data or state */
43 GLintptrARB dirtyStart, dirtyLength; /* dirty region */
44} CRBufferObject;
45
46typedef struct {
47 GLboolean retainBufferData; /* should state tracker retain buffer data? */
48 CRBufferObject *arrayBuffer;
49 CRBufferObject *elementsBuffer;
50 CRBufferObject *packBuffer;
51 CRBufferObject *unpackBuffer;
52
53 CRBufferObject *nullBuffer; /* name = 0 */
54} CRBufferObjectState;
55
56DECLEXPORT(CRBufferObject *) crStateGetBoundBufferObject(GLenum target, CRBufferObjectState *b);
57DECLEXPORT(GLboolean) crStateIsBufferBound(GLenum target);
58
59DECLEXPORT(GLuint) STATE_APIENTRY crStateBufferHWIDtoID(GLuint hwid);
60DECLEXPORT(GLuint) STATE_APIENTRY crStateGetBufferHWID(GLuint id);
61
62#ifdef __cplusplus
63}
64#endif
65
66#endif /* CR_STATE_BUFFEROBJECT_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