]> git.cworth.org Git - apitrace/commitdiff
d3dretrace: Eliminate differences between d3d9/d3d10.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 11 Nov 2012 00:39:53 +0000 (00:39 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sun, 11 Nov 2012 00:39:53 +0000 (00:39 +0000)
helpers/d3d9size.hpp
retrace/d3d9retrace.py
specs/d3d9.py
specs/d3d9types.py
wrappers/d3d9trace.py

index 0041e256103816c343e6ca9c7163f0b765b88ede..69b2222c067effa030b81d598677a1b7f2860bb1 100644 (file)
@@ -188,10 +188,10 @@ _getLockSize(D3DFORMAT Format, UINT Width, UINT Height, INT RowPitch, UINT Depth
 
 
 static inline void
-_getLockInfo(IDirect3DVertexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock, void ** ppbData,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DVertexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock, void ** ppbData,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = *ppbData;
-    LockedSize = 0;
+    MappedSize = 0;
 
     if (SizeToLock == 0) {
         D3DVERTEXBUFFER_DESC Desc;
@@ -199,18 +199,18 @@ _getLockInfo(IDirect3DVertexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock
         if (FAILED(hr)) {
             return;
         }
-        LockedSize = Desc.Size;
+        MappedSize = Desc.Size;
     } else {
-        LockedSize = SizeToLock;
+        MappedSize = SizeToLock;
     }
 }
 
 
 static inline void
-_getLockInfo(IDirect3DIndexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock, void ** ppbData,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DIndexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock, void ** ppbData,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = *ppbData;
-    LockedSize = 0;
+    MappedSize = 0;
 
     if (SizeToLock == 0) {
         D3DINDEXBUFFER_DESC Desc;
@@ -218,18 +218,18 @@ _getLockInfo(IDirect3DIndexBuffer9 *pBuffer, UINT OffsetToLock, UINT SizeToLock,
         if (FAILED(hr)) {
             return;
         }
-        LockedSize = Desc.Size;
+        MappedSize = Desc.Size;
     } else {
-        LockedSize = SizeToLock;
+        MappedSize = SizeToLock;
     }
 }
 
 
 static inline void
-_getLockInfo(IDirect3DSurface9 *pSurface, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DSurface9 *pSurface, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = pLockedRect->pBits;
-    LockedSize = 0;
+    MappedSize = 0;
 
     HRESULT hr;
 
@@ -249,15 +249,15 @@ _getLockInfo(IDirect3DSurface9 *pSurface, const D3DLOCKED_RECT *pLockedRect, con
         Height = Desc.Height;
     }
 
-    LockedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
+    MappedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
 }
 
 
 static inline void
-_getLockInfo(IDirect3DTexture9 *pTexture, UINT Level, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DTexture9 *pTexture, UINT Level, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = pLockedRect->pBits;
-    LockedSize = 0;
+    MappedSize = 0;
 
     HRESULT hr;
 
@@ -277,15 +277,15 @@ _getLockInfo(IDirect3DTexture9 *pTexture, UINT Level, const D3DLOCKED_RECT *pLoc
         Height = Desc.Height;
     }
 
-    LockedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
+    MappedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
 }
 
 
 static inline void
-_getLockInfo(IDirect3DCubeTexture9 *pTexture, D3DCUBEMAP_FACES FaceType, UINT Level, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DCubeTexture9 *pTexture, D3DCUBEMAP_FACES FaceType, UINT Level, const D3DLOCKED_RECT *pLockedRect, const RECT *pRect,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = pLockedRect->pBits;
-    LockedSize = 0;
+    MappedSize = 0;
 
     HRESULT hr;
 
@@ -307,15 +307,15 @@ _getLockInfo(IDirect3DCubeTexture9 *pTexture, D3DCUBEMAP_FACES FaceType, UINT Le
         Height = Desc.Height;
     }
 
-    LockedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
+    MappedSize = _getLockSize(Desc.Format, Width, Height, pLockedRect->Pitch);
 }
 
 
 static inline void
-_getLockInfo(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = pLockedVolume->pBits;
-    LockedSize = 0;
+    MappedSize = 0;
 
     HRESULT hr;
 
@@ -338,15 +338,15 @@ _getLockInfo(IDirect3DVolume9 *pVolume, const D3DLOCKED_BOX *pLockedVolume, cons
         Depth  = Desc.Depth;
     }
 
-    LockedSize = _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch);
+    MappedSize = _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch);
 }
 
 
 static inline void
-_getLockInfo(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox,
-             void * & pLockedData, size_t & LockedSize) {
+_getMapInfo(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX *pLockedVolume, const D3DBOX *pBox,
+             void * & pLockedData, size_t & MappedSize) {
     pLockedData = pLockedVolume->pBits;
-    LockedSize = 0;
+    MappedSize = 0;
 
     HRESULT hr;
 
@@ -369,7 +369,7 @@ _getLockInfo(IDirect3DVolumeTexture9 *pTexture, UINT Level, const D3DLOCKED_BOX
         Depth  = Desc.Depth;
     }
 
-    LockedSize = _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch);
+    MappedSize = _getLockSize(Desc.Format, Width, Height, pLockedVolume->RowPitch, Depth, pLockedVolume->SlicePitch);
 }
 
 
index c175705e2dd036f21b4903cb672856dca29e5945..fd265ca50d31c1dbb15c74eb66b1702f15287d72 100644 (file)
@@ -36,7 +36,7 @@ class D3DRetracer(Retracer):
 
     def retraceModule(self, api):
         print '// Swizzling mapping for lock addresses'
-        print 'static std::map<void *, void *> _locks;'
+        print 'static std::map<void *, void *> _maps;'
         print
 
         self.table_name = 'd3dretrace::d3d_callbacks'
@@ -99,13 +99,13 @@ class D3DRetracer(Retracer):
 
         if method.name in ('Lock', 'LockRect', 'LockBox'):
             print '    VOID *_pbData = NULL;'
-            print '    size_t _LockedSize = 0;'
-            print '    _getLockInfo(_this, %s, _pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
-            print '    _locks[_this] = _pbData;'
+            print '    size_t _MappedSize = 0;'
+            print '    _getMapInfo(_this, %s, _pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
+            print '    _maps[_this] = _pbData;'
         
         if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
             print '    VOID *_pbData = 0;'
-            print '    _pbData = _locks[_this];'
+            print '    _pbData = _maps[_this];'
             print '    if (_pbData) {'
             print '        retrace::delRegionByPointer(_pbData);'
             print '    }'
index c3f28008502a6e2ccaa0a5f3ee3fce9a01eea960..a3b40d119e299c7b530ee61bcdde2c405471a1e5 100644 (file)
@@ -347,13 +347,13 @@ IDirect3DCubeTexture9.methods += [
 ]
 
 IDirect3DVertexBuffer9.methods += [
-    StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_LockedSize")), "ppbData"), (D3DLOCK, "Flags")]),
+    StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppbData"), (D3DLOCK, "Flags")]),
     StdMethod(HRESULT, "Unlock", []),
     StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DVERTEXBUFFER_DESC), "pDesc")], sideeffects=False),
 ]
 
 IDirect3DIndexBuffer9.methods += [
-    StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_LockedSize")), "ppbData"), (D3DLOCK, "Flags")]),
+    StdMethod(HRESULT, "Lock", [(UINT, "OffsetToLock"), (UINT, "SizeToLock"), Out(Pointer(LinearPointer(Void, "_MappedSize")), "ppbData"), (D3DLOCK, "Flags")]),
     StdMethod(HRESULT, "Unlock", []),
     StdMethod(HRESULT, "GetDesc", [Out(Pointer(D3DINDEXBUFFER_DESC), "pDesc")], sideeffects=False),
 ]
index 279d6d3c08f21bd715643724f49af2b0727a5992..41b689036216bed84a3ad47b3e72877e4cb1fef1 100644 (file)
@@ -929,7 +929,7 @@ D3DVOLUME_DESC = Struct("D3DVOLUME_DESC", [
 
 D3DLOCKED_RECT = Struct("D3DLOCKED_RECT", [
     (INT, "Pitch"),
-    (LinearPointer(Void, "_LockedSize"), "pBits"),
+    (LinearPointer(Void, "_MappedSize"), "pBits"),
 ])
 
 D3DBOX = Struct("D3DBOX", [
@@ -944,7 +944,7 @@ D3DBOX = Struct("D3DBOX", [
 D3DLOCKED_BOX = Struct("D3DLOCKED_BOX", [
     (INT, "RowPitch"),
     (INT, "SlicePitch"),
-    (LinearPointer(Void, "_LockedSize"), "pBits"),
+    (LinearPointer(Void, "_MappedSize"), "pBits"),
 ])
 
 D3DRANGE = Struct("D3DRANGE", [
index cec045e4c5d6876fcc378e84f7950bb92dbaffcc..c1cadb67e49b10d39d6619992d6fb6acceb73977 100644 (file)
@@ -48,7 +48,7 @@ class D3D9Tracer(DllTracer):
            interface.getMethodByName('LockRect') is not None or \
            interface.getMethodByName('LockBox') is not None:
             variables += [
-                ('size_t', '_LockedSize', '0'),
+                ('size_t', '_MappedSize', '0'),
                 ('VOID *', 'm_pbData', '0'),
             ]
 
@@ -56,8 +56,8 @@ class D3D9Tracer(DllTracer):
 
     def implementWrapperInterfaceMethodBody(self, interface, base, method):
         if method.name in ('Unlock', 'UnlockRect', 'UnlockBox'):
-            print '    if (_LockedSize && m_pbData) {'
-            self.emit_memcpy('(LPBYTE)m_pbData', '(LPBYTE)m_pbData', '_LockedSize')
+            print '    if (_MappedSize && m_pbData) {'
+            self.emit_memcpy('(LPBYTE)m_pbData', '(LPBYTE)m_pbData', '_MappedSize')
             print '    }'
 
         DllTracer.implementWrapperInterfaceMethodBody(self, interface, base, method)
@@ -65,10 +65,10 @@ class D3D9Tracer(DllTracer):
         if method.name in ('Lock', 'LockRect', 'LockBox'):
             # FIXME: handle recursive locks
             print '    if (SUCCEEDED(_result) && !(Flags & D3DLOCK_READONLY)) {'
-            print '        _getLockInfo(_this, %s, m_pbData, _LockedSize);' % ', '.join(method.argNames()[:-1])
+            print '        _getMapInfo(_this, %s, m_pbData, _MappedSize);' % ', '.join(method.argNames()[:-1])
             print '    } else {'
             print '        m_pbData = NULL;'
-            print '        _LockedSize = 0;'
+            print '        _MappedSize = 0;'
             print '    }'