wined3d: Trace corrections/improvements.

This commit is contained in:
Ivan Gyurdiev 2006-04-19 23:53:48 -04:00 committed by Alexandre Julliard
parent d2f59fe455
commit 63ef9788dd
2 changed files with 73 additions and 22 deletions

View File

@ -1591,8 +1591,8 @@ inline static void pshader_program_dump_ins_modifiers(const DWORD output) {
case 14: TRACE("_d4"); break;
case 15: TRACE("_d2"); break;
case 1: TRACE("_x2"); break;
case 3: TRACE("_x4"); break;
case 7: TRACE("_x8"); break;
case 2: TRACE("_x4"); break;
case 3: TRACE("_x8"); break;
default: TRACE("_unhandled_shift(%ld)", shift); break;
}
@ -1628,7 +1628,7 @@ inline static void pshader_program_dump_ps_param(const DWORD param, int input) {
TRACE("1-");
}
switch (regtype /* << D3DSP_REGTYPE_SHIFT (I don't know why this was here)*/) {
switch (regtype) {
case D3DSPR_TEMP:
TRACE("r%lu", reg);
break;
@ -1663,7 +1663,11 @@ inline static void pshader_program_dump_ps_param(const DWORD param, int input) {
case D3DSPR_LOOP:
TRACE("aL%s%lu", (param & D3DVS_ADDRMODE_RELATIVE) ? "a0.x + " : "", reg);
break;
case D3DSPR_SAMPLER:
TRACE("s%lu", reg);
break;
default:
TRACE("unhandled_rtype(%lx)", regtype);
break;
}
@ -1725,11 +1729,32 @@ inline static void pshader_program_dump_ps_param(const DWORD param, int input) {
}
}
inline static void pshader_program_dump_decl_usage(IWineD3DPixelShaderImpl *This, DWORD token) {
inline static void pshader_program_dump_decl_usage(
IWineD3DPixelShaderImpl *This, DWORD decl, DWORD param) {
DWORD regtype = ((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT) |
((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2);
TRACE("dcl_");
switch(token & 0xFFFF) {
if (regtype == D3DSPR_SAMPLER) {
DWORD ttype = decl & D3DSP_TEXTURETYPE_MASK;
switch (ttype) {
case D3DSTT_2D: TRACE("2d "); break;
case D3DSTT_CUBE: TRACE("cube "); break;
case D3DSTT_VOLUME: TRACE("volume "); break;
default: TRACE("unknown_ttype(%08lx) ", ttype);
}
} else {
DWORD usage = decl & D3DSP_DCL_USAGE_MASK;
DWORD idx = (decl & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
switch(usage) {
case D3DDECLUSAGE_POSITION:
TRACE("%s%ld ", "position",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "position", idx);
break;
case D3DDECLUSAGE_BLENDINDICES:
TRACE("%s ", "blend");
@ -1738,20 +1763,20 @@ inline static void pshader_program_dump_decl_usage(IWineD3DPixelShaderImpl *This
TRACE("%s ", "weight");
break;
case D3DDECLUSAGE_NORMAL:
TRACE("%s%ld ", "normal",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "normal", idx);
break;
case D3DDECLUSAGE_PSIZE:
TRACE("%s ", "psize");
break;
case D3DDECLUSAGE_COLOR:
if((token & 0xF0000) >> 16 == 0) {
if(idx == 0) {
TRACE("%s ", "color");
} else {
TRACE("%s%ld ", "specular", ((token & 0xF0000) >> 16) - 1);
TRACE("%s%ld ", "specular", (idx - 1));
}
break;
case D3DDECLUSAGE_TEXCOORD:
TRACE("%s%ld ", "texture", (token & 0xF0000) >> 16);
TRACE("%s%ld ", "texture", idx);
break;
case D3DDECLUSAGE_TANGENT:
TRACE("%s ", "tangent");
@ -1763,7 +1788,7 @@ inline static void pshader_program_dump_decl_usage(IWineD3DPixelShaderImpl *This
TRACE("%s ", "tessfactor");
break;
case D3DDECLUSAGE_POSITIONT:
TRACE("%s%ld ", "positionT",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "positionT", idx);
break;
case D3DDECLUSAGE_FOG:
TRACE("%s ", "fog");
@ -1775,7 +1800,8 @@ inline static void pshader_program_dump_decl_usage(IWineD3DPixelShaderImpl *This
TRACE("%s ", "sample");
break;
default:
FIXME("Unrecognised dcl %08lx", token & 0xFFFF);
FIXME("Unrecognised dcl %08lx", usage);
}
}
}
@ -1824,7 +1850,7 @@ HRESULT WINAPI IWineD3DPixelShaderImpl_SetFunction(IWineD3DPixelShader *iface, C
} else {
if (curOpcode->opcode == D3DSIO_DCL) {
pshader_program_dump_decl_usage(This, *pToken);
pshader_program_dump_decl_usage(This, *pToken, *(pToken + 1));
++pToken;
++len;
pshader_program_dump_ps_param(*pToken, 0);

View File

@ -830,6 +830,9 @@ inline static void vshader_program_dump_vs_param(const DWORD param, int input) {
case D3DSPR_LOOP:
TRACE("aL%s%lu", (param & D3DVS_ADDRMODE_RELATIVE) ? "a0.x + " : "", reg);
break;
case D3DSPR_SAMPLER:
TRACE("s%lu", reg);
break;
default:
FIXME("Unknown %lu reg %lu\n",regtype, reg);
break;
@ -870,11 +873,32 @@ inline static void vshader_program_dump_vs_param(const DWORD param, int input) {
}
}
inline static void vshader_program_dump_decl_usage(IWineD3DVertexShaderImpl *This, DWORD token) {
inline static void vshader_program_dump_decl_usage(
IWineD3DVertexShaderImpl *This, DWORD decl, DWORD param) {
DWORD regtype = ((param & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT) |
((param & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2);
TRACE("dcl_");
switch(token & 0xFFFF) {
if (regtype == D3DSPR_SAMPLER) {
DWORD ttype = decl & D3DSP_TEXTURETYPE_MASK;
switch (ttype) {
case D3DSTT_2D: TRACE("2d "); break;
case D3DSTT_CUBE: TRACE("cube "); break;
case D3DSTT_VOLUME: TRACE("volume "); break;
default: TRACE("unknown_ttype(%08lx) ", ttype);
}
} else {
DWORD usage = decl & D3DSP_DCL_USAGE_MASK;
DWORD idx = (decl & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT;
switch(usage) {
case D3DDECLUSAGE_POSITION:
TRACE("%s%ld ", "position",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "position", idx);
break;
case D3DDECLUSAGE_BLENDINDICES:
TRACE("%s ", "blend");
@ -883,20 +907,20 @@ inline static void vshader_program_dump_decl_usage(IWineD3DVertexShaderImpl *Thi
TRACE("%s ", "weight");
break;
case D3DDECLUSAGE_NORMAL:
TRACE("%s%ld ", "normal",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "normal", idx);
break;
case D3DDECLUSAGE_PSIZE:
TRACE("%s ", "psize");
break;
case D3DDECLUSAGE_COLOR:
if((token & 0xF0000) >> 16 == 0) {
if(idx == 0) {
TRACE("%s ", "color");
} else {
TRACE("%s ", "specular");
}
break;
case D3DDECLUSAGE_TEXCOORD:
TRACE("%s%ld ", "texture", (token & 0xF0000) >> 16);
TRACE("%s%ld ", "texture", idx);
break;
case D3DDECLUSAGE_TANGENT:
TRACE("%s ", "tangent");
@ -908,7 +932,7 @@ inline static void vshader_program_dump_decl_usage(IWineD3DVertexShaderImpl *Thi
TRACE("%s ", "tessfactor");
break;
case D3DDECLUSAGE_POSITIONT:
TRACE("%s%ld ", "positionT",(token & 0xF0000) >> 16);
TRACE("%s%ld ", "positionT", idx);
break;
case D3DDECLUSAGE_FOG:
TRACE("%s ", "fog");
@ -920,7 +944,8 @@ inline static void vshader_program_dump_decl_usage(IWineD3DVertexShaderImpl *Thi
TRACE("%s ", "sample");
break;
default:
FIXME("Unrecognised dcl %08lx", token & 0xFFFF);
FIXME("Unrecognised dcl %08lx", usage);
}
}
}
@ -2157,7 +2182,7 @@ HRESULT WINAPI IWineD3DVertexShaderImpl_SetFunction(IWineD3DVertexShader *iface,
} else {
if (curOpcode->opcode == D3DSIO_DCL) {
vshader_program_dump_decl_usage(This, *pToken);
vshader_program_dump_decl_usage(This, *pToken, *(pToken + 1));
++pToken;
++len;
vshader_program_dump_vs_param(*pToken, 0);