10#include "ps2s/packet.h"
21 uint64_t PrimType : 3;
22 uint64_t Lighting : 1;
23 uint64_t NumDirLights : 2;
24 uint64_t NumPtLights : 3;
26 uint64_t Specular : 1;
27 uint64_t PerVtxMaterial : 3;
28 uint64_t Clipping : 2;
29 uint64_t CullFace : 1;
30 uint64_t TwoSidedLighting : 1;
31 uint64_t ArrayAccess : 2;
35 uint64_t UserProps : 32;
39 inline operator uint64_t()
const
45 uint64_t* value = (uint64_t*)
this;
49 inline void operator=(uint64_t value)
56} __attribute__((aligned(8)));
58namespace RendererProps {
59typedef enum { kPtsLinesStripsFans = 1 << 0,
61 kQuads = 1 << 2 } tPrimType;
63typedef enum { k3DirLights = 1 << 0,
64 k8DirLights = 1 << 1 } tNumDirLights;
66typedef enum { k1PtLight = 1 << 0,
68 k8PtLights = 1 << 2 } tNumPtLights;
70typedef enum { kNoMaterial = 1 << 0,
72 kSpecular = 1 << 2 } tPerVtxMaterial;
74typedef enum { kLinear = 1 << 0,
75 kIndexed = 1 << 1 } tArrayAccess;
77typedef enum { kNonClipped = 1 << 0,
78 kClipped = 1 << 1 } tClipping;
91 uint64_t Capabilities;
92 uint64_t Requirements;
102 void SetCapabilities(uint64_t caps) { Capabilities = caps; }
103 void SetRequirements(uint64_t reqs) { Requirements = reqs; }
106 virtual uint64_t GetCapabilities()
const {
return Capabilities; }
107 virtual uint64_t GetRequirements()
const {
return Requirements; }
119 virtual void InitContext(GLenum primType, uint32_t rcChanges,
bool userRcChanged) = 0;
127 mError(
"This renderer doesn't do linear arrays");
132 mError(
"This renderer doesn't do indexed arrays");
virtual bool GetCachePackets(const CGeometryBlock &geometry)=0
virtual void DrawIndexedArrays(CGeometryBlock &block)
Draw arrays of vertices that are accessed by index (i.e., glDrawElements)
virtual void DrawLinearArrays(CGeometryBlock &block)
Draw arrays of vertices that are accessed linearly (i.e., glDrawArrays)
virtual void Load()=0
Load the renderer into vu0/vu1 memory.
virtual const char * GetName()=0
Return a pointer to the text name of this renderer.
virtual int GetPacketQwordSize(const CGeometryBlock &geometry)=0
virtual CRendererProps GetRenderContextDeps()=0
virtual void InitContext(GLenum primType, uint32_t rcChanges, bool userRcChanged)=0