Dolphin, the GameCube and Wii emulator - Forums

Full Version: Failed to compile pixle shader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Trauma Center Wii
details.... using hd6870 vid card i7-920@ 3.3 Ghz. Never seen this error before version 681 dirty... here ya go
//Pixel Shader for TEV stages
//7 TEV stages, 7 texgens, XXX IND stages
sampler samp0 : register(s0), samp1 : register(s1), samp2 : register(s2), samp3 : register(s3), samp4 : register(s4), samp5 : register(s5), samp6 : register(s6), samp7 : register(s7);
Texture2D Tex0 : register(t0), Tex1 : register(t1), Tex2 : register(t2), Tex3 : register(t3), Tex4 : register(t4), Tex5 : register(t5), Tex6 : register(t6), Tex7 : register(t7);

uniform float4 color[4] : register(c0);
uniform float4 k[4] : register(c4);
uniform float4 alphaRef[1] : register(c8);
uniform float4 texdim[8] : register(c9);
uniform float4 czbias[2] : register(c17);
uniform float4 cindscale[2] : register(c19);
uniform float4 cindmtx[6] : register(c21);
uniform float4 cfog[3] : register(c27);
typedef struct { float4 col; float4 cosatt; float4 distatt; float4 pos; float4 dir; } Light;
typedef struct { Light lights[8]; } s_cLights;
uniform s_cLights cLights : register(c30);
typedef struct { float4 C0, C1, C2, C3; } s_cmtrl;
uniform s_cmtrl cmtrl : register(c70);
void main(
out float4 ocol0 : SV_Target0,
out float depth : SV_Depth,
in float4 rawpos : SV_Position,
in float4 colors_0 : COLOR0,
in float4 colors_1 : COLOR1,
in float4 uv0 : TEXCOORD0,
in float4 uv1 : TEXCOORD1,
in float4 uv2 : TEXCOORD2,
in float4 uv3 : TEXCOORD3,
in float4 uv4 : TEXCOORD4,
in float4 uv5 : TEXCOORD5,
in float4 uv6 : TEXCOORD6 ) {
float zCoord = czbias[1].x + (uv2.w / uv3.w) * czbias[1].y;
float4 c0 = color[1], c1 = color[2], c2 = color[3], prev = float4(0.0f, 0.0f, 0.0f, 0.0f), textemp = float4(0.0f, 0.0f, 0.0f, 0.0f), rastemp = float4(0.0f, 0.0f, 0.0f, 0.0f), konsttemp = float4(0.0f, 0.0f, 0.0f, 0.0f);
float3 comp16 = float3(1.0f, 255.0f, 0.0f), comp24 = float3(1.0f, 255.0f, 255.0f*255.0f);
float4 alphabump=float4(0.0f,0.0f,0.0f,0.0f);
float3 tevcoord=float3(0.0f, 0.0f, 0.0f);
float2 wrappedcoord=float2(0.0f,0.0f), tempcoord=float2(0.0f,0.0f);
float4 cc0=float4(0.0f,0.0f,0.0f,0.0f), cc1=float4(0.0f,0.0f,0.0f,0.0f);
float4 cc2=float4(0.0f,0.0f,0.0f,0.0f), cprev=float4(0.0f,0.0f,0.0f,0.0f);
float4 crastemp=float4(0.0f,0.0f,0.0f,0.0f),ckonsttemp=float4(0.0f,0.0f,0.0f,0.0f);

float3 _norm0 = normalize(float3(uv4.w,uv5.w,uv6.w));

float3 pos = float3(uv0.w,uv1.w,uv7.w);
float4 mat, lacc;
float3 ldir, h;
float dist, dist2, attn;
{
mat = cmtrl.C2;
lacc = cmtrl.C0;
lacc.w = 1.0f;
ldir = cLights.lights[0].pos.xyz - pos.xyz;
dist2 = dot(ldir, ldir);
dist = sqrt(dist2);
ldir = ldir / dist;
attn = max(0.0f, dot(ldir, cLights.lights[0].dir.xyz));
attn = max(0.0f, dot(cLights.lights[0].cosatt.xyz, float3(1.0f, attn, attn*attn))) / dot(cLights.lights[0].distatt.xyz, float3(1.0f,dist,dist2));
lacc.xyz += attn * max(0.0f,dot(ldir, _norm0)) * cLights.lights[0].col.xyz;

ldir = cLights.lights[1].pos.xyz - pos.xyz;
dist2 = dot(ldir, ldir);
dist = sqrt(dist2);
ldir = ldir / dist;
attn = max(0.0f, dot(ldir, cLights.lights[1].dir.xyz));
attn = max(0.0f, dot(cLights.lights[1].cosatt.xyz, float3(1.0f, attn, attn*attn))) / dot(cLights.lights[1].distatt.xyz, float3(1.0f,dist,dist2));
lacc.xyz += attn * max(0.0f,dot(ldir, _norm0)) * cLights.lights[1].col.xyz;

colors_0 = mat * saturate(lacc);
}
float4 clipPos = float4(rawpos.x, rawpos.y, uv2.w, uv3.w);
uv0.xy = uv0.xy * texdim[0].zw;
uv1.xy = uv1.xy * texdim[1].zw;
uv2.xy = uv2.xy * texdim[2].zw;
uv3.xy = uv3.xy * texdim[3].zw;
uv4.xy = uv4.xy * texdim[4].zw;
if (uv5.z) uv5.xy = uv5.xy / uv5.z;
uv5.xy = uv5.xy * texdim[5].zw;
if (uv6.z) uv6.xy = uv6.xy / uv6.z;
uv6.xy = uv6.xy * texdim[6].zw;
tempcoord = uv0.xy * cindscale[0].xy;
float3 indtex0=Tex0.Sample(samp0,tempcoord.xy * texdim[0].xy).abg;
// TEV stage 0
tevcoord.xy = uv1.xy;
textemp=Tex1.Sample(samp1,tevcoord.xy * texdim[1].xy).rgba;
konsttemp = float4(k[3].aaa, k[3].a);
ckonsttemp = frac(konsttemp * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate(0.5f*((textemp.rgb)+float3(0.0f, 0.0f, 0.0f)));
// alpha combine
prev.a = saturate(float4(0.0f, 0.0f, 0.0f, 0.0f).a);

// TEV done
// TEV stage 1
tevcoord.xy = uv0.xy;
textemp=Tex0.Sample(samp0,tevcoord.xy * texdim[0].xy).rgba;
konsttemp = float4(k[3].bbb, k[3].b);
ckonsttemp = frac(konsttemp * (255.0f/256.0f)) * (256.0f/255.0f);
cprev = frac(prev * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate(0.5f*((prev.rgb)+(textemp.rgb)));
// alpha combine
prev.a = saturate(prev.a+float4(0.0f, 0.0f, 0.0f, 0.0f).a);

// TEV done
// TEV stage 2
tevcoord.xy = uv2.xy;
textemp=Tex2.Sample(samp2,tevcoord.xy * texdim[2].xy).rgba;
// color combine
prev.rgb = saturate((prev.rgb)+(textemp.rgb)*float3(0.5f, 0.5f, 0.5f));
// alpha combine
prev.a = saturate(prev.a+float4(0.0f, 0.0f, 0.0f, 0.0f).a);

// TEV done
// TEV stage 3
// indirect op
float3 indtevcrd3 = indtex0 * 255.0f;
indtevcrd3.xyz += -128.0f;
float2 indtevtrans3 = float2(dot(cindmtx[0].xyz, indtevcrd3), dot(cindmtx[1].xyz, indtevcrd3));
wrappedcoord.x = uv3.x;
wrappedcoord.y = uv3.y;
tevcoord.xy = wrappedcoord + indtevtrans3;
textemp=Tex3.Sample(samp3,tevcoord.xy * texdim[3].xy).rgba;
konsttemp = float4(k[3].rrr, k[3].r);
ckonsttemp = frac(konsttemp * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate((prev.rgb)+(textemp.rgb)*float3(0.5f, 0.5f, 0.5f)-0.5f);
// alpha combine
prev.a = saturate(prev.a+float4(0.0f, 0.0f, 0.0f, 0.0f).a);

// TEV done
// TEV stage 4
tevcoord.xy = uv5.xy;
textemp=Tex5.Sample(samp5,tevcoord.xy * texdim[5].xy).rgba;
konsttemp = float4(k[2].aaa, k[2].a);
ckonsttemp = frac(konsttemp * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate((prev.rgb)+(textemp.aaa)*float3(0.5f, 0.5f, 0.5f));
// alpha combine
prev.a = saturate(prev.a+textemp.a*ckonsttemp.a);

// TEV done
// TEV stage 5
tevcoord.xy = uv6.xy;
textemp=Tex6.Sample(samp6,tevcoord.xy * texdim[6].xy).rgba;
konsttemp = float4(k[2].bbb, k[2].b);
ckonsttemp = frac(konsttemp * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate((prev.rgb)+(textemp.aaa)*float3(0.5f, 0.5f, 0.5f));
// alpha combine
prev.a = saturate(prev.a+textemp.a*ckonsttemp.a);

// TEV done
// TEV stage 6
rastemp = colors_0.rgba;
crastemp = frac(rastemp * (255.0f/256.0f)) * (256.0f/255.0f);
textemp = float4(1.0f, 1.0f, 1.0f, 1.0f);
cprev = frac(prev * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
prev.rgb = saturate(4.0f*((cprev.rgb)*(crastemp.rgb)));
// alpha combine
prev.a = saturate(cprev.a*crastemp.a);

// TEV done
prev.rgb = prev.rgb;
prev.a = prev.a;
prev = frac(4.0f + prev * (255.0f/256.0f)) * (256.0f/255.0f);
depth = zCoord;
float ze = cfog[1].x / (cfog[1].y - (zCoord / cfog[1].w));
float x_adjust = (2.0f * (clipPos.x / cfog[2].y)) - 1.0f - cfog[2].x;
x_adjust = sqrt(x_adjust * x_adjust + cfog[2].z * cfog[2].z) / cfog[2].z;
ze *= x_adjust;
float fog = saturate(ze - cfog[1].z);
prev.rgb = lerp(prev.rgb,cfog[0].rgb,fog);
ocol0 = prev;
}
Err... Did you update your driver?
(05-29-2012, 01:13 AM)DefenderX Wrote: [ -> ]Err... Did you update your driver?

He said it use to work, my guess is that this is a regression.
I always keep all my drivers up to date. I'm like that. I like to keep everything up to date so i'm always updating to the newest version of dolphin. This sucks though because I can't finish trauma center for the Wii. On the level where you have to operate on the cat this error pops up. I turned off the error messages to see if I could continue but it wasn't displaying some textures which made it very hard.
I always keep everything up to date.
I've confirmed this error does not happen in version 3.0. Please make this known to the moderators.
Try using some rev before 146b02615c07. Also, read the error message again if that doesn't help.
(05-29-2012, 02:57 AM)neobrain Wrote: [ -> ]Try using some rev before 146b02615c07. Also, read the error message again if that doesn't help.

Yes, it works fine in revision 3. I hate to use the older version though... Oh well, at least I can finish my game. In the meantime someone should work on keeping old stuff working in the new releases ^_-
146b02615c07 is just a few days old... you don't need to use 3.0 to be "older" than that.