aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-09-12 15:03:12 +0000
committerBrian Paul <[email protected]>2003-09-12 15:03:12 +0000
commit973da83f6237b5af4a9ee77f32fdfa5c04ecabc8 (patch)
treef5fe8c25f0c960dc26ac958ca96fe41658a3e55e /src/mesa/main/texobj.c
parent5c480a4887aaca56bd70bde91bddbc13f71e721e (diff)
Allow glTexImage1/2/3D to specify width/height/depth = 0.
This allows texture state to be resettable to default state. Not allowed according to the spec, but allowed by all other OpenGL libs.
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 6edb7e65655..08c59a0854d 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -310,6 +310,15 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
return;
}
+ /* Check width/height/depth for zero */
+ if (t->Image[baseLevel]->Width == 0 ||
+ t->Image[baseLevel]->Height == 0 ||
+ t->Image[baseLevel]->Depth == 0) {
+ incomplete(t, "texture width = 0");
+ t->Complete = GL_FALSE;
+ return;
+ }
+
/* Compute _MaxLevel */
if (t->Target == GL_TEXTURE_1D) {
maxLog2 = t->Image[baseLevel]->WidthLog2;
@@ -559,7 +568,6 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
}
else if (t->Target == GL_TEXTURE_RECTANGLE_NV) {
/* XXX special checking? */
-
}
else {
/* Target = ??? */