Dolphin, the GameCube and Wii emulator - Forums

Full Version: Failed to compile pixel/vertex shaders!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

kjedmunds

Hi all!

Brand new to dolphin and this forum, but I hope I'm in the right place!

I'm trying to run Twilight Princess (Wii-NTSC) using an Intel HD 4000 GPU (fried my Nvidia card a while ago, for shame...), and I'm getting the following error:

Failed to compile pixel/vertex shaders!

Attached are screeshots of both errors in full, and the following is copied from my bad_vs_0000.txt and bad_ps_0001.txt files:

Bad_vs_0000.txt:
Code:
#version 150


#define SAMPLER_BINDING(x)







#define float2 vec2
#define float3 vec3
#define float4 vec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix


struct Light {
int4 color;
float4 cosatt;
float4 distatt;
float4 pos;
float4 dir;
};
layout(std140) uniform VSBlock {
float4 cpnmtx[6];
float4 cproj[4];
int4 cmtrl[4];
Light clights[8];
float4 ctexmtx[24];
float4 ctrmtx[64];
float4 cnmtx[32];
float4 cpostmtx[64];
float4 cpixelcenter;
};
struct VS_OUTPUT {
float4 pos;
float4 colors_0;
float4 colors_1;
float3 tex0;
float4 clipPos;
};
in float4 rawpos; // ATTR0,
in float2 tex0; // ATTR8,
out VertexData {
centroid out float4 pos;
centroid out float4 colors_0;
centroid out float4 colors_1;
centroid out float3 tex0;
centroid out float4 clipPos;
} vs;
void main()
{
VS_OUTPUT o;
float4 pos = float4(dot(cpnmtx[0], rawpos), dot(cpnmtx[1], rawpos), dot(cpnmtx[2], rawpos), 1.0);
float3 _norm0 = float3(0.0, 0.0, 0.0);
o.pos = float4(dot(cproj[0], pos), dot(cproj[1], pos), dot(cproj[2], pos), dot(cproj[3], pos));
int4 lacc;
float3 ldir, h, cosAttn, distAttn;
float dist, dist2, attn;
o.colors_0 = float4(1.0, 1.0, 1.0, 1.0);
o.colors_1 = o.colors_0;
float4 coord = float4(0.0, 0.0, 1.0, 1.0);
{
coord = float4(0.0, 0.0, 1.0, 1.0);
coord = float4(tex0.x, tex0.y, 1.0, 1.0);
o.tex0.xyz = float3(dot(coord, ctexmtx[0]), dot(coord, ctexmtx[1]), 1);
float4 P0 = cpostmtx[61];
float4 P1 = cpostmtx[62];
float4 P2 = cpostmtx[63];
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);
}
o.clipPos = o.pos;
o.pos.z = o.pos.w + o.pos.z * 2.0;
o.pos.xy = o.pos.xy - o.pos.w * cpixelcenter.xy;
vs.pos = o.pos;
vs.colors_0 = o.colors_0;
vs.colors_1 = o.colors_1;
vs.tex0 = o.tex0;
vs.clipPos = o.clipPos;
gl_Position = o.pos;
}
ERROR: 1:29: 'centroid' : syntax error syntax error


And Bad_ps_0001.txt:
#version 150





#define SAMPLER_BINDING(x)







#define float2 vec2
#define float3 vec3
#define float4 vec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix


//Pixel Shader for TEV stages
//1 TEV stages, 1 texgens, 16385 IND stages
int idot(int3 x, int3 y)
{
int3 tmp = x * y;
return tmp.x + tmp.y + tmp.z;
}
int idot(int4 x, int4 y)
{
int4 tmp = x * y;
return tmp.x + tmp.y + tmp.z + tmp.w;
}

int  iround(float  x) { return int (round(x)); }
int2 iround(float2 x) { return int2(round(x)); }
int3 iround(float3 x) { return int3(round(x)); }
int4 iround(float4 x) { return int4(round(x)); }

int  itrunc(float  x) { return int (trunc(x)); }
int2 itrunc(float2 x) { return int2(trunc(x)); }
int3 itrunc(float3 x) { return int3(trunc(x)); }
int4 itrunc(float4 x) { return int4(trunc(x)); }

SAMPLER_BINDING(0) uniform sampler2DArray samp0;
SAMPLER_BINDING(1) uniform sampler2DArray samp1;
SAMPLER_BINDING(2) uniform sampler2DArray samp2;
SAMPLER_BINDING(3) uniform sampler2DArray samp3;
SAMPLER_BINDING(4) uniform sampler2DArray samp4;
SAMPLER_BINDING(5) uniform sampler2DArray samp5;
SAMPLER_BINDING(6) uniform sampler2DArray samp6;
SAMPLER_BINDING(7) uniform sampler2DArray samp7;

layout(std140) uniform PSBlock {
int4 color[4];
int4 k[4];
int4 alphaRef;
float4 texdim[8];
int4 czbias[2];
int4 cindscale[2];
int4 cindmtx[6];
int4 cfogcolor;
int4 cfogi;
float4 cfogf[2];
float4 czslope;
float4 cefbscale;
};
struct VS_OUTPUT {
float4 pos;
float4 colors_0;
float4 colors_1;
float3 tex0;
float4 clipPos;
};
out vec4 ocol0;
#define depth gl_FragDepth
in VertexData {
centroid in float4 pos;
centroid in float4 colors_0;
centroid in float4 colors_1;
centroid in float3 tex0;
centroid in float4 clipPos;
};
void main()
{
float3 uv0 = tex0;
float4 rawpos = gl_FragCoord;
int4 c0 = color[1], c1 = color[2], c2 = color[3], prev = color[0];
int4 rastemp = int4(0, 0, 0, 0), textemp = int4(0, 0, 0, 0), konsttemp = int4(0, 0, 0, 0);
int3 comp16 = int3(1, 256, 0), comp24 = int3(1, 256, 256*256);
int alphabump=0;
int3 tevcoord=int3(0, 0, 0);
int2 wrappedcoord=int2(0,0), tempcoord=int2(0,0);
int4 tevin_a=int4(0,0,0,0),tevin_b=int4(0,0,0,0),tevin_c=int4(0,0,0,0),tevin_d=int4(0,0,0,0);

float4 col0 = colors_0;
float4 col1 = colors_1;
int2 fixpoint_uv0 = itrunc(uv0.xy * texdim[0].zw * 128.0);

// TEV stage 0
tevcoord.xy = fixpoint_uv0;
textemp = iround(255.0 * texture(samp0, float3((float2(tevcoord.xy)/128.0).xy * texdim[0].xy, 0.0))).rgba;
tevin_a = int4(int3(0,0,0), 0)&255;
tevin_b = int4(int3(0,0,0), 0)&255;
tevin_c = int4(int3(0,0,0), 0)&255;
tevin_d = int4(c0.rgb, c0.a);
// color combine
prev.rgb = clamp((((tevin_d.rgb)) + (((((tevin_a.rgb<<8) + (tevin_b.rgb-tevin_a.rgb)*(tevin_c.rgb+(tevin_c.rgb>>7)))) + 128)>>8)), int3(0,0,0), int3(255,255,255));
// alpha combine
prev.a = clamp((((tevin_d.a)) + (((((tevin_a.a<<8) + (tevin_b.a-tevin_a.a)*(tevin_c.a+(tevin_c.a>>7)))) + 128)>>8)), 0, 255);
prev = prev & 255;
int zCoord = iround(rawpos.z * float(0xFFFFFF));
zCoord = idot(czbias[0].xyzw, textemp.xyzw) + czbias[1].w ;
zCoord = zCoord & 0xFFFFFF;
depth = float(zCoord) / float(0xFFFFFF);
ocol0 = float4(prev) / 255.0;
}
ERROR: 1:57: 'centroid' : syntax error syntax error
Are you using D3d or OpenGL?
What Dolphin version are you on?
Have you updated your Intel Graphics drivers?
Where does this error appear?
It's on OpenGL, the version is new enough to support intel, but:
Did you try to update your GPU driver?

kjedmunds

(05-09-2015, 12:12 AM)degasus Wrote: [ -> ]It's on OpenGL, the version is new enough to support intel, but:
Did you try to update your GPU driver?

Hi! Sorry I just realized I'd already gotten a reply - thanks to all y'all!

Sorry for not mentioning the version before, but I'm using Dolphin 4.0-5971. I haven't updated my drivers recently for the HD4000, but I can take a look soon - in the meantime, which version of OpenGL does Dolphin 4.0-5971 support? Haha sorry it's been so long since I looked into this - I think the HD4000 is supported for OpenGL 4.0?

Thanks again for your quick replies!
Where in the game does this error appear? Games do different things in different spots, so to understand the error we'll need to know where the error occurred.