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:
parent
fa95b7d89f
commit
d5e5730fef
|
@ -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:
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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;
|
||||||
projection = invW / q;
|
if (q != 0.0f)
|
||||||
|
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;
|
||||||
|
|
Loading…
Reference in New Issue