summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/VertexLoaderARM64.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@gmail.com>2015-06-06 23:50:50 -0500
committerTillmann Karras <tilkax@gmail.com>2015-06-07 12:13:01 +0200
commit10bd68936c11ae0ed74861ca2172d41bbac0dc1f (patch)
treec5574d743e82ede46beff3104b053fa6ab522acc /Source/Core/VideoCommon/VertexLoaderARM64.cpp
parent5ddd2cef6c5cc8e5414636d73365691de726b3d0 (diff)
[AArch64] Implement ZFreeze cache
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderARM64.cpp')
-rw-r--r--Source/Core/VideoCommon/VertexLoaderARM64.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderARM64.cpp b/Source/Core/VideoCommon/VertexLoaderARM64.cpp
index 36b6aae0f5..35d3a989e7 100644
--- a/Source/Core/VideoCommon/VertexLoaderARM64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderARM64.cpp
@@ -165,6 +165,18 @@ int VertexLoaderARM64::ReadVertex(u64 attribute, int format, int count_in, int c
m_float_emit.ST1(32, 1, coords, EncodeRegTo64(scratch2_reg));
}
+ // Z-Freeze
+ if (native_format == &m_native_vtx_decl.position)
+ {
+ CMP(count_reg, 3);
+ FixupBranch dont_store = B(CC_GT);
+ MOVI2R(EncodeRegTo64(scratch2_reg), (u64)VertexLoaderManager::position_cache);
+ ORR(scratch1_reg, WSP, count_reg, ArithOption(count_reg, ST_LSL, 4));
+ ADD(EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch1_reg), EncodeRegTo64(scratch2_reg));
+ m_float_emit.STUR(write_size, coords, EncodeRegTo64(scratch1_reg), -16);
+ SetJumpTarget(dont_store);
+ }
+
native_format->components = count_out;
native_format->enable = true;
native_format->offset = m_dst_ofs;
@@ -342,6 +354,14 @@ void VertexLoaderARM64::GenerateVertexLoader()
LDRB(INDEX_UNSIGNED, scratch1_reg, src_reg, m_src_ofs);
AND(scratch1_reg, scratch1_reg, 0, 5);
STR(INDEX_UNSIGNED, scratch1_reg, dst_reg, m_dst_ofs);
+
+ // Z-Freeze
+ CMP(count_reg, 3);
+ FixupBranch dont_store = B(CC_GT);
+ MOVI2R(EncodeRegTo64(scratch2_reg), (u64)VertexLoaderManager::position_matrix_index - sizeof(u32));
+ STR(INDEX_UNSIGNED, scratch1_reg, EncodeRegTo64(scratch2_reg), 0);
+ SetJumpTarget(dont_store);
+
m_native_components |= VB_HAS_POSMTXIDX;
m_native_vtx_decl.posmtx.components = 4;
m_native_vtx_decl.posmtx.enable = true;