If perspective divide is enabled and texture coordinate Z is 0 then leave texture coordinates alone. Fixes issue 3676.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6964 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
donkopunchstania 2011-01-29 08:34:57 +00:00
parent fa95b7d89f
commit d5e5730fef
5 changed files with 10 additions and 12 deletions

View File

@ -26,7 +26,7 @@
// shader cache for every revision, graphics-related or not, which is simply annoying. // shader cache for every revision, graphics-related or not, which is simply annoying.
enum enum
{ {
LINEAR_DISKCACHE_VER = 6957 LINEAR_DISKCACHE_VER = 6964
}; };
// On disk format: // On disk format:

View File

@ -734,8 +734,6 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType
{ {
WRITE(p, "if (uv%d.z)", i); WRITE(p, "if (uv%d.z)", i);
WRITE(p, " uv%d.xy = uv%d.xy / uv%d.z;\n", i, i, i); WRITE(p, " uv%d.xy = uv%d.xy / uv%d.z;\n", i, i, i);
WRITE(p, "else");
WRITE(p, " uv%d.xy = float2(0.0f, 0.0f);\n", i);
} }
WRITE(p, "uv%d.xy = uv%d.xy * "I_TEXDIMS"[%d].zw;\n", i, i, i); WRITE(p, "uv%d.xy = uv%d.xy * "I_TEXDIMS"[%d].zw;\n", i, i, i);

View File

@ -54,7 +54,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "XFMemLoader.h" #include "XFMemLoader.h"
#include "BPMemLoader.h" #include "BPMemLoader.h"
#include "Statistics.h" #include "Statistics.h"
#include "SWVideoConfig.h"
namespace Clipper namespace Clipper
@ -274,9 +273,6 @@ namespace Clipper
void ProcessTriangle(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2) void ProcessTriangle(OutputVertexData *v0, OutputVertexData *v1, OutputVertexData *v2)
{ {
if (stats.thisFrame.numDrawnObjects < g_SWVideoConfig.drawStart || stats.thisFrame.numDrawnObjects >= g_SWVideoConfig.drawEnd )
return;
INCSTAT(stats.thisFrame.numTrianglesIn) INCSTAT(stats.thisFrame.numTrianglesIn)
bool backface; bool backface;

View File

@ -28,6 +28,7 @@
#include "Statistics.h" #include "Statistics.h"
#include "DebugUtil.h" #include "DebugUtil.h"
#include "CommandProcessor.h" #include "CommandProcessor.h"
#include "SWVideoConfig.h"
typedef void (*DecodingFunction)(u32); typedef void (*DecodingFunction)(u32);
DecodingFunction currentFunction = NULL; DecodingFunction currentFunction = NULL;
@ -48,7 +49,11 @@ void DecodePrimitiveStream(u32 iBufferSize)
{ {
u32 vertexSize = vertexLoader.GetVertexSize(); u32 vertexSize = vertexLoader.GetVertexSize();
if(g_bSkipCurrentFrame) bool skipPrimitives = g_bSkipCurrentFrame ||
stats.thisFrame.numDrawnObjects < g_SWVideoConfig.drawStart ||
stats.thisFrame.numDrawnObjects >= g_SWVideoConfig.drawEnd;
if (skipPrimitives)
{ {
while (streamSize > 0 && iBufferSize >= vertexSize) while (streamSize > 0 && iBufferSize >= vertexSize)
{ {

View File

@ -257,14 +257,13 @@ void BuildBlock(s32 blockX, s32 blockY)
// tex coords // tex coords
for (unsigned int i = 0; i < bpmem.genMode.numtexgens; i++) for (unsigned int i = 0; i < bpmem.genMode.numtexgens; i++)
{ {
float projection; float projection = invW;
if (xfregs.texMtxInfo[i].projection) if (xfregs.texMtxInfo[i].projection)
{ {
float q = TexSlopes[i][2].GetValue(dx, dy) * invW; float q = TexSlopes[i][2].GetValue(dx, dy) * invW;
if (q != 0.0f)
projection = invW / q; projection = invW / q;
} }
else
projection = invW;
pixel.Uv[i][0] = TexSlopes[i][0].GetValue(dx, dy) * projection; pixel.Uv[i][0] = TexSlopes[i][0].GetValue(dx, dy) * projection;
pixel.Uv[i][1] = TexSlopes[i][1].GetValue(dx, dy) * projection; pixel.Uv[i][1] = TexSlopes[i][1].GetValue(dx, dy) * projection;