aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fbobject.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-25 10:20:34 +0100
committermarha <marha@users.sourceforge.net>2013-04-11 11:13:37 +0200
commitdde22e946ccfb0bd937224daf42403b80528c2a6 (patch)
treec4235cb922c8cd854bc3ef2e670bb6802dc743de /mesalib/src/mesa/main/fbobject.c
parentaccd8a3364ffd1e91a4ab52b06b5e3b9d250ae92 (diff)
downloadvcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.tar.gz
vcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.tar.bz2
vcxsrv-dde22e946ccfb0bd937224daf42403b80528c2a6.zip
fontconfig mesa pixman xserver git update 25 Mar 2013
xserver commit 2967391c6d35f03121afa8003e0fb94b62495129 pixman commit d8ac35af1208a4fa4d67f03fee10b5449fb8495a fontconfig commit b561ff2016ce84eef3c81f16dfb0481be6a13f9b mesa commit 92b8a37fdfff9e83f39b8885f51ed2f60326ab6a
Diffstat (limited to 'mesalib/src/mesa/main/fbobject.c')
-rw-r--r--mesalib/src/mesa/main/fbobject.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 0126e2930..3fdf62667 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -43,6 +43,7 @@
#include "hash.h"
#include "macros.h"
#include "mfeatures.h"
+#include "multisample.h"
#include "mtypes.h"
#include "renderbuffer.h"
#include "state.h"
@@ -474,6 +475,32 @@ _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
/**
+ * Return true if the framebuffer has a combined depth/stencil
+ * renderbuffer attached.
+ */
+GLboolean
+_mesa_has_depthstencil_combined(const struct gl_framebuffer *fb)
+{
+ const struct gl_renderbuffer_attachment *depth =
+ &fb->Attachment[BUFFER_DEPTH];
+ const struct gl_renderbuffer_attachment *stencil =
+ &fb->Attachment[BUFFER_STENCIL];
+
+ if (depth->Type == stencil->Type) {
+ if (depth->Type == GL_RENDERBUFFER_EXT &&
+ depth->Renderbuffer == stencil->Renderbuffer)
+ return GL_TRUE;
+
+ if (depth->Type == GL_TEXTURE &&
+ depth->Texture == stencil->Texture)
+ return GL_TRUE;
+ }
+
+ return GL_FALSE;
+}
+
+
+/**
* For debug only.
*/
static void
@@ -1466,6 +1493,7 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
"glRenderbufferStorage" : "glRenderbufferStorageMultisample";
struct gl_renderbuffer *rb;
GLenum baseFormat;
+ GLenum sample_count_error;
GET_CURRENT_CONTEXT(ctx);
if (MESA_VERBOSE & VERBOSE_API) {
@@ -1509,9 +1537,14 @@ renderbuffer_storage(GLenum target, GLenum internalFormat,
/* NumSamples == 0 indicates non-multisampling */
samples = 0;
}
- else if (samples > (GLsizei) ctx->Const.MaxSamples) {
- /* note: driver may choose to use more samples than what's requested */
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func);
+
+ /* check the sample count;
+ * note: driver may choose to use more samples than what's requested
+ */
+ sample_count_error = _mesa_check_sample_count(ctx, target,
+ internalFormat, samples);
+ if (sample_count_error != GL_NO_ERROR) {
+ _mesa_error(ctx, sample_count_error, "%s(samples)", func);
return;
}