intel: Remove pointless boolean return value from *_miptree_layout.

i915_miptree_layout, i945_miptree_layout, and brw_miptree_layout always
just return GL_TRUE, so there's really no point to it.  Change them to
void functions and remove the (dead) error checking code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Kenneth Graunke 2011-09-23 22:42:18 -07:00
parent 0d949a51bb
commit d7cdbc3c54
4 changed files with 11 additions and 24 deletions

View file

@ -224,7 +224,7 @@ i915_miptree_layout_2d(struct intel_mipmap_tree * mt)
}
}
GLboolean
void
i915_miptree_layout(struct intel_mipmap_tree * mt)
{
switch (mt->target) {
@ -246,8 +246,6 @@ i915_miptree_layout(struct intel_mipmap_tree * mt)
DBG("%s: %dx%dx%d\n", __FUNCTION__,
mt->total_width, mt->total_height, mt->cpp);
return GL_TRUE;
}
@ -455,7 +453,7 @@ i945_miptree_layout_3d(struct intel_mipmap_tree * mt)
}
}
GLboolean
void
i945_miptree_layout(struct intel_mipmap_tree * mt)
{
switch (mt->target) {
@ -480,6 +478,4 @@ i945_miptree_layout(struct intel_mipmap_tree * mt)
DBG("%s: %dx%dx%d\n", __FUNCTION__,
mt->total_width, mt->total_height, mt->cpp);
return GL_TRUE;
}

View file

@ -39,8 +39,8 @@
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
GLboolean brw_miptree_layout(struct intel_context *intel,
struct intel_mipmap_tree *mt)
void
brw_miptree_layout(struct intel_context *intel, struct intel_mipmap_tree *mt)
{
/* XXX: these vary depending on image format: */
/* GLint align_w = 4; */
@ -166,7 +166,5 @@ GLboolean brw_miptree_layout(struct intel_context *intel,
}
DBG("%s: %dx%dx%d\n", __FUNCTION__,
mt->total_width, mt->total_height, mt->cpp);
return GL_TRUE;
}

View file

@ -63,7 +63,6 @@ intel_miptree_create_internal(struct intel_context *intel,
GLuint height0,
GLuint depth0)
{
GLboolean ok;
struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
int compress_byte = 0;
@ -89,19 +88,13 @@ intel_miptree_create_internal(struct intel_context *intel,
#ifdef I915
(void) intel;
if (intel->is_945)
ok = i945_miptree_layout(mt);
i945_miptree_layout(mt);
else
ok = i915_miptree_layout(mt);
i915_miptree_layout(mt);
#else
ok = brw_miptree_layout(intel, mt);
brw_miptree_layout(intel, mt);
#endif
if (!ok) {
free(mt);
DBG("%s not okay - returning NULL\n", __FUNCTION__);
return NULL;
}
return mt;
}

View file

@ -211,9 +211,9 @@ void intel_miptree_image_copy(struct intel_context *intel,
/* i915_mipmap_tree.c:
*/
GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt);
GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt);
GLboolean brw_miptree_layout(struct intel_context *intel,
struct intel_mipmap_tree *mt);
void i915_miptree_layout(struct intel_mipmap_tree *mt);
void i945_miptree_layout(struct intel_mipmap_tree *mt);
void brw_miptree_layout(struct intel_context *intel,
struct intel_mipmap_tree *mt);
#endif