summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexShaderGen.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2016-02-27 22:45:05 -0600
committerRyan Houdek <Sonicadvance1@gmail.com>2016-02-29 16:43:44 -0600
commite1d36f91fc72c4e0b0ff5c8fea01ee60276c20ff (patch)
tree3db4c41dba7f889fbc72d0e4b9d134ba7cadda32 /Source/Core/VideoCommon/VertexShaderGen.cpp
parent54c2800bb4a7a5bd7ead7319a28da9269a3f8ed3 (diff)
Fix a few asserts in the VertexShaderGen.
Removes a couple asserts in the vertex shader gen when dealing with the input form. Typically input form ABC1 is used, so it'll pull in the first three elements and always set the fourth to 1.0 The other input form available is AB11, which sets the last two components to 1.0 (Theoretically). No titles actually use this input form that we know of except for Project M, but it can have some fairly drastic visual differences. Confirmed correct by hardware test
Diffstat (limited to 'Source/Core/VideoCommon/VertexShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexShaderGen.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp
index feb94bfa5d..c613e237d0 100644
--- a/Source/Core/VideoCommon/VertexShaderGen.cpp
+++ b/Source/Core/VideoCommon/VertexShaderGen.cpp
@@ -198,15 +198,12 @@ static T GenerateVertexShader(API_TYPE api_type)
switch (texinfo.sourcerow)
{
case XF_SRCGEOM_INROW:
- // The following assert was triggered in Super Smash Bros. Project M 3.6.
- //_assert_(texinfo.inputform == XF_TEXINPUT_ABC1);
- out.Write("coord = rawpos;\n"); // pos.w is 1
+ out.Write("coord.xyz = rawpos.xyz;\n");
break;
case XF_SRCNORMAL_INROW:
if (components & VB_HAS_NRM0)
{
- _assert_(texinfo.inputform == XF_TEXINPUT_ABC1);
- out.Write("coord = float4(rawnorm0.xyz, 1.0);\n");
+ out.Write("coord.xyz = rawnorm0.xyz;\n");
}
break;
case XF_SRCCOLORS_INROW:
@@ -215,15 +212,13 @@ static T GenerateVertexShader(API_TYPE api_type)
case XF_SRCBINORMAL_T_INROW:
if (components & VB_HAS_NRM1)
{
- _assert_(texinfo.inputform == XF_TEXINPUT_ABC1);
- out.Write("coord = float4(rawnorm1.xyz, 1.0);\n");
+ out.Write("coord.xyz = rawnorm1.xyz;\n");
}
break;
case XF_SRCBINORMAL_B_INROW:
if (components & VB_HAS_NRM2)
{
- _assert_(texinfo.inputform == XF_TEXINPUT_ABC1);
- out.Write("coord = float4(rawnorm2.xyz, 1.0);\n");
+ out.Write("coord.xyz = rawnorm2.xyz;\n");
}
break;
default:
@@ -232,6 +227,12 @@ static T GenerateVertexShader(API_TYPE api_type)
out.Write("coord = float4(tex%d.x, tex%d.y, 1.0, 1.0);\n", texinfo.sourcerow - XF_SRCTEX0_INROW, texinfo.sourcerow - XF_SRCTEX0_INROW);
break;
}
+ // An input form other than ABC1 or AB11 doesn't exist
+ // But the hardware has it as a two bit field
+ _assert_(texinfo.inputform == XF_TEXINPUT_ABC1 || texinfo.inputform == XF_TEXINPUT_AB11);
+ uid_data->texMtxInfo[i].inputform = xfmem.texMtxInfo[i].inputform;
+ if (texinfo.inputform == XF_TEXINPUT_AB11)
+ out.Write("coord.z = 1.0;\n");
// first transformation
uid_data->texMtxInfo[i].texgentype = xfmem.texMtxInfo[i].texgentype;