Delete disabled code to use built-in alpha test on DX9.

This commit is contained in:
Henrik Rydgard 2015-10-25 01:26:38 +02:00
parent 85229efef4
commit 838e53f482
4 changed files with 0 additions and 26 deletions

View File

@ -237,14 +237,6 @@ void ComputeFragmentShaderID(ShaderID *id_out, uint32_t vertType) {
}
id.SetBit(FS_BIT_LMODE, lmode);
#if !defined(DX9_USE_HW_ALPHA_TEST)
if (enableAlphaTest) {
// 5 bits total.
id.SetBit(FS_BIT_ALPHA_TEST);
id.SetBits(FS_BIT_ALPHA_TEST_FUNC, 3, gstate.getAlphaTestFunction());
id.SetBit(FS_BIT_ALPHA_AGAINST_ZERO, IsAlphaTestAgainstZero());
}
#endif
if (enableColorTest) {
// 4 bits total.
id.SetBit(FS_BIT_COLOR_TEST);

View File

@ -238,7 +238,6 @@ bool GenerateFragmentShaderDX9(const ShaderID &id, char *buffer) {
WRITE(p, " float4 v = In.v_color0 %s;\n", secondary);
}
#if !defined(DX9_USE_HW_ALPHA_TEST)
if (enableAlphaTest) {
if (alphaTestAgainstZero) {
// When testing against 0 (extremely common), we can avoid some math.
@ -264,7 +263,6 @@ bool GenerateFragmentShaderDX9(const ShaderID &id, char *buffer) {
}
}
}
#endif
if (enableColorTest) {
if (colorTestAgainstZero) {
// When testing against 0 (common), we can avoid some math.

View File

@ -21,9 +21,6 @@
#include "GPU/Common/ShaderId.h"
// TODO: Bench both ways. Result may be different on old vs new hardware though..
// #define DX9_USE_HW_ALPHA_TEST 1
namespace DX9 {
bool GenerateFragmentShaderDX9(const ShaderID &id, char *buffer);

View File

@ -635,19 +635,6 @@ void TransformDrawEngineDX9::ApplyDrawState(int prim) {
}
}
#if defined(DX9_USE_HW_ALPHA_TEST)
// Older hardware (our target for DX9) often has separate alpha testing hardware that
// is generally faster than using discard/clip. Let's use it.
if (gstate.alphaTestEnable) {
dxstate.alphaTest.enable();
GEComparison alphaTestFunc = gstate.getAlphaTestFunction();
dxstate.alphaTestFunc.set(ztests[alphaTestFunc]);
dxstate.alphaTestRef.set(gstate.getAlphaTestRef());
} else {
dxstate.alphaTest.disable();
}
#endif
float renderWidthFactor, renderHeightFactor;
float renderWidth, renderHeight;
float renderX, renderY;