mirror of https://github.com/PCSX2/pcsx2.git
GS: Reduce FindMinMax instantiation count
This commit is contained in:
parent
9d8b93a269
commit
f53cb0fae7
|
@ -27,9 +27,7 @@ GSVertexTrace::GSVertexTrace(const GSState* state, bool provoking_vertex_first)
|
|||
memset(&m_alpha, 0, sizeof(m_alpha));
|
||||
|
||||
#define InitUpdate3(P, IIP, TME, FST, COLOR) \
|
||||
m_fmm[COLOR][FST][TME][IIP][P] = \
|
||||
provoking_vertex_first ? &GSVertexTrace::FindMinMax<P, IIP, TME, FST, COLOR, true> : \
|
||||
&GSVertexTrace::FindMinMax<P, IIP, TME, FST, COLOR, false>;
|
||||
m_fmm[COLOR][FST][TME][IIP][P] = GetFMM<P, IIP, TME, FST, COLOR>(provoking_vertex_first);
|
||||
|
||||
#define InitUpdate2(P, IIP, TME) \
|
||||
InitUpdate3(P, IIP, TME, 0, 0) \
|
||||
|
@ -153,6 +151,19 @@ void GSVertexTrace::Update(const void* vertex, const u32* index, int v_count, in
|
|||
}
|
||||
}
|
||||
|
||||
template <GS_PRIM_CLASS primclass, u32 iip, u32 tme, u32 fst, u32 color>
|
||||
GSVertexTrace::FindMinMaxPtr GSVertexTrace::GetFMM(bool provoking_vertex_first)
|
||||
{
|
||||
constexpr bool real_fst = tme ? fst : false;
|
||||
constexpr bool provoking_vertex_first_class = primclass == GS_LINE_CLASS || primclass == GS_TRIANGLE_CLASS;
|
||||
const bool swap = provoking_vertex_first_class && !iip && provoking_vertex_first;
|
||||
|
||||
if (swap)
|
||||
return &GSVertexTrace::FindMinMax<primclass, iip, tme, real_fst, color, true>;
|
||||
else
|
||||
return &GSVertexTrace::FindMinMax<primclass, iip, tme, real_fst, color, false>;
|
||||
}
|
||||
|
||||
template <GS_PRIM_CLASS primclass, u32 iip, u32 tme, u32 fst, u32 color, bool flat_swapped>
|
||||
void GSVertexTrace::FindMinMax(const void* vertex, const u32* index, int count)
|
||||
{
|
||||
|
|
|
@ -51,6 +51,9 @@ protected:
|
|||
template <GS_PRIM_CLASS primclass, u32 iip, u32 tme, u32 fst, u32 color, bool provoking_vertex_first>
|
||||
void FindMinMax(const void* vertex, const u32* index, int count);
|
||||
|
||||
template <GS_PRIM_CLASS primclass, u32 iip, u32 tme, u32 fst, u32 color>
|
||||
FindMinMaxPtr GetFMM(bool provoking_vertex_first);
|
||||
|
||||
public:
|
||||
GS_PRIM_CLASS m_primclass;
|
||||
|
||||
|
|
Loading…
Reference in New Issue