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:
Alex Szpakowski
2020-06-13 20:29:23 -03:00
parent 6cd4b3e3f7
commit 9d2dca5740
15 changed files with 324 additions and 55 deletions
+15 -1
View File
@@ -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