aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texobj.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
committermarha <marha@users.sourceforge.net>2012-03-23 10:05:55 +0100
commit0f834b91a4768673833ab4917e87d86c237bb1a6 (patch)
tree363489504ed4b2d360259b8de4c9e392918e5d02 /mesalib/src/mesa/main/texobj.h
parentfc72edebf875378459368c5383d9023730cbca54 (diff)
downloadvcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.gz
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.tar.bz2
vcxsrv-0f834b91a4768673833ab4917e87d86c237bb1a6.zip
libX11 xserver fontconfig mesa pixman xkbcomp xkeyboard-config git update
23 Mar 2012
Diffstat (limited to 'mesalib/src/mesa/main/texobj.h')
-rw-r--r--mesalib/src/mesa/main/texobj.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/texobj.h b/mesalib/src/mesa/main/texobj.h
index 03dfbe304..c020b9013 100644
--- a/mesalib/src/mesa/main/texobj.h
+++ b/mesalib/src/mesa/main/texobj.h
@@ -35,6 +35,7 @@
#include "compiler.h"
#include "glheader.h"
#include "mtypes.h"
+#include "samplerobj.h"
/**
@@ -77,6 +78,26 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
}
+/** Is the texture "complete" with respect to the given sampler state? */
+static inline GLboolean
+_mesa_is_texture_complete(const struct gl_texture_object *texObj,
+ const struct gl_sampler_object *sampler)
+{
+ if (texObj->_IsIntegerFormat &&
+ (sampler->MagFilter != GL_NEAREST ||
+ (sampler->MinFilter != GL_NEAREST &&
+ sampler->MinFilter != GL_NEAREST_MIPMAP_NEAREST))) {
+ /* If the format is integer, only nearest filtering is allowed */
+ return GL_FALSE;
+ }
+
+ if (_mesa_is_mipmap_filter(sampler))
+ return texObj->_MipmapComplete;
+ else
+ return texObj->_BaseComplete;
+}
+
+
extern void
_mesa_test_texobj_completeness( const struct gl_context *ctx,
struct gl_texture_object *obj );