mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Move Zfreeze code out individual backends into videoCommon
Also: * Implement support for per-vertex PosMatrixIndex * Only update zslope constant once when zfreeze is activated. * Added a bunch of comments.
This commit is contained in:
@ -59,7 +59,7 @@ DXGI_FORMAT VarToD3D(VarType t, int size, bool integer)
|
||||
|
||||
void D3DVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
{
|
||||
vertex_stride = _vtx_decl.stride;
|
||||
vtx_decl = _vtx_decl;
|
||||
memset(m_elems, 0, sizeof(m_elems));
|
||||
const AttributeFormat* format = &_vtx_decl.position;
|
||||
|
||||
|
@ -181,13 +181,6 @@ void VertexManager::vFlush(bool useDstAlpha)
|
||||
|
||||
PrepareDrawBuffers(stride);
|
||||
|
||||
if (!bpmem.genMode.zfreeze)
|
||||
CalculateZSlope(stride);
|
||||
|
||||
// If cull mode is CULL_ALL, do not render these triangles
|
||||
if (bpmem.genMode.cullmode == GenMode::CULL_ALL && current_primitive_type == PRIMITIVE_TRIANGLES)
|
||||
return;
|
||||
|
||||
VertexLoaderManager::GetCurrentVertexFormat()->SetupVertexPointers();
|
||||
g_renderer->ApplyState(useDstAlpha);
|
||||
|
||||
@ -200,9 +193,6 @@ void VertexManager::ResetBuffer(u32 stride)
|
||||
{
|
||||
s_pCurBufferPointer = s_pBaseBufferPointer;
|
||||
IndexGenerator::Start(GetIndexBuffer());
|
||||
|
||||
if (bpmem.genMode.zfreeze)
|
||||
PixelShaderManager::SetZSlope(ZSlope.dfdx, ZSlope.dfdy, ZSlope.f0);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -58,7 +58,7 @@ static void SetPointer(u32 attrib, u32 stride, const AttributeFormat &format)
|
||||
void GLVertexFormat::Initialize(const PortableVertexDeclaration &_vtx_decl)
|
||||
{
|
||||
this->vtx_decl = _vtx_decl;
|
||||
vertex_stride = vtx_decl.stride;
|
||||
u32 vertex_stride = _vtx_decl.stride;
|
||||
|
||||
// We will not allow vertex components causing uneven strides.
|
||||
if (vertex_stride & 3)
|
||||
|
@ -89,9 +89,6 @@ void VertexManager::ResetBuffer(u32 stride)
|
||||
buffer = s_indexBuffer->Map(MAXIBUFFERSIZE * sizeof(u16));
|
||||
IndexGenerator::Start((u16*)buffer.first);
|
||||
s_index_offset = buffer.second;
|
||||
|
||||
if (bpmem.genMode.zfreeze)
|
||||
PixelShaderManager::SetZSlope(ZSlope.dfdx, ZSlope.dfdy, ZSlope.f0);
|
||||
}
|
||||
|
||||
void VertexManager::Draw(u32 stride)
|
||||
@ -143,13 +140,6 @@ void VertexManager::vFlush(bool useDstAlpha)
|
||||
|
||||
PrepareDrawBuffers(stride);
|
||||
|
||||
if (!bpmem.genMode.zfreeze)
|
||||
CalculateZSlope(stride);
|
||||
|
||||
// If cull mode is CULL_ALL, do not render these triangles
|
||||
if (bpmem.genMode.cullmode == GenMode::CULL_ALL && current_primitive_type == PRIMITIVE_TRIANGLES)
|
||||
return;
|
||||
|
||||
// Makes sure we can actually do Dual source blending
|
||||
bool dualSourcePossible = g_ActiveConfig.backend_info.bSupportsDualSourceBlend;
|
||||
|
||||
|
@ -13,8 +13,6 @@ namespace OGL
|
||||
{
|
||||
class GLVertexFormat : public NativeVertexFormat
|
||||
{
|
||||
PortableVertexDeclaration vtx_decl;
|
||||
|
||||
public:
|
||||
GLVertexFormat();
|
||||
~GLVertexFormat();
|
||||
|
Reference in New Issue
Block a user