]> git.cworth.org Git - apitrace/blobdiff - wrappers/d3d9trace.py
os: Fix missing os::dump_backtrace symbol in Android builds.
[apitrace] / wrappers / d3d9trace.py
index 2a4c1a93d824503164d15e36b0796a7c105cec59..df401da5d090e7cd67b75018d8ba13f35cf20335 100644 (file)
@@ -25,8 +25,8 @@
 
 
 from dlltrace import DllTracer
-from specs.stdapi import API
-from specs.d3d9 import d3d9, D3DSHADER9
+from specs.stdapi import API, Pointer, ObjPointer
+from specs.d3d9 import d3d9, D3DSHADER9, IDirect3DSwapChain9Ex
 
 import specs.d3d9dxva2
 
@@ -41,6 +41,16 @@ class D3D9Tracer(DllTracer):
 
         DllTracer.serializeArgValue(self, function, arg)
 
+    def wrapArg(self, function, arg):
+        # Correctly handle the wrapping of IDirect3DSwapChain9Ex objects
+        if function.name in ('GetSwapChain', 'CreateAdditionalSwapChain') \
+           and self.interface.name == 'IDirect3DDevice9Ex' \
+           and arg.name == 'pSwapChain':
+            self.wrapValue(Pointer(ObjPointer(IDirect3DSwapChain9Ex)), '((IDirect3DSwapChain9Ex**)pSwapChain)')
+            return
+
+        DllTracer.wrapArg(self, function, arg)
+
     def enumWrapperInterfaceVariables(self, interface):
         variables = DllTracer.enumWrapperInterfaceVariables(self, interface)
         
@@ -84,17 +94,6 @@ if __name__ == '__main__':
     print '#include "d3d9shader.hpp"'
     print '#include "dxvaint.h"'
     print
-    print '''
-static inline size_t
-_declCount(const D3DVERTEXELEMENT9 *pVertexElements) {
-    size_t count = 0;
-    if (pVertexElements) {
-        while (pVertexElements[count++].Stream != 0xff)
-            ;
-    }
-    return count;
-}
-'''
 
     api = API()
     api.addModule(d3d9)