mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
metal: nogame and error screens work.
- implement love.graphics.setColor - implement default textures - hacky implementation of default uniform data - use texture swizzles to set up LA8 (text) texture data - shader reflection work
This commit is contained in:
@@ -109,12 +109,17 @@ public:
|
||||
|
||||
id<MTLSamplerState> getCachedSampler(const SamplerState &s);
|
||||
|
||||
static Graphics *getInstance() { return Module::getInstance<Graphics>(M_GRAPHICS); }
|
||||
StreamBuffer *getUniformBuffer() const { return uniformBuffer; }
|
||||
Buffer *getDefaultAttributesBuffer() const { return defaultAttributesBuffer; }
|
||||
|
||||
static Graphics *getInstance() { return graphicsInstance; }
|
||||
|
||||
id<MTLDevice> device;
|
||||
|
||||
private:
|
||||
|
||||
static Graphics *graphicsInstance;
|
||||
|
||||
enum StateType
|
||||
{
|
||||
STATE_BLEND,
|
||||
@@ -166,6 +171,7 @@ private:
|
||||
|
||||
id<MTLDepthStencilState> getCachedDepthStencilState(const DepthState &depth, const StencilState &stencil);
|
||||
void applyRenderState(id<MTLRenderCommandEncoder> renderEncoder, const vertex::Attributes &attributes);
|
||||
void applyShaderUniforms(id<MTLRenderCommandEncoder> renderEncoder, Shader *shader);
|
||||
|
||||
id<MTLCommandQueue> commandQueue;
|
||||
|
||||
@@ -180,6 +186,14 @@ private:
|
||||
uint32 dirtyRenderState;
|
||||
bool windowHasStencil;
|
||||
|
||||
StreamBuffer *uniformBuffer;
|
||||
StreamBuffer::MapInfo uniformBufferData;
|
||||
size_t uniformBufferOffset;
|
||||
|
||||
Buffer *defaultAttributesBuffer;
|
||||
|
||||
Texture *defaultTextures[TEXTURE_MAX_ENUM];
|
||||
|
||||
std::map<uint64, void *> cachedSamplers;
|
||||
|
||||
}; // Graphics
|
||||
|
||||
Reference in New Issue
Block a user