summaryrefslogtreecommitdiffstats
path: root/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:46 +0000
commitf8fe689a81f906d1b91bb3220acde2a4ecb14c5b (patch)
tree26484e9d7e2c67806c2d1760196ff01aaa858e8c /src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
parentInitial commit. (diff)
downloadvirtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.tar.xz
virtualbox-f8fe689a81f906d1b91bb3220acde2a4ecb14c5b.zip
Adding upstream version 6.0.4-dfsg.upstream/6.0.4-dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/GuestHost/OpenGL/packer/pack_beginend.c')
-rw-r--r--src/VBox/GuestHost/OpenGL/packer/pack_beginend.c86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c b/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
new file mode 100644
index 00000000..e6057639
--- /dev/null
+++ b/src/VBox/GuestHost/OpenGL/packer/pack_beginend.c
@@ -0,0 +1,86 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#include "packer.h"
+#include "cr_protocol.h"
+
+void PACK_APIENTRY crPackBegin( GLenum mode )
+{
+ CR_GET_PACKER_CONTEXT(pc);
+ unsigned char *data_ptr;
+ (void) pc;
+
+ if (CR_CMDBLOCK_IS_STARTED(pc, CRPACKBLOCKSTATE_OP_BEGIN))
+ {
+ WARN(("recursive begin?"));
+ return;
+ }
+
+ CR_CMDBLOCK_BEGIN( pc, CRPACKBLOCKSTATE_OP_BEGIN );
+#ifndef VBOX
+ if (pc->buffer.canBarf)
+ {
+ if (!pc->buffer.holds_BeginEnd)
+ pc->Flush( pc->flush_arg );
+ pc->buffer.in_BeginEnd = 1;
+ pc->buffer.holds_BeginEnd = 1;
+ }
+#endif
+ CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH(pc, 4, GL_FALSE);
+ pc->current.begin_data = data_ptr;
+ pc->current.begin_op = pc->buffer.opcode_current;
+ pc->current.attribsUsedMask = 0;
+ WRITE_DATA( 0, GLenum, mode );
+ WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
+ CR_UNLOCK_PACKER_CONTEXT(pc);
+}
+
+void PACK_APIENTRY crPackBeginSWAP( GLenum mode )
+{
+ CR_GET_PACKER_CONTEXT(pc);
+ unsigned char *data_ptr;
+ (void) pc;
+#ifndef VBOX
+ if (pc->buffer.canBarf)
+ {
+ if (!pc->buffer.holds_BeginEnd)
+ pc->Flush( pc->flush_arg );
+ pc->buffer.in_BeginEnd = 1;
+ pc->buffer.holds_BeginEnd = 1;
+ }
+#endif
+ CR_GET_BUFFERED_POINTER_NO_BEGINEND_FLUSH(pc, 4, GL_FALSE);
+ pc->current.begin_data = data_ptr;
+ pc->current.begin_op = pc->buffer.opcode_current;
+ pc->current.attribsUsedMask = 0;
+ WRITE_DATA( 0, GLenum, SWAP32(mode) );
+ WRITE_OPCODE( pc, CR_BEGIN_OPCODE );
+ CR_UNLOCK_PACKER_CONTEXT(pc);
+}
+
+void PACK_APIENTRY crPackEnd( void )
+{
+ CR_GET_PACKER_CONTEXT(pc);
+ unsigned char *data_ptr;
+ (void) pc;
+ CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
+ WRITE_OPCODE( pc, CR_END_OPCODE );
+ pc->buffer.in_BeginEnd = 0;
+ CR_CMDBLOCK_END( pc, CRPACKBLOCKSTATE_OP_BEGIN );
+ CR_UNLOCK_PACKER_CONTEXT(pc);
+}
+
+void PACK_APIENTRY crPackEndSWAP( void )
+{
+ CR_GET_PACKER_CONTEXT(pc);
+ unsigned char *data_ptr;
+ (void) pc;
+ CR_GET_BUFFERED_POINTER_NO_ARGS( pc );
+ WRITE_OPCODE( pc, CR_END_OPCODE );
+ pc->buffer.in_BeginEnd = 0;
+ CR_CMDBLOCK_END( pc, CRPACKBLOCKSTATE_OP_BEGIN );
+ CR_UNLOCK_PACKER_CONTEXT(pc);
+}