VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/spu_loader/spuchange.py@ 49216

最後變更 在這個檔案從49216是 36231,由 vboxsync 提交於 14 年 前

crOpenGL: workaround for recent nvidia drivers, disabled yet as need more testing

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.8 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6import sys
7import apiutil
8
9
10apiutil.CopyrightC()
11
12print """
13
14/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY spuchange.py SCRIPT */
15
16#include "cr_spu.h"
17#include "cr_error.h"
18
19void crSPUChangeInterface( SPUDispatchTable *table, void *orig_func, void *new_func )
20{
21 struct _copy_list_node *temp;
22 if (table->mark == 1)
23 {
24 return;
25 }
26 if (orig_func == new_func)
27 {
28 return;
29 }
30 table->mark = 1;
31"""
32
33keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
34for func_name in keys:
35 print '\tif ((void *)table->%s == orig_func)' % func_name
36 print '\t{'
37 print '\t\ttable->%s = (%sFunc_t)new_func;' % (func_name, func_name)
38 print '\t\tfor (temp = table->copyList ; temp ; temp = temp->next)'
39 print '\t\t{'
40 print '\t\t\tcrSPUChangeInterface( temp->copy, orig_func, new_func );'
41 print '\t\t}'
42 print '\t}'
43
44print """
45 if (table->copy_of != NULL)
46 {
47 crSPUChangeInterface( table->copy_of, orig_func, new_func );
48 }
49 for (temp = table->copyList ; temp ; temp = temp->next)
50 {
51 crSPUChangeInterface( temp->copy, orig_func, new_func );
52 }
53 table->mark = 0;
54"""
55print '}'
56
57print """
58void crSPUChangeDispatch(SPUDispatchTable *dispatch, const SPUNamedFunctionTable *newtable)
59{
60 SPUGenericFunction func;
61"""
62keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
63for func_name in keys:
64 print '\tfunc = crSPUFindFunction(newtable, "%s");' % func_name
65 print '\tif (func && ((SPUGenericFunction)dispatch->%s!=func))' % func_name
66 print '\t{'
67 print '\t\tcrDebug("%%s changed from %%p to %%p", "gl%s", dispatch->%s, func);' % (func_name, func_name)
68 print '\t\tcrSPUChangeInterface(dispatch, dispatch->%s, func);' % func_name
69 print '\t}\n'
70print """
71}
72"""
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette