d3d: Use 2.0 vertex and pixel shaders.

This commit is contained in:
Unknown W. Brackets 2014-09-01 10:03:27 -07:00
parent 07ccc37689
commit a29c2f4f2f
3 changed files with 7 additions and 7 deletions

View File

@ -232,7 +232,7 @@ void GenerateFragmentShaderDX9(char *buffer) {
WRITE(p, " float3 v_color1: COLOR1; \n");
}
if (enableFog) {
WRITE(p, "float v_fogdepth:FOG;\n");
WRITE(p, "float2 v_fogdepth: TEXCOORD1;\n");
}
WRITE(p, " }; \n");
WRITE(p, " \n");
@ -328,7 +328,7 @@ void GenerateFragmentShaderDX9(char *buffer) {
}
if (enableFog) {
WRITE(p, " float fogCoef = clamp(In.v_fogdepth, 0.0, 1.0);\n");
WRITE(p, " float fogCoef = clamp(In.v_fogdepth.x, 0.0, 1.0);\n");
WRITE(p, " return lerp(float4(u_fogcolor, v.a), v, fogCoef);\n");
} else {
WRITE(p, " return v;\n");

View File

@ -270,7 +270,7 @@ void GenerateVertexShaderDX9(int prim, char *buffer, bool useHWTransform) {
WRITE(p, " float3 v_color1 : COLOR1; \n");
if (enableFog) {
WRITE(p, "float v_fogdepth:FOG;\n");
WRITE(p, "float2 v_fogdepth: TEXCOORD1;\n");
}
WRITE(p, " }; \n");
WRITE(p, " \n");
@ -292,7 +292,7 @@ void GenerateVertexShaderDX9(int prim, char *buffer, bool useHWTransform) {
WRITE(p, " Out.v_color1 = In.vec3(0.0);\n");
}
if (enableFog) {
WRITE(p, " Out.v_fogdepth = In.position.w;\n");
WRITE(p, " Out.v_fogdepth.x = In.position.w;\n");
}
if (gstate.isModeThrough()) {
WRITE(p, " Out.gl_Position = mul(float4(In.position.xyz, 1.0), u_proj_through);\n");
@ -574,7 +574,7 @@ void GenerateVertexShaderDX9(int prim, char *buffer, bool useHWTransform) {
// Compute fogdepth
if (enableFog)
WRITE(p, " Out.v_fogdepth = (viewPos.z + u_fogcoef.x) * u_fogcoef.y;\n");
WRITE(p, " Out.v_fogdepth.x = (viewPos.z + u_fogcoef.x) * u_fogcoef.y;\n");
}

View File

@ -79,7 +79,7 @@ bool CompilePixelShader(const char * code, LPDIRECT3DPIXELSHADER9 * pShader, LPD
NULL,
NULL,
"main",
"ps_3_0",
"ps_2_0",
0,
&pShaderCode,
&pErrorMsg,
@ -115,7 +115,7 @@ bool CompileVertexShader(const char * code, LPDIRECT3DVERTEXSHADER9 * pShader, L
NULL,
NULL,
"main",
"vs_3_0",
"vs_2_0",
0,
&pShaderCode,
&pErrorMsg,