wined3d: Add a couple of traces to the vertexdeclaration creation code.

This commit is contained in:
H. Verbeet 2006-08-07 19:21:54 +02:00 committed by Alexandre Julliard
parent 2886e9b0e8
commit 02a8f74490
4 changed files with 72 additions and 0 deletions

View File

@ -269,6 +269,51 @@ const char* debug_d3dusagequery(DWORD usagequery) {
}
}
const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method) {
switch (method) {
#define WINED3DDECLMETHOD_TO_STR(u) case u: return #u
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_DEFAULT);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_PARTIALU);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_PARTIALV);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_CROSSUV);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_UV);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_LOOKUP);
WINED3DDECLMETHOD_TO_STR(WINED3DDECLMETHOD_LOOKUPPRESAMPLED);
#undef WINED3DDECLMETHOD_TO_STR
default:
FIXME("Unrecognized %u declaration method!\n", method);
return "unrecognized";
}
}
const char* debug_d3ddecltype(WINED3DDECLTYPE type) {
switch (type) {
#define WINED3DDECLTYPE_TO_STR(u) case u: return #u
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT1);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT2);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT3);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT4);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_D3DCOLOR);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_UBYTE4);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_SHORT2);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_SHORT4);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_UBYTE4N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_SHORT2N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_SHORT4N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_USHORT2N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_USHORT4N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_UDEC3);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_DEC3N);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT16_2);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_FLOAT16_4);
WINED3DDECLTYPE_TO_STR(WINED3DDECLTYPE_UNUSED);
#undef WINED3DDECLTYPE_TO_STR
default:
FIXME("Unrecognized %u declaration type!\n", type);
return "unrecognized";
}
}
const char* debug_d3ddeclusage(BYTE usage) {
switch (usage) {
#define WINED3DDECLUSAGE_TO_STR(u) case u: return #u
@ -600,6 +645,7 @@ const char* debug_d3dpool(WINED3DPOOL Pool) {
return "unrecognized";
}
}
/*****************************************************************************
* Useful functions mapping GL <-> D3D values
*/

View File

@ -170,6 +170,16 @@ typedef enum _D3DVSDT_TYPE {
#define D3DVSD_END() 0xFFFFFFFF
#define D3DVSD_NOP() 0x00000000
static void dump_wined3dvertexelement(const WINED3DVERTEXELEMENT *element) {
TRACE(" Stream: %d\n", element->Stream);
TRACE(" Offset: %d\n", element->Offset);
TRACE(" Type: %s (%#x)\n", debug_d3ddecltype(element->Type), element->Type);
TRACE(" Method: %s (%#x)\n", debug_d3ddeclmethod(element->Method), element->Method);
TRACE(" Usage: %s (%#x)\n", debug_d3ddeclusage(element->Usage), element->Usage);
TRACE("Usage index: %d\n", element->UsageIndex);
TRACE(" Register: %d\n", element->Reg);
}
static DWORD IWineD3DVertexDeclarationImpl_ParseToken8(const DWORD* pToken) {
const DWORD token = *pToken;
DWORD tokenlen = 1;
@ -298,6 +308,8 @@ IWineD3DVertexDeclarationImpl *This = (IWineD3DVertexDeclarationImpl *)iface;
convToW[nTokens].Type = type;
convToW[nTokens].Offset = offset;
convToW[nTokens].Reg = reg;
TRACE("Adding element %ld:\n", nTokens);
dump_wined3dvertexelement(&convToW[nTokens]);
offset += glTypeLookup[type].size * glTypeLookup[type].typesize;
++nTokens;
} else if (D3DVSD_TOKEN_STREAMDATA == tokentype && 0x10000000 & tokentype ) {
@ -386,6 +398,8 @@ static HRESULT IWineD3DVertexDeclarationImpl_ParseDeclaration9(IWineD3DVertexDec
for(i = 0; i < This->declaration9NumElements; ++i) {
memcpy(This->pDeclarationWine + i, This->pDeclaration9 + i, sizeof(D3DVERTEXELEMENT9));
This->pDeclarationWine[i].Reg = -1;
TRACE("Adding element %d:\n", i);
dump_wined3dvertexelement(&This->pDeclarationWine[i]);
}
This->declarationWNumElements = This->declaration9NumElements;

View File

@ -1216,6 +1216,8 @@ const char* debug_d3ddevicetype(D3DDEVTYPE devtype);
const char* debug_d3dresourcetype(WINED3DRESOURCETYPE res);
const char* debug_d3dusage(DWORD usage);
const char* debug_d3dusagequery(DWORD usagequery);
const char* debug_d3ddeclmethod(WINED3DDECLMETHOD method);
const char* debug_d3ddecltype(WINED3DDECLTYPE type);
const char* debug_d3ddeclusage(BYTE usage);
const char* debug_d3dprimitivetype(D3DPRIMITIVETYPE PrimitiveType);
const char* debug_d3drenderstate(DWORD state);

View File

@ -893,6 +893,16 @@ typedef struct glDescriptor {
int/*GLenum*/ glType;
} glDescriptor;
typedef enum _WINED3DDECLMETHOD {
WINED3DDECLMETHOD_DEFAULT = 0,
WINED3DDECLMETHOD_PARTIALU = 1,
WINED3DDECLMETHOD_PARTIALV = 2,
WINED3DDECLMETHOD_CROSSUV = 3,
WINED3DDECLMETHOD_UV = 4,
WINED3DDECLMETHOD_LOOKUP = 5,
WINED3DDECLMETHOD_LOOKUPPRESAMPLED = 6
} WINED3DDECLMETHOD;
typedef enum _WINED3DDECLTYPE {
WINED3DDECLTYPE_FLOAT1 = 0,
WINED3DDECLTYPE_FLOAT2 = 1,