r600: fail to validate unsupported texture formats
This commit is contained in:
committed by
Alex Deucher
parent
d1fe9bcc3f
commit
424a8385e4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user