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/3622 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGLESv2/Context.cpp b/src/OpenGL/libGLESv2/Context.cpp index 7776ddc..2d1c16b 100644 --- a/src/OpenGL/libGLESv2/Context.cpp +++ b/src/OpenGL/libGLESv2/Context.cpp
@@ -1994,7 +1994,7 @@ } break; case GL_SAMPLES: - *params = samples & ~1; + *params = samples; break; } } @@ -3845,14 +3845,14 @@ 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;
diff --git a/src/OpenGL/libGLESv2/Renderbuffer.cpp b/src/OpenGL/libGLESv2/Renderbuffer.cpp index 9894e57..9923956 100644 --- a/src/OpenGL/libGLESv2/Renderbuffer.cpp +++ b/src/OpenGL/libGLESv2/Renderbuffer.cpp
@@ -464,7 +464,7 @@ mHeight = height; this->format = format; internalFormat = requestedFormat; - mSamples = supportedSamples & ~1; + mSamples = supportedSamples; } Colorbuffer::~Colorbuffer() @@ -542,7 +542,7 @@ mHeight = height; format = GL_DEPTH24_STENCIL8_OES; internalFormat = sw::FORMAT_D24S8; - mSamples = supportedSamples & ~1; + mSamples = supportedSamples; } DepthStencilbuffer::~DepthStencilbuffer()