Renderer: Move cull mode to a rasterization state object

Also moves logic for primitive handling to VideoCommon.
This commit is contained in:
Stenzek
2017-04-30 18:07:57 +10:00
parent 2869c570f1
commit 836b9b9acb
38 changed files with 389 additions and 450 deletions

View File

@ -9,19 +9,13 @@
#include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h"
#include "VideoCommon/RenderState.h"
class DataReader;
class NativeVertexFormat;
class PointerWrap;
struct PortableVertexDeclaration;
enum PrimitiveType
{
PRIMITIVE_POINTS,
PRIMITIVE_LINES,
PRIMITIVE_TRIANGLES,
};
struct Slope
{
float dfdx;
@ -51,6 +45,7 @@ public:
// needs to be virtual for DX11's dtor
virtual ~VertexManagerBase();
PrimitiveType GetCurrentPrimitiveType() const { return m_current_primitive_type; }
DataReader PrepareForAdditionalData(int primitive, u32 count, u32 stride, bool cullall);
void FlushData(u32 count, u32 stride);
@ -65,8 +60,6 @@ public:
protected:
virtual void vDoState(PointerWrap& p) {}
PrimitiveType m_current_primitive_type = PrimitiveType::PRIMITIVE_POINTS;
virtual void ResetBuffer(u32 stride) = 0;
u8* m_cur_buffer_pointer = nullptr;
@ -80,6 +73,7 @@ protected:
void CalculateZSlope(NativeVertexFormat* format);
bool m_cull_all = false;
PrimitiveType m_current_primitive_type = PrimitiveType::Points;
private:
bool m_is_flushed = true;