mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
6b01839525
We are used to render them out of order as long as everything else matches, but rendering order does matter, so we have to flush on primitive switch. This commit implements this flush. Also as we flush on primitive switch, we don't have to create three different index buffers. All indices are now stored in one buffer. This will slow down games which switch often primitive types (eg ztp), but it should be more accurate.
49 lines
940 B
C++
49 lines
940 B
C++
// Copyright 2013 Dolphin Emulator Project
|
|
// Licensed under GPLv2
|
|
// Refer to the license.txt file included.
|
|
|
|
#ifndef _VERTEXMANAGER_H
|
|
#define _VERTEXMANAGER_H
|
|
|
|
#include "VertexManagerBase.h"
|
|
#include "LineGeometryShader.h"
|
|
#include "PointGeometryShader.h"
|
|
|
|
namespace DX11
|
|
{
|
|
|
|
class VertexManager : public ::VertexManager
|
|
{
|
|
public:
|
|
VertexManager();
|
|
~VertexManager();
|
|
|
|
NativeVertexFormat* CreateNativeVertexFormat();
|
|
void CreateDeviceObjects();
|
|
void DestroyDeviceObjects();
|
|
|
|
private:
|
|
|
|
void PrepareDrawBuffers();
|
|
void Draw(u32 stride);
|
|
// temp
|
|
void vFlush();
|
|
|
|
u32 m_vertex_buffer_cursor;
|
|
u32 m_vertex_draw_offset;
|
|
u32 m_index_buffer_cursor;
|
|
u32 m_index_draw_offset;
|
|
u32 m_current_vertex_buffer;
|
|
u32 m_current_index_buffer;
|
|
typedef ID3D11Buffer* PID3D11Buffer;
|
|
PID3D11Buffer* m_index_buffers;
|
|
PID3D11Buffer* m_vertex_buffers;
|
|
|
|
LineGeometryShader m_lineShader;
|
|
PointGeometryShader m_pointShader;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif
|