summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKlaus Schnass <[email protected]>2010-02-26 15:09:50 -0500
committerAlex Deucher <[email protected]>2010-02-26 15:26:51 -0500
commit424a8385e4d07860c6deca12c43d6c31698a29ed (patch)
treeae6588d7547e70f21059d4eeee6c24eb0bff5186 /src
parentd1fe9bcc3f07a73b3122851731d5081580d8bb8f (diff)
r600: fail to validate unsupported texture formats
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r600/r600_texstate.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c
index dd33ef3c6a2..1600033b9bd 100644
--- a/src/mesa/drivers/dri/r600/r600_texstate.c
+++ b/src/mesa/drivers/dri/r600/r600_texstate.c
@@ -373,17 +373,11 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
break;
*/
case MESA_FORMAT_RGB_DXT1: /* not supported yet */
-
- break;
case MESA_FORMAT_RGBA_DXT1: /* not supported yet */
-
- break;
case MESA_FORMAT_RGBA_DXT3: /* not supported yet */
-
- break;
case MESA_FORMAT_RGBA_DXT5: /* not supported yet */
+ return GL_FALSE;
- break;
case MESA_FORMAT_RGBA_FLOAT32:
SETfield(t->SQ_TEX_RESOURCE1, FMT_32_32_32_32_FLOAT,
SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
@@ -701,8 +695,8 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj)
t = radeon_tex_obj(tObj);
- r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat);
-
+ if(!r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat))
+ t->validated = GL_FALSE;
}
/**
@@ -711,7 +705,7 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj)
* \param rmesa Context pointer
* \param t the r300 texture object
*/
-static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit)
+static GLboolean setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texObj, int unit)
{
context_t *rmesa = R700_CONTEXT(ctx);
radeonTexObj *t = radeon_tex_obj(texObj);
@@ -721,15 +715,15 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO
if (rmesa->radeon.radeonScreen->driScreen->dri2.enabled &&
t->image_override &&
t->bo)
- return;
+ return GL_TRUE;
firstImage = t->base.Image[0][t->minLod];
if (!t->image_override) {
if (!r600GetTexFormat(texObj, firstImage->TexFormat)) {
- radeon_error("unexpected texture format in %s\n",
- __FUNCTION__);
- return;
+ radeon_warning("unsupported texture format in %s\n",
+ __FUNCTION__);
+ return GL_FALSE;
}
}
@@ -754,7 +748,7 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO
break;
default:
radeon_error("unexpected texture target type in %s\n", __FUNCTION__);
- return;
+ return GL_FALSE;
}
row_align = rmesa->radeon.texture_row_align - 1;
@@ -799,6 +793,7 @@ static void setup_hardware_state(GLcontext * ctx, struct gl_texture_object *texO
CLEARfield(t->SQ_TEX_SAMPLER0, DEPTH_COMPARE_FUNCTION_mask);
}
+ return GL_TRUE;
}
/**
@@ -815,7 +810,8 @@ static GLboolean r600_validate_texture(GLcontext * ctx, struct gl_texture_object
/* Configure the hardware registers (more precisely, the cached version
* of the hardware registers). */
- setup_hardware_state(ctx, texObj, unit);
+ if (!setup_hardware_state(ctx, texObj, unit))
+ return GL_FALSE;
t->validated = GL_TRUE;
return GL_TRUE;