wined3d: Add a couple of traces to the vertexdeclaration creation code.
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index fc9edf6..debd8a3 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -269,6 +269,51 @@
}
}
+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 @@
return "unrecognized";
}
}
+
/*****************************************************************************
* Useful functions mapping GL <-> D3D values
*/
diff --git a/dlls/wined3d/vertexdeclaration.c b/dlls/wined3d/vertexdeclaration.c
index 8045745..eeacb31 100644
--- a/dlls/wined3d/vertexdeclaration.c
+++ b/dlls/wined3d/vertexdeclaration.c
@@ -170,6 +170,16 @@
#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 @@
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 @@
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;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 7ef8877..a87439b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1216,6 +1216,8 @@
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);
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index 5538563..a82f094 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -893,6 +893,16 @@
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,