Add a new “stencil8” pixel format for Canvases (resolves issue #1003).

Also fixed Canvas MSAA (resolves issue #1271).

stencil-formatted Canvases can’t be drawn, and can only be used as the value for a new ‘depthstencil’ field to the table-argument variant of love.graphics.setCanvas.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2017-04-11 00:00:22 -03:00
parent 08a377ff30
commit 018a3831cb
23 changed files with 518 additions and 321 deletions
+8 -10
View File
@@ -56,20 +56,19 @@ public:
int getMSAA() const override
{
return actual_samples;
return actualSamples;
}
int getRequestedMSAA() const override
{
return settings.msaa;
return requestedSamples;
}
ptrdiff_t getMSAAHandle() const override
ptrdiff_t getRenderTargetHandle() const override
{
return msaa_buffer;
return renderbuffer != 0 ? renderbuffer : texture;
}
inline GLenum getStatus() const
{
return status;
@@ -87,18 +86,17 @@ public:
private:
Settings settings;
GLuint fbo;
GLuint texture;
GLuint msaa_buffer;
GLuint renderbuffer;
GLenum status;
int actual_samples;
int requestedSamples;
int actualSamples;
size_t texture_memory;
size_t textureMemory;
static bool supportedFormats[PIXELFORMAT_MAX_ENUM];
static bool checkedFormats[PIXELFORMAT_MAX_ENUM];