dolphin/Source/Core/VideoBackends/D3D/VertexManager.h

51 lines
1007 B
C
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
2015-05-17 23:08:10 +00:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <memory>
#include "VideoCommon/VertexManagerBase.h"
struct ID3D11Buffer;
namespace DX11
{
class VertexManager : public VertexManagerBase
{
public:
VertexManager();
~VertexManager();
std::unique_ptr<NativeVertexFormat>
CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl) override;
void CreateDeviceObjects() override;
void DestroyDeviceObjects() override;
protected:
void ResetBuffer(u32 stride) override;
u16* GetIndexBuffer() { return &LocalIBuffer[0]; }
private:
void PrepareDrawBuffers(u32 stride);
void Draw(u32 stride);
// temp
void vFlush() override;
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;
};
} // namespace