2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 23:29:41 -04:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-13 19:50:06 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2010-06-13 19:50:06 +00:00
|
|
|
|
2017-02-18 03:14:30 -05:00
|
|
|
#include <memory>
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "VideoCommon/VertexManagerBase.h"
|
2010-06-13 19:50:06 +00:00
|
|
|
|
2017-01-31 23:29:29 -05:00
|
|
|
struct ID3D11Buffer;
|
|
|
|
|
2010-10-03 00:41:06 +00:00
|
|
|
namespace DX11
|
|
|
|
{
|
2015-11-01 22:54:41 +01:00
|
|
|
class VertexManager : public VertexManagerBase
|
2010-10-03 00:41:06 +00:00
|
|
|
{
|
|
|
|
public:
|
2016-06-24 10:43:46 +02:00
|
|
|
VertexManager();
|
|
|
|
~VertexManager();
|
2010-10-03 00:41:06 +00:00
|
|
|
|
2017-02-18 03:14:30 -05:00
|
|
|
std::unique_ptr<NativeVertexFormat>
|
|
|
|
CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
|
|
|
|
|
2016-06-24 10:43:46 +02:00
|
|
|
void CreateDeviceObjects() override;
|
|
|
|
void DestroyDeviceObjects() override;
|
2012-10-20 10:22:15 -03:00
|
|
|
|
2014-01-23 15:27:18 +01:00
|
|
|
protected:
|
2016-06-24 10:43:46 +02:00
|
|
|
void ResetBuffer(u32 stride) override;
|
|
|
|
u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
|
2012-10-20 10:22:15 -03:00
|
|
|
private:
|
2016-06-24 10:43:46 +02:00
|
|
|
void PrepareDrawBuffers(u32 stride);
|
|
|
|
void Draw(u32 stride);
|
|
|
|
// temp
|
2016-12-28 01:37:41 +01:00
|
|
|
void vFlush() override;
|
2016-06-24 10:43:46 +02:00
|
|
|
|
|
|
|
u32 m_vertexDrawOffset;
|
|
|
|
u32 m_indexDrawOffset;
|
|
|
|
u32 m_currentBuffer;
|
|
|
|
u32 m_bufferCursor;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAX_BUFFER_COUNT = 2
|
|
|
|
};
|
|
|
|
ID3D11Buffer* m_buffers[MAX_BUFFER_COUNT];
|
|
|
|
|
|
|
|
std::vector<u8> LocalVBuffer;
|
|
|
|
std::vector<u16> LocalIBuffer;
|
2010-10-03 00:41:06 +00:00
|
|
|
};
|
2010-06-13 19:50:06 +00:00
|
|
|
|
|
|
|
} // namespace
|