2016-01-08 03:40:35 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-02-16 06:21:22 +00:00
|
|
|
#include <memory>
|
2016-01-08 03:40:35 +00:00
|
|
|
#include "VideoCommon/VertexManagerBase.h"
|
|
|
|
|
|
|
|
namespace DX12
|
|
|
|
{
|
|
|
|
class D3DStreamBuffer;
|
|
|
|
|
|
|
|
class VertexManager final : public VertexManagerBase
|
|
|
|
{
|
|
|
|
public:
|
2016-06-24 08:43:46 +00:00
|
|
|
VertexManager();
|
|
|
|
~VertexManager();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
NativeVertexFormat* CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
|
|
|
|
void CreateDeviceObjects() override;
|
|
|
|
void DestroyDeviceObjects() override;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
void SetIndexBuffer();
|
2016-01-08 03:40:35 +00:00
|
|
|
|
|
|
|
protected:
|
2016-06-24 08:43:46 +00:00
|
|
|
void ResetBuffer(u32 stride) override;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
|
|
|
private:
|
2016-06-24 08:43:46 +00:00
|
|
|
void PrepareDrawBuffers(u32 stride);
|
|
|
|
void Draw(u32 stride);
|
2016-12-28 00:37:41 +00:00
|
|
|
void vFlush() override;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
u32 m_vertex_draw_offset;
|
|
|
|
u32 m_index_draw_offset;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
std::unique_ptr<D3DStreamBuffer> m_vertex_stream_buffer;
|
|
|
|
std::unique_ptr<D3DStreamBuffer> m_index_stream_buffer;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
bool m_vertex_stream_buffer_reallocated = false;
|
|
|
|
bool m_index_stream_buffer_reallocated = false;
|
2016-01-08 03:40:35 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
std::vector<u8> m_index_cpu_buffer;
|
|
|
|
std::vector<u8> m_vertex_cpu_buffer;
|
2016-01-08 03:40:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|