2014-02-03 13:02:17 +00:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "VideoBackends/Null/VertexManager.h"
|
2017-02-01 04:29:29 +00:00
|
|
|
|
2014-02-03 13:02:17 +00:00
|
|
|
#include "VideoBackends/Null/ShaderCache.h"
|
|
|
|
|
|
|
|
#include "VideoCommon/IndexGenerator.h"
|
2017-02-01 04:29:29 +00:00
|
|
|
#include "VideoCommon/NativeVertexFormat.h"
|
2014-02-03 13:02:17 +00:00
|
|
|
#include "VideoCommon/VertexLoaderManager.h"
|
|
|
|
|
|
|
|
namespace Null
|
|
|
|
{
|
|
|
|
class NullNativeVertexFormat : public NativeVertexFormat
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NullNativeVertexFormat() {}
|
|
|
|
void SetupVertexPointers() override {}
|
|
|
|
};
|
|
|
|
|
2017-02-18 08:14:30 +00:00
|
|
|
std::unique_ptr<NativeVertexFormat>
|
2014-02-03 13:02:17 +00:00
|
|
|
VertexManager::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
|
|
|
|
{
|
2017-02-18 08:14:30 +00:00
|
|
|
return std::make_unique<NullNativeVertexFormat>();
|
2014-02-03 13:02:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
VertexManager::VertexManager() : m_local_v_buffer(MAXVBUFFERSIZE), m_local_i_buffer(MAXIBUFFERSIZE)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
VertexManager::~VertexManager()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void VertexManager::ResetBuffer(u32 stride)
|
|
|
|
{
|
2016-08-22 03:46:52 +00:00
|
|
|
m_cur_buffer_pointer = m_base_buffer_pointer = m_local_v_buffer.data();
|
|
|
|
m_end_buffer_pointer = m_cur_buffer_pointer + m_local_v_buffer.size();
|
2014-02-03 13:02:17 +00:00
|
|
|
IndexGenerator::Start(&m_local_i_buffer[0]);
|
|
|
|
}
|
|
|
|
|
2016-12-28 00:37:41 +00:00
|
|
|
void VertexManager::vFlush()
|
2014-02-03 13:02:17 +00:00
|
|
|
{
|
2016-12-28 00:37:41 +00:00
|
|
|
VertexShaderCache::s_instance->SetShader(m_current_primitive_type);
|
|
|
|
GeometryShaderCache::s_instance->SetShader(m_current_primitive_type);
|
|
|
|
PixelShaderCache::s_instance->SetShader(m_current_primitive_type);
|
2014-02-03 13:02:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|