feat(profile): label more CGxDevice virtual functions and class members

This commit is contained in:
phaneron 2024-10-02 04:19:55 -04:00
parent d67e052d75
commit 5a70c8290f
8 changed files with 283 additions and 18 deletions

View file

@ -4,6 +4,8 @@
#include "system/types.h"
#include "storm/list.h"
#include "async/object.h"
DECLARE_STRUCT(TSLink_CAsyncQueue);
DECLARE_STRUCT(TSExplicitList_CAsyncObject);

View file

@ -5,7 +5,15 @@
#include "external/d3d9/device.h"
typedef struct CGxDeviceD3d CGxDeviceD3d;
#include "storm/array.h"
DECLARE_STRUCT(CGxDeviceD3d);
DECLARE_STRUCT(CGxDeviceD3d__GxVertexDecl);
struct CGxDeviceD3d__GxVertexDecl {
uint32_t m_unk00;
};
STORM_TS_GROWABLE_ARRAY(CGxDeviceD3d__GxVertexDecl);
struct CGxDeviceD3d {
CGxDevice b_base;
@ -22,7 +30,8 @@ struct CGxDeviceD3d {
uint32_t unk3AB8;
uint32_t unk3ABC;
uint32_t m_d3dStereoHandle;
uint32_t unk3AC4[7];
uint32_t unk3AC4[3]; //TSList?
TSGrowableArray_CGxDeviceD3d__GxVertexDecl m_vertexDecl;
IDirect3DVertexDeclaration9* m_d3dVertexDecl[14];
D3DDISPLAYMODE m_desktopDisplayMode;
int32_t m_inScene;

View file

@ -4,7 +4,11 @@
#include "system/types.h"
#include "storm/array.h"
#include "storm/array/uint16_t.h"
#include "storm/array/uint32_t.h"
#include "storm/array/c2vector.h"
#include "storm/array/c3vector.h"
#include "storm/array/cimvector.h"
#include "tempest/box.h"
#include "tempest/matrix.h"
@ -79,14 +83,16 @@ struct CGxDevice__vtable {
// void NotifyOnDisplayChange();
void* v_fn_7_NotifyOnDisplayChange;
// don't know if this ever gets called (something deleted?)
void* v_fn_8;
void* v_fn_9;
void* v_fn_8_destructor;
// int32_t DeviceCreate(const CGxFormat&);
void* v_fn_9_DeviceCreate;
// int32_t DeviceCreate(long (*)(void*, uint32_t, uint32_t, int32_t), CGxFormat const&);
void* v_fn_10_DeviceCreate;
// void DeviceDestroy();
void* v_fn_11_DeviceDestroy;
void* v_fn_12;
// int32_t DeviceSetFormat(struct CGxFormat const &);
// void DeviceEvictResources();
void* v_fn_12_DeviceEvictResources;
// int32_t DeviceSetFormat(const CGxFormat&);
void* v_fn_13_DeviceSetFormat;
// void DeviceSetBaseMipLevel(uint32_t);
void* v_fn_14_DeviceSetBaseMipLevel;
@ -110,15 +116,15 @@ struct CGxDevice__vtable {
void* v_fn_28_DeviceOverride;
// void AddDeviceRestoredCallback(DEVICERESTOREDCALLBACK);
void* v_fn_29_AddDeviceRestoredCallback;
// void RemoveDeviceRestoredCallback(DEVICERESTOREDCALLBACK);
// int32_t RemoveDeviceRestoredCallback(DEVICERESTOREDCALLBACK);
void* v_fn_30_RemoveDeviceRestoredCallback;
// void AddTextureRecreationCallback(TEXTURERECREATIONCALLBACK);
void* v_fn_31_AddTextureRecreationCallback;
// void RemoveTextureRecreationCallback(TEXTURERECREATIONCALLBACK);
// int32_t RemoveTextureRecreationCallback(TEXTURERECREATIONCALLBACK);
void* v_fn_32_RemoveTextureRecreationCallback;
// void AddDisplayChangeCallback(DISPLAYCHANGECALLBACK);
void* v_fn_33_AddDisplayChangeCallback;
// void AddDisplayChangeCallback(DISPLAYCHANGECALLBACK);
// int32_t RemoveDisplayChangeCallback(DISPLAYCHANGECALLBACK);
void* v_fn_34_RemoveDisplayChangeCallback;
// void CapsWindowSize(CRect&);
void* v_fn_35_CapsWindowSize;
@ -201,7 +207,17 @@ struct CGxDevice {
TSGrowableArray_CGxPushedRenderState m_pushedStates; // 0x4 (size: 0x14)
TSGrowableArray_uint32_t m_stackOffsets; // 0x18 (size: 0x14)
TSGrowableArray_EGxRenderState m_dirtyStates; // 0x2C (size: 0x14)
uint32_t m_unk34[76];
uint32_t m_unk34[4];
C3Vector m_primVertex;
C2Vector m_primTexCoord[8];
C3Vector m_primNormal;
CImVector m_primColor;
TSGrowableArray_C3Vector m_primVertexArray;
TSGrowableArray_C2Vector m_primTexCoordArray[8];
TSGrowableArray_C3Vector m_primNormalArray;
TSGrowableArray_CImVector m_primColorArray;
TSGrowableArray_uint16_t m_primIndexArray;
uint32_t m_primMask;
CRect m_defWindowRect; // 0x164 (size: 0x10)
CRect m_curWindowRect; // 0x174 (size: 0x10)
// uint32_t m_unk184[12] {
@ -224,8 +240,8 @@ struct CGxDevice {
int32_t m_windowVisible;
int32_t intF64;
int32_t intF68;
// Invented name, though seems to have the same place as CGxDeviceD3d::m_d3dNeedsReset
int32_t m_needsUpdate;
// Invented name, though seems to have the same place as CGxDeviceD3d::m_d3dNeedsReset (Alpha)
int32_t m_needsReset;
CBoundingBox m_viewport;
C44Matrix m_projection;
C44Matrix m_projNative;

View file

@ -0,0 +1,10 @@
#ifndef STORM_ARRAY_C_2_VECTOR_H
#define STORM_ARRAY_C_2_VECTOR_H
#include "tempest/vector.h"
#include "storm/array.h"
STORM_TS_GROWABLE_ARRAY(C2Vector);
#endif

View file

@ -0,0 +1,10 @@
#ifndef STORM_ARRAY_C_3_VECTOR_H
#define STORM_ARRAY_C_3_VECTOR_H
#include "tempest/vector.h"
#include "storm/array.h"
STORM_TS_GROWABLE_ARRAY(C3Vector);
#endif

View file

@ -0,0 +1,10 @@
#ifndef STORM_ARRAY_C_IM_VECTOR_H
#define STORM_ARRAY_C_IM_VECTOR_H
#include "tempest/vector.h"
#include "storm/array.h"
STORM_TS_GROWABLE_ARRAY(CImVector);
#endif

View file

@ -0,0 +1,10 @@
#ifndef STORM_ARRAY_UINT16_T_H
#define STORM_ARRAY_UINT16_T_H
#include "system/types.h"
#include "storm/array.h"
STORM_TS_GROWABLE_ARRAY(uint16_t);
#endif

View file

@ -821,6 +821,17 @@
}
]
},
{
"name": "CGxDeviceD3d__GxVertexDecl",
"size": 4,
"members": [
{
"type": "uint32_t",
"name": "m_unk00",
"offset": 0
}
]
},
{
"name": "CGxDevice__vtable",
"size": 336,
@ -867,12 +878,12 @@
},
{
"type": "void*",
"name": "v_fn_8",
"name": "v_fn_8_destructor",
"offset": 32
},
{
"type": "void*",
"name": "v_fn_9",
"name": "v_fn_9_DeviceCreate",
"offset": 36
},
{
@ -887,7 +898,7 @@
},
{
"type": "void*",
"name": "v_fn_12",
"name": "v_fn_12_DeviceEvictResources",
"offset": 48
},
{
@ -2797,6 +2808,84 @@
}
]
},
{
"name": "TSGrowableArray_C2Vector",
"size": 16,
"members": [
{
"type": "uint32_t",
"name": "m_alloc",
"offset": 0
},
{
"type": "uint32_t",
"name": "m_count",
"offset": 4
},
{
"type": "C2Vector*",
"name": "m_data",
"offset": 8
},
{
"type": "uint32_t",
"name": "m_chunk",
"offset": 12
}
]
},
{
"name": "TSGrowableArray_C3Vector",
"size": 16,
"members": [
{
"type": "uint32_t",
"name": "m_alloc",
"offset": 0
},
{
"type": "uint32_t",
"name": "m_count",
"offset": 4
},
{
"type": "C3Vector*",
"name": "m_data",
"offset": 8
},
{
"type": "uint32_t",
"name": "m_chunk",
"offset": 12
}
]
},
{
"name": "TSGrowableArray_CGxDeviceD3d__GxVertexDecl",
"size": 16,
"members": [
{
"type": "uint32_t",
"name": "m_alloc",
"offset": 0
},
{
"type": "uint32_t",
"name": "m_count",
"offset": 4
},
{
"type": "CGxDeviceD3d__GxVertexDecl*",
"name": "m_data",
"offset": 8
},
{
"type": "uint32_t",
"name": "m_chunk",
"offset": 12
}
]
},
{
"name": "TSGrowableArray_CGxPushedRenderState",
"size": 16,
@ -2823,6 +2912,32 @@
}
]
},
{
"name": "TSGrowableArray_CImVector",
"size": 16,
"members": [
{
"type": "uint32_t",
"name": "m_alloc",
"offset": 0
},
{
"type": "uint32_t",
"name": "m_count",
"offset": 4
},
{
"type": "CImVector*",
"name": "m_data",
"offset": 8
},
{
"type": "uint32_t",
"name": "m_chunk",
"offset": 12
}
]
},
{
"name": "TSGrowableArray_CSimpleBatchedMesh",
"size": 16,
@ -3265,6 +3380,32 @@
}
]
},
{
"name": "TSGrowableArray_uint16_t",
"size": 16,
"members": [
{
"type": "uint32_t",
"name": "m_alloc",
"offset": 0
},
{
"type": "uint32_t",
"name": "m_count",
"offset": 4
},
{
"type": "uint16_t*",
"name": "m_data",
"offset": 8
},
{
"type": "uint32_t",
"name": "m_chunk",
"offset": 12
}
]
},
{
"name": "TSGrowableArray_uint32_t",
"size": 16,
@ -7445,9 +7586,61 @@
{
"type": "uint32_t",
"name": "m_unk34",
"arrsize": 76,
"arrsize": 4,
"offset": 52
},
{
"type": "C3Vector",
"name": "m_primVertex",
"offset": 68
},
{
"type": "C2Vector",
"name": "m_primTexCoord",
"arrsize": 8,
"offset": 80
},
{
"type": "C3Vector",
"name": "m_primNormal",
"offset": 144
},
{
"type": "CImVector",
"name": "m_primColor",
"offset": 156
},
{
"type": "TSGrowableArray_C3Vector",
"name": "m_primVertexArray",
"offset": 160
},
{
"type": "TSGrowableArray_C2Vector",
"name": "m_primTexCoordArray",
"arrsize": 8,
"offset": 176
},
{
"type": "TSGrowableArray_C3Vector",
"name": "m_primNormalArray",
"offset": 304
},
{
"type": "TSGrowableArray_CImVector",
"name": "m_primColorArray",
"offset": 320
},
{
"type": "TSGrowableArray_uint16_t",
"name": "m_primIndexArray",
"offset": 336
},
{
"type": "uint32_t",
"name": "m_primMask",
"offset": 352
},
{
"type": "CRect",
"name": "m_defWindowRect",
@ -7540,7 +7733,7 @@
},
{
"type": "int32_t",
"name": "m_needsUpdate",
"name": "m_needsReset",
"offset": 3948
},
{
@ -8338,9 +8531,14 @@
{
"type": "uint32_t",
"name": "unk3AC4",
"arrsize": 7,
"arrsize": 3,
"offset": 15052
},
{
"type": "TSGrowableArray_CGxDeviceD3d__GxVertexDecl",
"name": "m_vertexDecl",
"offset": 15064
},
{
"type": "IDirect3DVertexDeclaration9*",
"name": "m_d3dVertexDecl",