Commit 7a57040f by Alexis Hetu Committed by Alexis Hétu

Multisampling value of 1

Setting a multisampling values of 0 or 1 are apparently 2 different cases, so I tried removing the even number check to fix this. It didn't break any tests, but I'm not sure how well this is covered by the tests. Change-Id: I0e7de9b153288f0c07bde9a2f104ea1d2bf230ac Reviewed-on: https://swiftshader-review.googlesource.com/3622Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 8e8a7e85
......@@ -1414,7 +1414,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
}
break;
case GL_SAMPLES:
*params = samples & ~1;
*params = samples;
break;
}
}
......@@ -2687,14 +2687,14 @@ GLenum Context::getError()
int Context::getSupportedMultiSampleDepth(sw::Format format, int requested)
{
if(requested <= 1)
if(requested <= 0)
{
return 1;
return 0;
}
if(requested == 2)
if(requested <= 2)
{
return 2;
return requested;
}
return 4;
......
......@@ -358,7 +358,7 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples)
mHeight = height;
this->format = format;
internalFormat = requestedFormat;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
Colorbuffer::~Colorbuffer()
......@@ -418,7 +418,7 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
mHeight = height;
format = GL_DEPTH24_STENCIL8_EXT;
internalFormat = sw::FORMAT_D24S8;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
DepthStencilbuffer::~DepthStencilbuffer()
......
......@@ -1260,7 +1260,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
}
break;
case GL_SAMPLES:
*params = samples & ~1;
*params = samples;
break;
}
}
......@@ -2943,14 +2943,14 @@ GLenum Context::getError()
int Context::getSupportedMultiSampleDepth(sw::Format format, int requested)
{
if(requested <= 1)
if(requested <= 0)
{
return 1;
return 0;
}
if(requested == 2)
if(requested <= 2)
{
return 2;
return requested;
}
return 4;
......
......@@ -319,7 +319,7 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples)
mHeight = height;
this->format = format;
internalFormat = requestedFormat;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
Colorbuffer::~Colorbuffer()
......@@ -397,7 +397,7 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
mHeight = height;
format = GL_DEPTH24_STENCIL8_OES;
internalFormat = sw::FORMAT_D24S8;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
DepthStencilbuffer::~DepthStencilbuffer()
......
......@@ -1994,7 +1994,7 @@ template<typename T> bool Context::getIntegerv(GLenum pname, T *params) const
}
break;
case GL_SAMPLES:
*params = samples & ~1;
*params = samples;
break;
}
}
......@@ -3845,14 +3845,14 @@ GLenum Context::getError()
int Context::getSupportedMultiSampleDepth(sw::Format format, int requested)
{
if(requested <= 1)
if(requested <= 0)
{
return 1;
return 0;
}
if(requested == 2)
if(requested <= 2)
{
return 2;
return requested;
}
return 4;
......
......@@ -464,7 +464,7 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples)
mHeight = height;
this->format = format;
internalFormat = requestedFormat;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
Colorbuffer::~Colorbuffer()
......@@ -542,7 +542,7 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
mHeight = height;
format = GL_DEPTH24_STENCIL8_OES;
internalFormat = sw::FORMAT_D24S8;
mSamples = supportedSamples & ~1;
mSamples = supportedSamples;
}
DepthStencilbuffer::~DepthStencilbuffer()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment