Updates to support instanced rendering (OpenGL only)

This commit is contained in:
Jack Andersen
2015-11-24 16:14:30 -10:00
parent 8682485dea
commit 3bcfa99b5a
5 changed files with 54 additions and 11 deletions

View File

@@ -48,7 +48,7 @@ public:
IShaderDataBinding*
newShaderDataBinding(IShaderPipeline* pipeline,
IVertexFormat* vtxFormat,
IGraphicsBuffer* vbo, IGraphicsBuffer* ibo,
IGraphicsBuffer* vbo, IGraphicsBuffer* instVbo, IGraphicsBuffer* ibo,
size_t ubufCount, IGraphicsBuffer** ubufs,
size_t texCount, ITexture** texs);

View File

@@ -24,6 +24,12 @@ struct IGraphicsCommandQueue
virtual void setRenderTarget(ITextureR* target)=0;
virtual void setViewport(const SWindowRect& rect)=0;
/**
* @brief Which dynamic buffer slot is being populated for pending command list
* @return Index [0,2] indicating the buffer slot
*/
virtual int pendingDynamicSlot()=0;
virtual void resizeRenderTexture(ITextureR* tex, size_t width, size_t height)=0;
virtual void flushBufferUpdates()=0;

View File

@@ -100,12 +100,18 @@ struct IVertexFormat {};
/** Types of vertex attributes */
enum class VertexSemantic
{
None = 0,
Position,
Normal,
Color,
UV,
Weight
UV4,
Weight,
ModelView,
SemanticMask = 0xf,
Instanced = 0x10
};
ENABLE_BITWISE_ENUM(VertexSemantic)
/** Used to create IVertexFormat */
struct VertexElementDescriptor
@@ -147,7 +153,9 @@ enum class BlendFactor
SrcAlpha,
InvSrcAlpha,
DstAlpha,
InvDstAlpha
InvDstAlpha,
SrcColor1,
InvSrcColor1
};
/** Factory object for creating batches of resources as an IGraphicsData token */
@@ -196,7 +204,7 @@ struct IGraphicsDataFactory
virtual IShaderDataBinding*
newShaderDataBinding(IShaderPipeline* pipeline,
IVertexFormat* vtxFormat,
IGraphicsBuffer* vbo, IGraphicsBuffer* ibo,
IGraphicsBuffer* vbo, IGraphicsBuffer* instVbo, IGraphicsBuffer* ibo,
size_t ubufCount, IGraphicsBuffer** ubufs,
size_t texCount, ITexture** texs)=0;