diff options
author | Roland Scheidegger <[email protected]> | 2005-10-13 14:30:20 +0000 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2005-10-13 14:30:20 +0000 |
commit | 30daa7529331057ecb470efb500152e9c4aa1ae5 (patch) | |
tree | 40faf1f7190d9d06b046f4706601a5659a1ad32c /src/mesa/drivers/dri/radeon/radeon_context.c | |
parent | ed2f8635f006886a16da07c77bcab8094229042c (diff) |
enable 3rd texture unit on radeon (default still 2 enabled units). Disable some multitexcoord codegen stuff noone understands to make it work. Replace most code testing explicitly for unit 0 and 1 with loops instead of adding test for unit 2, smaller/more readable code at the cost of maybe some slight performance hit. (Code provided by Andreas Stenglein, some adjustments by me.)
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_context.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_context.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index abb2c72e79c..9ab6e676780 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -69,7 +69,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_secondary_color #include "extension_helper.h" -#define DRIVER_DATE "20050831" +#define DRIVER_DATE "20051008" #include "vblank.h" #include "utils.h" @@ -327,9 +327,10 @@ radeonCreateContext( const __GLcontextModes *glVisual, */ ctx = rmesa->glCtx; - ctx->Const.MaxTextureUnits = 2; - ctx->Const.MaxTextureImageUnits = 2; - ctx->Const.MaxTextureCoordUnits = 2; + ctx->Const.MaxTextureUnits = driQueryOptioni (&rmesa->optionCache, + "texture_units"); + ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; + ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; driCalculateMaxTextureLevels( rmesa->texture_heaps, rmesa->nr_heaps, @@ -403,14 +404,12 @@ radeonCreateContext( const __GLcontextModes *glVisual, _tnl_allow_vertex_fog( ctx, GL_TRUE ); - _math_matrix_ctr( &rmesa->TexGenMatrix[0] ); - _math_matrix_ctr( &rmesa->TexGenMatrix[1] ); - _math_matrix_ctr( &rmesa->tmpmat[0] ); - _math_matrix_ctr( &rmesa->tmpmat[1] ); - _math_matrix_set_identity( &rmesa->TexGenMatrix[0] ); - _math_matrix_set_identity( &rmesa->TexGenMatrix[1] ); - _math_matrix_set_identity( &rmesa->tmpmat[0] ); - _math_matrix_set_identity( &rmesa->tmpmat[1] ); + for ( i = 0 ; i < RADEON_MAX_TEXTURE_UNITS ; i++ ) { + _math_matrix_ctr( &rmesa->TexGenMatrix[i] ); + _math_matrix_ctr( &rmesa->tmpmat[i] ); + _math_matrix_set_identity( &rmesa->TexGenMatrix[i] ); + _math_matrix_set_identity( &rmesa->tmpmat[i] ); + } driInitExtensions( ctx, card_extensions, GL_TRUE ); if (rmesa->glCtx->Mesa_DXTn) { |