VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c@ 37791

Last change on this file since 37791 was 33475, checked in by vboxsync, 14 years ago

crOpenGL/wddm: multithreading fix

  • 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#include "packer.h"
8#include "cr_protocol.h"
9
10void PACK_APIENTRY crPackBegin( GLenum mode )
11{
12 CR_GET_PACKER_CONTEXT(pc);
13 unsigned char *data_ptr;
14 (void) pc;
15 if (pc->buffer.canBarf)
16 {
17 if (!pc->buffer.holds_BeginEnd)
18 pc->Flush( pc->flush_arg );
19 pc->buffer.in_BeginEnd = 1;
20 pc->buffer.holds_BeginEnd = 1;
21 }
22 CR_GET_BUFFERED_POINTER( pc, 4 );
23 pc->current.begin_data = data_ptr;
24 pc->current.begin_op = pc->buffer.opcode_current;
25 pc->current.attribsUsedMask = 0;
26 WRITE_DATA( 0, GLenum, mode );
27 WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
28 CR_UNLOCK_PACKER_CONTEXT(pc);
29}
30
31void PACK_APIENTRY crPackBeginSWAP( GLenum mode )
32{
33 CR_GET_PACKER_CONTEXT(pc);
34 unsigned char *data_ptr;
35 (void) pc;
36 if (pc->buffer.canBarf)
37 {
38 if (!pc->buffer.holds_BeginEnd)
39 pc->Flush( pc->flush_arg );
40 pc->buffer.in_BeginEnd = 1;
41 pc->buffer.holds_BeginEnd = 1;
42 }
43 CR_GET_BUFFERED_POINTER( pc, 4 );
44 pc->current.begin_data = data_ptr;
45 pc->current.begin_op = pc->buffer.opcode_current;
46 pc->current.attribsUsedMask = 0;
47 WRITE_DATA( 0, GLenum, SWAP32(mode) );
48 WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
49 CR_UNLOCK_PACKER_CONTEXT(pc);
50}
51
52void PACK_APIENTRY crPackEnd( void )
53{
54 CR_GET_PACKER_CONTEXT(pc);
55 unsigned char *data_ptr;
56 (void) pc;
57 CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
58 WRITE_OPCODE( pc, CR_END_OPCODE );
59 pc->buffer.in_BeginEnd = 0;
60 CR_UNLOCK_PACKER_CONTEXT(pc);
61}
62
63void PACK_APIENTRY crPackEndSWAP( void )
64{
65 CR_GET_PACKER_CONTEXT(pc);
66 unsigned char *data_ptr;
67 (void) pc;
68 CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
69 WRITE_OPCODE( pc, CR_END_OPCODE );
70 pc->buffer.in_BeginEnd = 0;
71 CR_UNLOCK_PACKER_CONTEXT(pc);
72}
73
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