aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-03-25 10:20:34 +0100
committermarha <marha@users.sourceforge.net>2013-03-25 10:20:34 +0100
commit176eab9e8277db1549bfc6c9ae805c4e1858f0b0 (patch)
treea4c8d2d939aa500304d979377e39316b115a8128 /mesalib/src/mesa/main/teximage.c
parent9c17f511266fff48a936633de280f271f0ce0c11 (diff)
downloadvcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.tar.gz
vcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.tar.bz2
vcxsrv-176eab9e8277db1549bfc6c9ae805c4e1858f0b0.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/teximage.c')
-rw-r--r--mesalib/src/mesa/main/teximage.c34
1 files changed, 7 insertions, 27 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index 4042e7969..bc755ae79 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -40,6 +40,7 @@
#include "imports.h"
#include "macros.h"
#include "mfeatures.h"
+#include "multisample.h"
#include "state.h"
#include "texcompress.h"
#include "texcompress_cpal.h"
@@ -4199,6 +4200,7 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
struct gl_texture_image *texImage;
GLboolean sizeOK, dimensionsOK;
gl_format texFormat;
+ GLenum sample_count_error;
GET_CURRENT_CONTEXT(ctx);
@@ -4225,35 +4227,13 @@ teximagemultisample(GLuint dims, GLenum target, GLsizei samples,
return;
}
- if (_mesa_is_enum_format_integer(internalformat)) {
- if (samples > ctx->Const.MaxIntegerSamples) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%uDMultisample(samples>GL_MAX_INTEGER_SAMPLES)",
- dims);
- return;
- }
- }
- else if (_mesa_is_depth_or_stencil_format(internalformat)) {
- if (samples > ctx->Const.MaxDepthTextureSamples) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%uDMultisample(samples>GL_MAX_DEPTH_TEXTURE_SAMPLES)",
- dims);
- return;
- }
- }
- else {
- if (samples > ctx->Const.MaxColorTextureSamples) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glTexImage%uDMultisample(samples>GL_MAX_COLOR_TEXTURE_SAMPLES)",
- dims);
- return;
- }
+ sample_count_error = _mesa_check_sample_count(ctx, target,
+ internalformat, samples);
+ if (sample_count_error != GL_NO_ERROR) {
+ _mesa_error(ctx, sample_count_error, "glTexImage%uDMultisample(samples)", dims);
+ return;
}
- /* TODO: should ask the driver for the exact limit for this internalformat
- * once IDR's internalformat_query bits land
- */
-
texObj = _mesa_get_current_tex_object(ctx, target);
texImage = _mesa_get_tex_image(ctx, texObj, 0, 0);