summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions/common/crOpenGL/passthrough
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/Additions/common/crOpenGL/passthrough
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/Additions/common/crOpenGL/passthrough')
-rw-r--r--src/VBox/Additions/common/crOpenGL/passthrough/Makefile.kup0
-rw-r--r--src/VBox/Additions/common/crOpenGL/passthrough/passthrough.def6
-rwxr-xr-xsrc/VBox/Additions/common/crOpenGL/passthrough/passthrough.py40
-rw-r--r--src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.h21
-rw-r--r--src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.rc69
-rw-r--r--src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c64
6 files changed, 200 insertions, 0 deletions
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/Makefile.kup b/src/VBox/Additions/common/crOpenGL/passthrough/Makefile.kup
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/Makefile.kup
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.def b/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.def
new file mode 100644
index 00000000..9edc7163
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.def
@@ -0,0 +1,6 @@
+; Copyright (c) 2001, Stanford University
+; All rights reserved.
+;
+; See the file LICENSE.txt for information on redistributing this software.
+EXPORTS
+SPULoad
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py b/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py
new file mode 100755
index 00000000..ec7e27c7
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/passthrough.py
@@ -0,0 +1,40 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+from __future__ import print_function
+import sys
+
+import apiutil
+
+
+apiutil.CopyrightC()
+
+print("""#include <stdio.h>
+#include "cr_error.h"
+#include "cr_string.h"
+#include "cr_spu.h"
+#include "passthroughspu.h"
+""")
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+
+print('SPUNamedFunctionTable _cr_passthrough_table[%d];' % ( len(keys) + 1 ))
+
+print("""
+static void __fillin(int offset, char *name, SPUGenericFunction func)
+{
+ _cr_passthrough_table[offset].name = crStrdup(name);
+ _cr_passthrough_table[offset].fn = func;
+}
+
+void BuildPassthroughTable( SPU *child )
+{""")
+
+for index in range(len(keys)):
+ func_name = keys[index]
+ print('\t__fillin(%3d, "%s", (SPUGenericFunction) child->dispatch_table.%s);' % (index, func_name, func_name ))
+print('\t__fillin(%3d, NULL, NULL);' % len(keys))
+print('}')
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.h b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.h
new file mode 100644
index 00000000..a0e6b942
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.h
@@ -0,0 +1,21 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#ifndef GA_INCLUDED_SRC_common_crOpenGL_passthrough_passthroughspu_h
+#define GA_INCLUDED_SRC_common_crOpenGL_passthrough_passthroughspu_h
+#ifndef RT_WITHOUT_PRAGMA_ONCE
+# pragma once
+#endif
+
+
+#include "cr_spu.h"
+
+
+extern SPUNamedFunctionTable _cr_passthrough_table[];
+extern void BuildPassthroughTable( SPU *child );
+
+
+#endif /* !GA_INCLUDED_SRC_common_crOpenGL_passthrough_passthroughspu_h */
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.rc b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.rc
new file mode 100644
index 00000000..ad2034e5
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu.rc
@@ -0,0 +1,69 @@
+/* $Id: passthroughspu.rc $ */
+/** @file
+ * VBoxOGLpassthroughspu - Resource file containing version info and icon.
+ */
+
+/*
+ * Copyright (C) 2009-2019 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ */
+
+#include <windows.h>
+#include <VBox/version.h>
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VBOX_RC_FILE_VERSION
+ PRODUCTVERSION VBOX_RC_FILE_VERSION
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+ FILEFLAGS VBOX_RC_FILE_FLAGS
+ FILEOS VBOX_RC_FILE_OS
+ FILETYPE VBOX_RC_TYPE_DRV
+ FILESUBTYPE VFT2_DRV_DISPLAY
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "VirtualBox crOpenGL ICD\0"
+ VALUE "InternalName", "VBoxOGLpassthroughspu\0"
+#ifdef VBOX_WDDM_WOW64
+ VALUE "OriginalFilename", "VBoxOGLpassthroughspu-x86.dll\0"
+#else
+ VALUE "OriginalFilename", "VBoxOGLpassthroughspu.dll\0"
+#endif
+ VALUE "CompanyName", VBOX_RC_COMPANY_NAME
+ VALUE "FileVersion", VBOX_RC_FILE_VERSION_STR
+ VALUE "LegalCopyright", VBOX_RC_LEGAL_COPYRIGHT
+ VALUE "ProductName", VBOX_RC_PRODUCT_NAME_GA_STR
+ VALUE "ProductVersion", VBOX_RC_PRODUCT_VERSION_STR
+ VBOX_RC_MORE_STRINGS
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+1 RCDATA
+BEGIN
+// Machine dependent parameters
+ 17, // Height of vertical thumb
+ 17, // Width of horizontal thumb
+ 2, // Icon horiz compression factor
+ 2, // Icon vert compression factor
+ 1, // Cursor horz compression factor
+ 1, // Cursor vert compression factor
+ 0, // Kanji window height
+ 1, // cxBorder (thickness of vertical lines)
+ 1 // cyBorder (thickness of horizontal lines)
+END
diff --git a/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c
new file mode 100644
index 00000000..c08a17a4
--- /dev/null
+++ b/src/VBox/Additions/common/crOpenGL/passthrough/passthroughspu_init.c
@@ -0,0 +1,64 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#include "cr_error.h"
+#include "passthroughspu.h"
+
+static SPUFunctions passthrough_functions = {
+ NULL, /* CHILD COPY */
+ NULL, /* DATA */
+ _cr_passthrough_table /* THE ACTUAL FUNCTIONS */
+};
+
+static SPUFunctions *
+passthroughSPUInit( int id, SPU *child, SPU *self,
+ unsigned int context_id,
+ unsigned int num_contexts )
+{
+ (void) id;
+ (void) self;
+ (void) context_id;
+ (void) num_contexts;
+
+ if (child == NULL)
+ {
+ crError( "You can't load the passthrough SPU as the last SPU in a chain!" );
+ }
+ BuildPassthroughTable( child );
+ return &passthrough_functions;
+}
+
+static void
+passthroughSPUSelfDispatch(SPUDispatchTable *parent)
+{
+ (void)parent;
+}
+
+static int
+passthroughSPUCleanup(void)
+{
+ return 1;
+}
+
+static SPUOptions passthroughSPUOptions[] = {
+ { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
+};
+
+
+int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
+ SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
+ SPUOptionsPtr *options, int *flags )
+{
+ *name = "passthrough";
+ *super = NULL;
+ *init = passthroughSPUInit;
+ *self = passthroughSPUSelfDispatch;
+ *cleanup = passthroughSPUCleanup;
+ *options = passthroughSPUOptions;
+ *flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
+
+ return 1;
+}