Dolphin, the GameCube and Wii emulator - Forums

Full Version: "Failed to compile vertex shader!"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I'm playing Super Mario Sunshine, I jump into the warp gate to Gelato Beach, I select episode 7, the screen is white for about 10 seconds, and it gives me the error "Failed to compile vertex shader!" I press ok, and then "Dolphin.exe has stopped working". It tells me it happens with outdated GPUs and integrated GPUs, but..

Intel Core i3-2100 3.10 GHz
AMD Radeon HD 6570 2GB
4GB RAM
Windows 7 Professional x64

Here is the bad_vs_0000.txt the error message told me to refer to:

Code:
//Vertex Shader: comp:400,
typedef struct { float4 T0, T1, T2; float4 N0, N1, N2; } s_cpnmtx;
typedef struct { float4 t; } FLT4;
typedef struct { FLT4 T[24]; } s_ctexmtx;
typedef struct { FLT4 T[64]; } s_ctrmtx;
typedef struct { FLT4 T[32]; } s_cnmtx;
typedef struct { FLT4 T[64]; } s_cpostmtx;
typedef struct { float4 col; float4 cosatt; float4 distatt; float4 pos; float4 dir; } Light;
typedef struct { Light lights[8]; } s_clights;
typedef struct { float4 C0, C1, C2, C3; } s_cmtrl;
typedef struct { float4 T0, T1, T2, T3; } s_cproj;
struct VS_OUTPUT {
float4 pos : POSITION;
float4 colors_0 : COLOR0;
float4 colors_1 : COLOR1;
float4 tex0 : TEXCOORD0;
float4 tex1 : TEXCOORD1;
float4 tex2 : TEXCOORD2;
float4 tex3 : TEXCOORD3;
float3 tex4 : TEXCOORD4;
float3 tex5 : TEXCOORD5;
float3 tex6 : TEXCOORD6;
float3 tex7 : TEXCOORD7;
float3 tex8 : TEXCOORD8;
float3 tex9 : TEXCOORD9;
float3 tex10 : TEXCOORD10;
float3 tex11 : TEXCOORD11;
float3 tex12 : TEXCOORD12;
float3 tex13 : TEXCOORD13;
float3 tex14 : TEXCOORD14;
};
uniform s_ctrmtx ctrmtx : register(c78);
uniform s_ctexmtx ctexmtx : register(c54);
uniform s_cnmtx cnmtx : register(c142);
uniform s_cpnmtx cpnmtx : register(c0);
uniform s_cpostmtx cpostmtx : register(c174);
uniform s_clights clights : register(c14);
uniform s_cmtrl cmtrl : register(c10);
uniform s_cproj cproj : register(c6);
uniform float4 cDepth : register(c238);
VS_OUTPUT main(
float3 rawnorm0 : NORMAL0,
float4 rawpos : POSITION) {
VS_OUTPUT o;
float4 pos = float4(dot(cpnmtx.T0, rawpos), dot(cpnmtx.T1, rawpos), dot(cpnmtx.T2, rawpos), 1.0f);
float3 _norm0 = normalize(float3(dot(cpnmtx.N0.xyz, rawnorm0), dot(cpnmtx.N1.xyz, rawnorm0), dot(cpnmtx.N2.xyz, rawnorm0)));
o.pos = float4(dot(cproj.T0, pos), dot(cproj.T1, pos), dot(cproj.T2, pos), dot(cproj.T3, pos));
float4 mat, lacc;
float3 ldir, h;
float dist, dist2, attn;
{
mat = float4(1.0f, 1.0f, 1.0f, 1.0f);
lacc = float4(1.0f, 1.0f, 1.0f, 1.0f);
lacc.w = 1.0f;
o.colors_0 = mat * saturate(lacc);
}
{
mat = cmtrl.C3;
lacc = cmtrl.C1;
lacc.w = 1.0f;
o.colors_1 = mat * saturate(lacc);
}
float4 coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex0.xyz = float3(dot(coord, ctexmtx.T[0].t), dot(coord, ctexmtx.T[1].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex0.xyz = float3(dot(P0.xyz, o.tex0.xyz) + P0.w, dot(P1.xyz, o.tex0.xyz) + P1.w, dot(P2.xyz, o.tex0.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex1.xyz = float3(o.colors_0.x, o.colors_0.y, 1);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex2.xyz = float3(dot(coord, ctexmtx.T[6].t), dot(coord, ctexmtx.T[7].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex2.xyz = float3(dot(P0.xyz, o.tex2.xyz) + P0.w, dot(P1.xyz, o.tex2.xyz) + P1.w, dot(P2.xyz, o.tex2.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex3.xyz = float3(dot(coord, ctexmtx.T[9].t), dot(coord, ctexmtx.T[10].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex3.xyz = float3(dot(P0.xyz, o.tex3.xyz) + P0.w, dot(P1.xyz, o.tex3.xyz) + P1.w, dot(P2.xyz, o.tex3.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex4.xyz = float3(dot(coord, ctexmtx.T[12].t), dot(coord, ctexmtx.T[13].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex4.xyz = float3(dot(P0.xyz, o.tex4.xyz) + P0.w, dot(P1.xyz, o.tex4.xyz) + P1.w, dot(P2.xyz, o.tex4.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex5.xyz = float3(dot(coord, ctexmtx.T[15].t), dot(coord, ctexmtx.T[16].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex5.xyz = float3(dot(P0.xyz, o.tex5.xyz) + P0.w, dot(P1.xyz, o.tex5.xyz) + P1.w, dot(P2.xyz, o.tex5.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex6.xyz = float3(dot(coord, ctexmtx.T[18].t), dot(coord, ctexmtx.T[19].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex6.xyz = float3(dot(P0.xyz, o.tex6.xyz) + P0.w, dot(P1.xyz, o.tex6.xyz) + P1.w, dot(P2.xyz, o.tex6.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
o.tex7.xyz = float3(dot(coord, ctexmtx.T[21].t), dot(coord, ctexmtx.T[22].t), 1);
float4 P0 = cpostmtx.T[61].t;
float4 P1 = cpostmtx.T[62].t;
float4 P2 = cpostmtx.T[63].t;
o.tex7.xyz = float3(dot(P0.xyz, o.tex7.xyz) + P0.w, dot(P1.xyz, o.tex7.xyz) + P1.w, dot(P2.xyz, o.tex7.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex8.xyz = float3(dot(coord, ctrmtx.T[tex8.z].t), dot(coord, ctrmtx.T[tex8.z+1].t), 1);
float4 P0 = cpostmtx.T[5].t;
float4 P1 = cpostmtx.T[6].t;
float4 P2 = cpostmtx.T[7].t;
o.tex8.xyz = float3(dot(P0.xyz, o.tex8.xyz) + P0.w, dot(P1.xyz, o.tex8.xyz) + P1.w, dot(P2.xyz, o.tex8.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex9.xyz = float3(dot(coord, ctexmtx.T[27].t), dot(coord, ctexmtx.T[28].t), 1);
float4 P0 = cpostmtx.T[0].t;
float4 P1 = cpostmtx.T[1].t;
float4 P2 = cpostmtx.T[2].t;
o.tex9.xyz = float3(dot(P0.xyz, o.tex9.xyz) + P0.w, dot(P1.xyz, o.tex9.xyz) + P1.w, dot(P2.xyz, o.tex9.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex10.xyz = float3(dot(coord, ctexmtx.T[30].t), dot(coord, ctexmtx.T[31].t), 1);
float4 P0 = cpostmtx.T[0].t;
float4 P1 = cpostmtx.T[1].t;
float4 P2 = cpostmtx.T[2].t;
o.tex10.xyz = float3(dot(P0.xyz, o.tex10.xyz) + P0.w, dot(P1.xyz, o.tex10.xyz) + P1.w, dot(P2.xyz, o.tex10.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex11.xyz = float3(dot(coord, ctexmtx.T[33].t), dot(coord, ctexmtx.T[34].t), 1);
float4 P0 = cpostmtx.T[0].t;
float4 P1 = cpostmtx.T[1].t;
float4 P2 = cpostmtx.T[2].t;
o.tex11.xyz = float3(dot(P0.xyz, o.tex11.xyz) + P0.w, dot(P1.xyz, o.tex11.xyz) + P1.w, dot(P2.xyz, o.tex11.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex12.xyz = float3(dot(coord, ctexmtx.T[36].t), dot(coord, ctexmtx.T[37].t), 1);
float4 P0 = cpostmtx.T[3].t;
float4 P1 = cpostmtx.T[4].t;
float4 P2 = cpostmtx.T[5].t;
o.tex12.xyz = float3(dot(P0.xyz, o.tex12.xyz) + P0.w, dot(P1.xyz, o.tex12.xyz) + P1.w, dot(P2.xyz, o.tex12.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex13.xyz = float3(dot(coord, ctexmtx.T[39].t), dot(coord, ctexmtx.T[40].t), 1);
float4 P0 = cpostmtx.T[7].t;
float4 P1 = cpostmtx.T[8].t;
float4 P2 = cpostmtx.T[9].t;
o.tex13.xyz = float3(dot(P0.xyz, o.tex13.xyz) + P0.w, dot(P1.xyz, o.tex13.xyz) + P1.w, dot(P2.xyz, o.tex13.xyz) + P2.w);
}
{
coord = float4(0.0f, 0.0f, 1.0f, 1.0f);
coord = rawpos;
o.tex14.xyz = float3(dot(coord, ctexmtx.T[42].t), dot(coord, ctexmtx.T[43].t), 1);
float4 P0 = cpostmtx.T[11].t;
float4 P1 = cpostmtx.T[12].t;
float4 P2 = cpostmtx.T[13].t;
o.tex14.xyz = float3(dot(P0.xyz, o.tex14.xyz) + P0.w, dot(P1.xyz, o.tex14.xyz) + P1.w, dot(P2.xyz, o.tex14.xyz) + P2.w);
}
o.tex0.w = pos.x;
o.tex1.w = pos.y;
o.tex2.w = o.pos.z;
o.tex3.w = o.pos.w;
o.pos.z = cDepth.x * o.pos.w + o.pos.z * cDepth.y;
return o;
}
The error message also told you to post the error message itself.

Btw, are you sure that your GPU drivers actually use the AMD GPU, and not the Intel one? Your profile makes it sound as if you were using one of these hybrid GPU setups.
(12-25-2012, 03:27 AM)neobrain Wrote: [ -> ]The error message also told you to post the error message itself.

Btw, are you sure that your GPU drivers actually use the AMD GPU, and not the Intel one? Your profile makes it sound as if you were using one of these hybrid GPU setups.
"Failed to compile vertex shader!
This usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.

If you're sure this is Dolphin's error anyway, post the contents of ./User/Dump/bad_vs_0000.txt along with this error message at the forums.

Debug info (vs_5_0):
(127,41): error X3004: undeclared identifier 'tex8' "

^that's the exact message

And I'm sure I'm setup with the AMD GPU, I checked and it doesn't show any "Intel HD graphics " or anything like that in Device Manager, just the AMD GPU.
Thanks, that was an actual bug in our shader generator. I'll be pushing a fix within the next few hours. The fix will be included in the Dolphin 3.5 release.

EDIT: Screw that, I'm dumb. Still, this looks like a valid issue. Will look into it post-release.
I have not been able to reproduce your issue. Could you post your settings and more detailed information of your problem, possibly a video showing where it shows the error specifically?
(12-25-2012, 07:45 AM)neobrain Wrote: [ -> ]I have not been able to reproduce your issue. Could you post your settings and more detailed information of your problem, possibly a video showing where it shows the error specifically?
Sure, I'll try to get a video.
EDIT: Oh my goodness, I feel so dumb. Without realizing, I had enabled an Action Replay cheat, which stopped me from entering the level. So Apparently the problem is cheat related. Why the game crashes is still beyond me, though. I at least know how to get around the error now, but I still don't know what's up with the crashing.I had a 99 lives cheat, but I don't know how that would cause a problem like this.
Heh okay, at least we know it's not an actual emulation bug then Smile
so what did your "fix" do then? XD
break stuff, I guess.