mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
metal: avoid redundant resource binding calls.
This commit is contained in:
@@ -39,6 +39,17 @@ class Graphics final : public love::graphics::Graphics
|
||||
{
|
||||
public:
|
||||
|
||||
struct RenderEncoderBindings
|
||||
{
|
||||
void *textures[32][ShaderStage::STAGE_MAX_ENUM];
|
||||
void *samplers[32][ShaderStage::STAGE_MAX_ENUM];
|
||||
struct
|
||||
{
|
||||
void *buffer;
|
||||
size_t offset;
|
||||
} buffers[32][ShaderStage::STAGE_MAX_ENUM];
|
||||
};
|
||||
|
||||
Graphics();
|
||||
virtual ~Graphics();
|
||||
|
||||
@@ -153,17 +164,6 @@ private:
|
||||
STATEBIT_ALL = 0xFFFFFFFF
|
||||
};
|
||||
|
||||
struct RenderState
|
||||
{
|
||||
Rect viewport = {0, 0, 0, 0};
|
||||
ScissorState scissor;
|
||||
BlendState blend;
|
||||
DepthState depth;
|
||||
StencilState stencil;
|
||||
ColorChannelMask colorChannelMask;
|
||||
Shader *shader;
|
||||
};
|
||||
|
||||
struct DeviceFamilies
|
||||
{
|
||||
// All arrays are 1-indexed for convenience
|
||||
@@ -213,6 +213,8 @@ private:
|
||||
|
||||
AttachmentStoreActions attachmentStoreActions;
|
||||
|
||||
RenderEncoderBindings renderBindings;
|
||||
|
||||
StreamBuffer *uniformBuffer;
|
||||
StreamBuffer::MapInfo uniformBufferData;
|
||||
size_t uniformBufferOffset;
|
||||
|
||||
Reference in New Issue
Block a user