Simplify and centralize multisample counts.

Change-Id: I012bb669444e28f844c5571ff639b31dd1a35e1d
Reviewed-on: https://swiftshader-review.googlesource.com/3950
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGL/Renderbuffer.cpp b/src/OpenGL/libGL/Renderbuffer.cpp
index 458a69f..ea65da0 100644
--- a/src/OpenGL/libGL/Renderbuffer.cpp
+++ b/src/OpenGL/libGL/Renderbuffer.cpp
@@ -336,12 +336,12 @@
 	}
 }
 
-Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) : mRenderTarget(NULL)
+Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) : mRenderTarget(nullptr)
 {
 	Device *device = getDevice();
 
 	sw::Format requestedFormat = es2sw::ConvertRenderbufferFormat(format);
-	int supportedSamples = Context::getSupportedMultiSampleDepth(requestedFormat, samples);
+	int supportedSamples = Context::getSupportedMultisampleCount(samples);
 
 	if(width > 0 && height > 0)
 	{
@@ -395,13 +395,11 @@
 	}
 }
 
-DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples)
+DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples) : mDepthStencil(nullptr)
 {
 	Device *device = getDevice();
 
-	mDepthStencil = NULL;
-	
-	int supportedSamples = Context::getSupportedMultiSampleDepth(sw::FORMAT_D24S8, samples);
+	int supportedSamples = Context::getSupportedMultisampleCount(samples);
 
 	if(width > 0 && height > 0)
 	{