struct brw_winsys_buffer *buffer;
unsigned tiling;
unsigned pitch;
+ GLuint format;
if (templ->target != PIPE_TEXTURE_2D ||
templ->last_level != 0 ||
tex->ss.ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW;
tex->ss.ss0.surface_type = translate_tex_target(tex->base.target);
- tex->ss.ss0.surface_format = translate_tex_format(tex->base.format);
- assert(tex->ss.ss0.surface_format != BRW_SURFACEFORMAT_INVALID);
+
+ format = translate_tex_format(tex->base.format);
+ assert(format != BRW_SURFACEFORMAT_INVALID);
+ tex->ss.ss0.surface_format = format;
/* This is ok for all textures with channel width 8bit or less:
*/