19f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt/* 29f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt Copyright (C) Intel Corp. 2006. All Rights Reserved. 39f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to 49f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt develop this 3D driver. 59f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 69f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt Permission is hereby granted, free of charge, to any person obtaining 79f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt a copy of this software and associated documentation files (the 89f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt "Software"), to deal in the Software without restriction, including 99f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt without limitation the rights to use, copy, modify, merge, publish, 109f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt distribute, sublicense, and/or sell copies of the Software, and to 119f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt permit persons to whom the Software is furnished to do so, subject to 129f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt the following conditions: 139f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 149f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt The above copyright notice and this permission notice (including the 159f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt next paragraph) shall be included in all copies or substantial 169f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt portions of the Software. 179f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 189f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 199f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 209f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 219f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE 229f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 239f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 249f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 259f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 269f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt **********************************************************************/ 279f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt /* 289f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt * Authors: 299f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt * Keith Whitwell <keith@tungstengraphics.com> 309f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt */ 319f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 329f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 33ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/glheader.h" 34ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/mtypes.h" 35ecadb51bbcb972a79f3ed79e65a7986b9396e757Brian Paul#include "main/teximage.h" 369f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 373cd06cf8c5ef6a27e36c584e12ba79ed8dacbf28Eric Anholt#include "intel_context.h" 383cd06cf8c5ef6a27e36c584e12ba79ed8dacbf28Eric Anholt#include "intel_regions.h" 39a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt#include "intel_tex.h" 409f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt#include "brw_context.h" 419f344b3e7d6e23674dd4747faec253f103563b36Eric Anholt 42a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt/** 43a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt * Finalizes all textures, completing any rendering that needs to be done 44a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt * to prepare them. 45a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt */ 46a04b632350e5d0e9994fc667afc59407a39da0baEric Anholtvoid brw_validate_textures( struct brw_context *brw ) 47a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt{ 48f9995b30756140724f41daf963fa06167912be7fKristian Høgsberg struct gl_context *ctx = &brw->intel.ctx; 49a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt struct intel_context *intel = &brw->intel; 50a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt int i; 51a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt 52a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt for (i = 0; i < BRW_MAX_TEX_UNIT; i++) { 53052c1d66a1ab1f2665870dc77dab28d20416cdf1Eric Anholt struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; 54a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt 55a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt if (texUnit->_ReallyEnabled) { 56a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt intel_finalize_mipmap_tree(intel, i); 57a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt } 58a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt } 59a04b632350e5d0e9994fc667afc59407a39da0baEric Anholt} 60