@@ -1056,30 +1056,6 @@ private:
10561056 }
10571057 }
10581058
1059- // game postfx
1060- {
1061- for (int i = 0 ; i < 4 ; i++) {
1062- pDevice->SetTexture (i, PostFxResources.prePostFx [i]);
1063- pDevice->SetSamplerState (i, D3DSAMP_MAGFILTER, PostFxResources.Samplers [i]);
1064- }
1065-
1066- if (UsePostFxAA->get () > FusionFixSettings.AntialiasingText .eMO_OFF )
1067- pDevice->SetRenderTarget (0 , PostFxResources.renderTargetSurf );
1068- else
1069- pDevice->SetRenderTarget (0 , PostFxResources.backBuffer );
1070- pDevice->SetTexture (9 , PostFxResources.blueNoiseVolume );
1071- pDevice->SetTexture (2 , PostFxResources.textureRead );
1072- pDevice->Clear (0 , 0 , D3DCLEAR_TARGET, 0 , 0 , 0 );
1073-
1074- pDevice->SetPixelShader (pShader);
1075- pDevice->SetVertexShader (vShader);
1076- // hr = pDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
1077- hbDrawPrimitivePostFX.fun ();
1078- if (UsePostFxAA->get () > FusionFixSettings.AntialiasingText .eMO_OFF )
1079- PostFxResources.swapbuffers ();
1080-
1081- pDevice->SetTexture (9 , 0 );
1082- }
10831059 // This implementation has some problems with cuts in some
10841060 // places (when smoothing some diagonal lines there are pixels that break the smoothing),
10851061 // I didn't find the reason, but using antialiasing.ixx it works almost perfectly despite being
@@ -1090,13 +1066,13 @@ private:
10901066 pDevice->GetRenderState (D3DRS_SRGBWRITEENABLE, &OldSRGB); // save srgb state
10911067 pDevice->SetPixelShader (PostFxResources.FxaaPS );
10921068
1093- // pDevice->SetRenderTarget(0, PostFxResources.renderTargetSurf);
1094- pDevice->SetRenderTarget (0 , PostFxResources.backBuffer );
1069+ pDevice->SetRenderTarget (0 , PostFxResources.renderTargetSurf );
1070+ // pDevice->SetRenderTarget(0, PostFxResources.backBuffer);
10951071
10961072 pDevice->SetTexture (2 , PostFxResources.textureRead );
10971073 hr = pDevice->DrawPrimitive (D3DPT_TRIANGLELIST, 0 , 2 );
1098- pDevice->SetTexture (2 , PostFxResources.renderTargetTex );
1099- // PostFxResources.swapbuffers();
1074+ // pDevice->SetTexture(2, PostFxResources.renderTargetTex);
1075+ PostFxResources.swapbuffers ();
11001076 pDevice->SetSamplerState (2 , D3DSAMP_SRGBTEXTURE, 0 );
11011077 // pDevice->SetTexture(2, 0);
11021078 pDevice->SetPixelShader (pShader);
@@ -1152,8 +1128,8 @@ private:
11521128 vec4[3 ] = 4 .0f ;
11531129 pDevice->SetPixelShaderConstantF (5 , vec4, 1 );
11541130
1155- // pDevice->SetRenderTarget(0, PostFxResources.renderTargetSurf);
1156- pDevice->SetRenderTarget (0 , PostFxResources.backBuffer );
1131+ pDevice->SetRenderTarget (0 , PostFxResources.renderTargetSurf );
1132+ // pDevice->SetRenderTarget(0, PostFxResources.backBuffer);
11571133 pDevice->SetSamplerState (2 , D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
11581134
11591135 // pDevice->SetTexture(2, textureRead);
@@ -1162,7 +1138,7 @@ private:
11621138 pDevice->SetTexture (4 , PostFxResources.blendTex ->mD3DTexture );
11631139 pDevice->SetRenderState (D3DRS_SRGBWRITEENABLE, 0 );
11641140 pDevice->DrawPrimitive (D3DPT_TRIANGLELIST, 0 , 2 );
1165- // PostFxResources.swapbuffers();
1141+ PostFxResources.swapbuffers ();
11661142 pDevice->SetTexture (0 , PostFxResources.prePostFx [0 ]);
11671143 pDevice->SetTexture (1 , PostFxResources.prePostFx [1 ]);
11681144 pDevice->SetTexture (2 , PostFxResources.textureRead );
@@ -1174,6 +1150,30 @@ private:
11741150 }
11751151 }
11761152
1153+ // game postfx
1154+ {
1155+ for (int i = 0 ; i < 4 ; i++) {
1156+ pDevice->SetTexture (i, PostFxResources.prePostFx [i]);
1157+ pDevice->SetSamplerState (i, D3DSAMP_MAGFILTER, PostFxResources.Samplers [i]);
1158+ }
1159+
1160+ // if(UsePostFxAA->get() > FusionFixSettings.AntialiasingText.eMO_OFF)
1161+ // pDevice->SetRenderTarget(0, PostFxResources.renderTargetSurf);
1162+ // else
1163+ pDevice->SetRenderTarget (0 , PostFxResources.backBuffer );
1164+ pDevice->SetTexture (9 , PostFxResources.blueNoiseVolume );
1165+ pDevice->SetTexture (2 , PostFxResources.textureRead );
1166+ pDevice->Clear (0 , 0 , D3DCLEAR_TARGET, 0 , 0 , 0 );
1167+
1168+ pDevice->SetPixelShader (pShader);
1169+ pDevice->SetVertexShader (vShader);
1170+ // hr = pDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
1171+ hbDrawPrimitivePostFX.fun ();
1172+ // if(UsePostFxAA->get() > FusionFixSettings.AntialiasingText.eMO_OFF)
1173+ // PostFxResources.swapbuffers();
1174+
1175+ pDevice->SetTexture (9 , 0 );
1176+ }
11771177 for (int i = 0 ; i < PostfxTextureCount; i++) {
11781178 pDevice->SetTexture (i, PostFxResources.prePostFx [i]);
11791179 pDevice->SetSamplerState (i, D3DSAMP_MAGFILTER, PostFxResources.Samplers [i]);
0 commit comments