Merge pull request #1956 from Tilka/vertex_loader_jit
VertexLoader: clean up and fix some problems
This commit is contained in:
commit
8eda3ca844
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
#include "VideoCommon/BoundingBox.h"
|
#include "VideoCommon/BoundingBox.h"
|
||||||
#include "VideoCommon/DataReader.h"
|
#include "VideoCommon/DataReader.h"
|
||||||
#include "VideoCommon/LookUpTables.h"
|
|
||||||
#include "VideoCommon/PixelEngine.h"
|
#include "VideoCommon/PixelEngine.h"
|
||||||
#include "VideoCommon/VertexLoader.h"
|
#include "VideoCommon/VertexLoader.h"
|
||||||
#include "VideoCommon/VertexLoader_Color.h"
|
#include "VideoCommon/VertexLoader_Color.h"
|
||||||
|
@ -19,11 +18,6 @@
|
||||||
#include "VideoCommon/VideoCommon.h"
|
#include "VideoCommon/VideoCommon.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
#undef inline
|
|
||||||
#define inline
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// This pointer is used as the source/dst for all fixed function loader calls
|
// This pointer is used as the source/dst for all fixed function loader calls
|
||||||
u8* g_video_buffer_read_ptr;
|
u8* g_video_buffer_read_ptr;
|
||||||
u8* g_vertex_manager_write_ptr;
|
u8* g_vertex_manager_write_ptr;
|
||||||
|
|
|
@ -77,22 +77,15 @@ void VertexLoaderBase::AppendToString(std::string *dest) const
|
||||||
|
|
||||||
static const char *posMode[4] = {
|
static const char *posMode[4] = {
|
||||||
"Inv",
|
"Inv",
|
||||||
"Dir",
|
"Dir", "I8", "I16",
|
||||||
"I8",
|
|
||||||
"I16",
|
|
||||||
};
|
};
|
||||||
static const char *posFormats[5] = {
|
static const char *posFormats[8] = {
|
||||||
"u8", "s8", "u16", "s16", "flt",
|
"u8", "s8", "u16", "s16", "flt",
|
||||||
|
"Inv", "Inv", "Inv",
|
||||||
};
|
};
|
||||||
static const char *colorFormat[8] = {
|
static const char *colorFormat[8] = {
|
||||||
"565",
|
"565", "888", "888x", "4444", "6666", "8888",
|
||||||
"888",
|
"Inv", "Inv",
|
||||||
"888x",
|
|
||||||
"4444",
|
|
||||||
"6666",
|
|
||||||
"8888",
|
|
||||||
"Inv",
|
|
||||||
"Inv",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
dest->append(StringFromFormat("%ib skin: %i P: %i %s-%s ",
|
dest->append(StringFromFormat("%ib skin: %i P: %i %s-%s ",
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
|
|
||||||
using namespace Gen;
|
using namespace Gen;
|
||||||
|
|
||||||
|
#define VERTEX_LOADER_REGS {XMM0+16}
|
||||||
|
|
||||||
static const X64Reg src_reg = ABI_PARAM1;
|
static const X64Reg src_reg = ABI_PARAM1;
|
||||||
static const X64Reg dst_reg = ABI_PARAM2;
|
static const X64Reg dst_reg = ABI_PARAM2;
|
||||||
static const X64Reg scratch1 = RAX;
|
static const X64Reg scratch1 = RAX;
|
||||||
|
@ -293,10 +295,12 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format)
|
||||||
|
|
||||||
void VertexLoaderX64::GenerateVertexLoader()
|
void VertexLoaderX64::GenerateVertexLoader()
|
||||||
{
|
{
|
||||||
|
ABI_PushRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8);
|
||||||
|
|
||||||
// Backup count since we're going to count it down.
|
// Backup count since we're going to count it down.
|
||||||
PUSH(32, R(ABI_PARAM3));
|
PUSH(32, R(ABI_PARAM3));
|
||||||
|
|
||||||
// We use ABI_PARAM3 for scratch2.
|
// ABI_PARAM3 is one of the lower registers, so free it for scratch2.
|
||||||
MOV(32, R(count_reg), R(ABI_PARAM3));
|
MOV(32, R(count_reg), R(ABI_PARAM3));
|
||||||
|
|
||||||
if (m_VtxDesc.Position & MASK_INDEXED)
|
if (m_VtxDesc.Position & MASK_INDEXED)
|
||||||
|
@ -427,6 +431,8 @@ void VertexLoaderX64::GenerateVertexLoader()
|
||||||
// Get the original count.
|
// Get the original count.
|
||||||
POP(32, R(ABI_RETURN));
|
POP(32, R(ABI_RETURN));
|
||||||
|
|
||||||
|
ABI_PopRegistersAndAdjustStack(VERTEX_LOADER_REGS, 8);
|
||||||
|
|
||||||
if (m_VtxDesc.Position & MASK_INDEXED)
|
if (m_VtxDesc.Position & MASK_INDEXED)
|
||||||
{
|
{
|
||||||
SUB(32, R(ABI_RETURN), R(skipped_reg));
|
SUB(32, R(ABI_RETURN), R(skipped_reg));
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
#include "VideoCommon/LookUpTables.h"
|
|
||||||
#include "VideoCommon/VertexLoader.h"
|
#include "VideoCommon/VertexLoader.h"
|
||||||
#include "VideoCommon/VertexLoader_Color.h"
|
#include "VideoCommon/VertexLoader_Color.h"
|
||||||
#include "VideoCommon/VertexManagerBase.h"
|
#include "VideoCommon/VertexManagerBase.h"
|
||||||
|
|
Loading…
Reference in New Issue