i965: Use the miptree format for texture surface format choice.
authorEric Anholt <eric@anholt.net>
Tue, 13 Dec 2011 20:40:09 +0000 (12:40 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 19 Dec 2011 21:20:11 +0000 (13:20 -0800)
With separate stencil GL_DEPTH32F_STENCIL8, the miptree will have a
really different format (MESA_FORMAT_Z32_FLOAT) from the teximage
(MESA_FORMAT_Z32_FLOAT_X24S8).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c

index f9b0b714a80d57639e65e1f6bb4cc7eed31c3d79..d36b6f871b19330cb471679dec2c3ea9a664a602 100644 (file)
@@ -632,7 +632,7 @@ brw_update_texture_surface( struct gl_context *ctx, GLuint unit )
    surf[0] = (translate_tex_target(tObj->Target) << BRW_SURFACE_TYPE_SHIFT |
              BRW_SURFACE_MIPMAPLAYOUT_BELOW << BRW_SURFACE_MIPLAYOUT_SHIFT |
              BRW_SURFACE_CUBEFACE_ENABLES |
-             (translate_tex_format(firstImage->TexFormat,
+             (translate_tex_format(mt->format,
                                    firstImage->InternalFormat,
                                    sampler->DepthMode,
                                    sampler->sRGBDecode) <<
index 0defa676bd51a21c59411ba1ef377287ed034971..1c0183b70c1e8497863312d71175b4e06b5bca68 100644 (file)
@@ -76,7 +76,7 @@ gen7_update_texture_surface(struct gl_context *ctx, GLuint unit)
       surf->ss0.vertical_alignment = 1;
 
    surf->ss0.surface_type = translate_tex_target(tObj->Target);
-   surf->ss0.surface_format = translate_tex_format(firstImage->TexFormat,
+   surf->ss0.surface_format = translate_tex_format(mt->format,
                                                    firstImage->InternalFormat,
                                                    sampler->DepthMode,
                                                    sampler->sRGBDecode);