mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 16:49:50 +00:00
d3d: Use 2.0 vertex and pixel shaders.
This commit is contained in:
parent
07ccc37689
commit
a29c2f4f2f
@ -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");
|
||||
|
@ -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");
|
||||
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user