mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
metal: don't try to enable blending with integer canvases.
This commit is contained in:
@@ -1001,7 +1001,7 @@ void Graphics::applyRenderState(id<MTLRenderCommandEncoder> encoder, const Verte
|
|||||||
key.blend = state.blend;
|
key.blend = state.blend;
|
||||||
key.colorChannelMask = state.colorMask;
|
key.colorChannelMask = state.colorMask;
|
||||||
|
|
||||||
pipeline = shader->getCachedRenderPipeline(key);
|
pipeline = shader->getCachedRenderPipeline(this, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
[encoder setRenderPipelineState:pipeline];
|
[encoder setRenderPipelineState:pipeline];
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
ptrdiff_t getHandle() const override { return 0; }
|
ptrdiff_t getHandle() const override { return 0; }
|
||||||
void setVideoTextures(love::graphics::Texture *ytexture, love::graphics::Texture *cbtexture, love::graphics::Texture *crtexture) override;
|
void setVideoTextures(love::graphics::Texture *ytexture, love::graphics::Texture *cbtexture, love::graphics::Texture *crtexture) override;
|
||||||
|
|
||||||
id<MTLRenderPipelineState> getCachedRenderPipeline(const RenderPipelineKey &key);
|
id<MTLRenderPipelineState> getCachedRenderPipeline(Graphics *gfx, const RenderPipelineKey &key);
|
||||||
id<MTLComputePipelineState> getComputePipeline() const { return computePipeline; }
|
id<MTLComputePipelineState> getComputePipeline() const { return computePipeline; }
|
||||||
|
|
||||||
static int getUniformBufferBinding();
|
static int getUniformBufferBinding();
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ void Shader::setVideoTextures(love::graphics::Texture *ytexture, love::graphics:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id<MTLRenderPipelineState> Shader::getCachedRenderPipeline(const RenderPipelineKey &key)
|
id<MTLRenderPipelineState> Shader::getCachedRenderPipeline(graphics::Graphics *gfx, const RenderPipelineKey &key)
|
||||||
{
|
{
|
||||||
auto it = cachedRenderPipelines.find(key);
|
auto it = cachedRenderPipelines.find(key);
|
||||||
|
|
||||||
@@ -882,7 +882,7 @@ id<MTLRenderPipelineState> Shader::getCachedRenderPipeline(const RenderPipelineK
|
|||||||
auto formatdesc = Metal::convertPixelFormat(device, format);
|
auto formatdesc = Metal::convertPixelFormat(device, format);
|
||||||
attachment.pixelFormat = formatdesc.format;
|
attachment.pixelFormat = formatdesc.format;
|
||||||
|
|
||||||
if (key.blend.enable)
|
if (key.blend.enable && gfx->isPixelFormatSupported(format, PIXELFORMATUSAGEFLAGS_BLEND))
|
||||||
{
|
{
|
||||||
attachment.blendingEnabled = YES;
|
attachment.blendingEnabled = YES;
|
||||||
attachment.sourceRGBBlendFactor = getMTLBlendFactor(key.blend.srcFactorRGB);
|
attachment.sourceRGBBlendFactor = getMTLBlendFactor(key.blend.srcFactorRGB);
|
||||||
|
|||||||
Reference in New Issue
Block a user