summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-05-02 10:43:29 -0600
committerBrian Paul <[email protected]>2008-05-02 10:43:29 -0600
commitce509401738e7073de94a2b7fc41461c52a73da0 (patch)
tree5398f41169ef5bb9964c74e1881d914a3288a200
parent479d19f5a2bca79104f3b7f94147e94a52a27fea (diff)
gallium: minor code, comments clean-up
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 1eabef6d924..02ef961e4d3 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1448,17 +1448,6 @@ st_finalize_texture(GLcontext *ctx,
calculate_first_last_level(stObj);
firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);
-#if 0
- /* Fallback case:
- */
- if (firstImage->base.Border) {
- if (stObj->pt) {
- pipe_texture_release(&stObj->pt);
- }
- return GL_FALSE;
- }
-#endif
-
/* If both firstImage and stObj point to a texture which can contain
* all active images, favour firstImage. Note that because of the
* completeness requirement, we know that the image dimensions
@@ -1482,24 +1471,25 @@ st_finalize_texture(GLcontext *ctx,
cpp = firstImage->base.TexFormat->TexelBytes;
}
- /* Check texture can hold all active levels. Check texture matches
- * target, imageFormat, dimensions, etc.
+ /* If we already have a gallium texture, check that it matches the texture
+ * object's format, target, size, num_levels, etc.
*/
- if (stObj->pt &&
- (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
- stObj->pt->format !=
- st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat) ||
- stObj->pt->last_level < stObj->lastLevel ||
- stObj->pt->width[0] != firstImage->base.Width2 ||
- stObj->pt->height[0] != firstImage->base.Height2 ||
- stObj->pt->depth[0] != firstImage->base.Depth2 ||
- stObj->pt->cpp != cpp ||
- stObj->pt->compressed != firstImage->base.IsCompressed)) {
- pipe_texture_release(&stObj->pt);
+ if (stObj->pt) {
+ const enum pipe_format fmt =
+ st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat);
+ if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) ||
+ stObj->pt->format != fmt ||
+ stObj->pt->last_level < stObj->lastLevel ||
+ stObj->pt->width[0] != firstImage->base.Width2 ||
+ stObj->pt->height[0] != firstImage->base.Height2 ||
+ stObj->pt->depth[0] != firstImage->base.Depth2 ||
+ stObj->pt->cpp != cpp ||
+ stObj->pt->compressed != firstImage->base.IsCompressed) {
+ pipe_texture_release(&stObj->pt);
+ }
}
-
- /* May need to create a new texture:
+ /* May need to create a new gallium texture:
*/
if (!stObj->pt) {
stObj->pt = st_texture_create(ctx->st,