So, this is weird. This is my second time playing through Metroid Prime on MPT, and this didn't happen last time, but it is happening now:
It does it continuously. If I hold down the Enter key, I can turn around and face the door, which makes it stop trying to render whatever is causing the error. I have no idea what's causing it, either, because it pops up seemingly at random. (By that I mean, if I go to certain places in the room and look in certain directions, the error pops up reliably, but the different places have no common meeting point- they all seem to be in random directions.)
Also, this only happens with the D3D backends. OGL has no problem.
I really wish this forum had a spoiler tag, but anyway, this is the contents of bad_ps_xxxx.txt (It made over 400 of them, all with different numbers, but the same content, by the time I was able to turn around.)
Code:
//Pixel Shader for TEV stages
//1 TEV stages, 11 texgens, XXX IND stages
uniform sampler2D samp0 : register(s0), samp1 : register(s1), samp2 : register(s2), samp3 : register(s3), samp4 : register(s4), samp5 : register(s5), samp6 : register(s6), samp7 : register(s7);
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);
void main(
out float4 ocol0 : COLOR0,
out float depth : DEPTH,
in float4 rawpos : WPOS,
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 float3 uv4 : TEXCOORD4,
in float3 uv5 : TEXCOORD5,
in float3 uv6 : TEXCOORD6,
in float3 uv7 : TEXCOORD7,
in float3 uv8 : TEXCOORD8,
in float3 uv9 : TEXCOORD9,
in float3 uv10 : TEXCOORD10 ) {
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);
float4 clipPos = float4(rawpos.x, rawpos.y, uv2.w, uv3.w);
if (uv0.z) uv0.xy = uv0.xy / uv0.z;
uv0.xy = uv0.xy * texdim[0].zw;
if (uv1.z) uv1.xy = uv1.xy / uv1.z;
uv1.xy = uv1.xy * texdim[1].zw;
if (uv2.z) uv2.xy = uv2.xy / uv2.z;
uv2.xy = uv2.xy * texdim[2].zw;
if (uv3.z) uv3.xy = uv3.xy / uv3.z;
uv3.xy = uv3.xy * texdim[3].zw;
if (uv4.z) uv4.xy = uv4.xy / uv4.z;
uv4.xy = uv4.xy * texdim[4].zw;
uv5.xy = uv5.xy * texdim[5].zw;
uv6.xy = uv6.xy * texdim[6].zw;
uv7.xy = uv7.xy * texdim[7].zw;
uv8.xy = uv8.xy * texdim[8].zw;
uv9.xy = uv9.xy * texdim[9].zw;
uv10.xy = uv10.xy * texdim[10].zw;
// TEV stage 0
rastemp = colors_0.rgba;
crastemp = frac(rastemp * (255.0f/256.0f)) * (256.0f/255.0f);
tevcoord.xy = uv0.xy;
textemp=tex2D(samp0,tevcoord.xy * texdim[0].xy).rgba;
konsttemp = float4(1.0f,1.0f,1.0f, 1.0f);
ckonsttemp = konsttemp;
cc1 = frac(c1 * (255.0f/256.0f)) * (256.0f/255.0f);
// color combine
c0.rgb = saturate((rastemp.rgb)+(cc1.rgb)*(textemp.rgb));
// alpha combine
c0.a = saturate(konsttemp.a+float4(0.0f, 0.0f, 0.0f, 0.0f).a);
// TEV done
prev.rgb = c0.rgb;
prev.a = c0.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 fog = saturate(ze - cfog[1].z);
prev.rgb = lerp(prev.rgb,cfog[0].rgb,fog);
ocol0 = prev;
}