1 /**************************************************************************
3 Copyright 2000 Silicon Integrated Systems Corp, Inc., HsinChu, Taiwan.
4 Copyright 2003 Eric Anholt
7 Permission is hereby granted, free of charge, to any person obtaining a
8 copy of this software and associated documentation files (the "Software"),
9 to deal in the Software without restriction, including without limitation
10 on the rights to use, copy, modify, merge, publish, distribute, sub
11 license, and/or sell copies of the Software, and to permit persons to whom
12 the Software is furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice (including the next
15 paragraph) shall be included in all copies or substantial portions of the
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 ERIC ANHOLT OR SILICON INTEGRATED SYSTEMS CORP BE LIABLE FOR ANY CLAIM,
22 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
31 * Sung-Ching Lin <sclin@sis.com.tw>
32 * Eric Anholt <anholt@FreeBSD.org>
40 #include "texformat.h"
42 #include "sis_context.h"
43 #include "sis_state.h"
46 #include "sis_alloc.h"
48 static GLint
TransferTexturePitch (GLint dwPitch
);
50 /* Handle texenv stuff, called from validate_texture (renderstart) */
52 sis_set_texture_env0( GLcontext
*ctx
, struct gl_texture_object
*texObj
,
55 sisContextPtr smesa
= SIS_CONTEXT(ctx
);
58 __GLSiSHardware
*prev
= &smesa
->prev
;
59 __GLSiSHardware
*current
= &smesa
->current
;
61 struct gl_texture_unit
*texture_unit
= &ctx
->Texture
.Unit
[unit
];
63 sisTexObjPtr t
= texObj
->DriverData
;
65 switch (texture_unit
->EnvMode
)
71 current
->hwTexBlendColor0
= STAGE0_C_CF
;
72 current
->hwTexBlendAlpha0
= STAGE0_A_AS
;
77 current
->hwTexBlendColor0
= STAGE0_C_CS
;
78 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
81 case GL_LUMINANCE_ALPHA
:
83 current
->hwTexBlendColor0
= STAGE0_C_CS
;
84 current
->hwTexBlendAlpha0
= STAGE0_A_AS
;
87 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
95 current
->hwTexBlendColor0
= STAGE0_C_CF
;
96 current
->hwTexBlendAlpha0
= STAGE0_A_AFAS
;
101 current
->hwTexBlendColor0
= STAGE0_C_CFCS
;
102 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
105 case GL_LUMINANCE_ALPHA
:
107 current
->hwTexBlendColor0
= STAGE0_C_CFCS
;
108 current
->hwTexBlendAlpha0
= STAGE0_A_AFAS
;
111 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
120 current
->hwTexBlendColor0
= STAGE0_C_CS
;
121 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
124 current
->hwTexBlendColor0
= STAGE0_C_CFOMAS_CSAS
;
125 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
130 case GL_LUMINANCE_ALPHA
:
131 current
->hwTexBlendColor0
= STAGE0_C_CF
;
132 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
135 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
140 UNCLAMPED_FLOAT_TO_RGBA_CHAN(c
, texture_unit
->EnvColor
);
141 current
->hwTexEnvColor
= ((GLint
) (c
[3])) << 24 |
142 ((GLint
) (c
[0])) << 16 |
143 ((GLint
) (c
[1])) << 8 |
148 current
->hwTexBlendColor0
= STAGE0_C_CF
;
149 current
->hwTexBlendAlpha0
= STAGE0_A_AFAS
;
154 current
->hwTexBlendColor0
= STAGE0_C_CFOMCS_CCCS
;
155 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
158 current
->hwTexBlendColor0
= STAGE0_C_CFOMCS_CCCS
;
159 current
->hwTexBlendAlpha0
= STAGE0_A_AFOMAS_ACAS
;
161 case GL_LUMINANCE_ALPHA
:
163 current
->hwTexBlendColor0
= STAGE0_C_CFOMCS_CCCS
;
164 current
->hwTexBlendAlpha0
= STAGE0_A_AFAS
;
167 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
172 sis_fatal_error("unknown env mode 0x%x\n", texture_unit
->EnvMode
);
175 if ((current
->hwTexBlendColor0
!= prev
->hwTexBlendColor0
) ||
176 (current
->hwTexBlendAlpha0
!= prev
->hwTexBlendAlpha0
) ||
177 (current
->hwTexEnvColor
!= prev
->hwTexEnvColor
))
179 prev
->hwTexEnvColor
= current
->hwTexEnvColor
;
180 prev
->hwTexBlendColor0
= current
->hwTexBlendColor0
;
181 prev
->hwTexBlendAlpha0
= current
->hwTexBlendAlpha0
;
182 smesa
->GlobalFlag
|= GFLAG_TEXTUREENV
;
186 /* Handle texenv stuff, called from validate_texture (renderstart) */
188 sis_set_texture_env1( GLcontext
*ctx
, struct gl_texture_object
*texObj
,
191 sisContextPtr smesa
= SIS_CONTEXT(ctx
);
194 __GLSiSHardware
*prev
= &smesa
->prev
;
195 __GLSiSHardware
*current
= &smesa
->current
;
197 struct gl_texture_unit
*texture_unit
= &ctx
->Texture
.Unit
[unit
];
199 sisTexObjPtr t
= texObj
->DriverData
;
201 switch (texture_unit
->EnvMode
)
207 current
->hwTexBlendColor1
= STAGE1_C_CF
;
208 current
->hwTexBlendAlpha1
= STAGE1_A_AS
;
213 current
->hwTexBlendColor1
= STAGE1_C_CS
;
214 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
217 case GL_LUMINANCE_ALPHA
:
219 current
->hwTexBlendColor1
= STAGE1_C_CS
;
220 current
->hwTexBlendAlpha1
= STAGE1_A_AS
;
223 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
231 current
->hwTexBlendColor1
= STAGE1_C_CF
;
232 current
->hwTexBlendAlpha1
= STAGE1_A_AFAS
;
237 current
->hwTexBlendColor1
= STAGE1_C_CFCS
;
238 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
241 case GL_LUMINANCE_ALPHA
:
243 current
->hwTexBlendColor1
= STAGE1_C_CFCS
;
244 current
->hwTexBlendAlpha1
= STAGE1_A_AFAS
;
247 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
256 current
->hwTexBlendColor1
= STAGE1_C_CS
;
257 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
260 current
->hwTexBlendColor1
= STAGE1_C_CFOMAS_CSAS
;
261 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
266 case GL_LUMINANCE_ALPHA
:
267 current
->hwTexBlendColor1
= STAGE1_C_CF
;
268 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
271 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
276 UNCLAMPED_FLOAT_TO_RGBA_CHAN(c
, texture_unit
->EnvColor
);
277 current
->hwTexEnvColor
= ((GLint
) (c
[3])) << 24 |
278 ((GLint
) (c
[0])) << 16 |
279 ((GLint
) (c
[1])) << 8 |
284 current
->hwTexBlendColor1
= STAGE1_C_CF
;
285 current
->hwTexBlendAlpha1
= STAGE1_A_AFAS
;
290 current
->hwTexBlendColor1
= STAGE1_C_CFOMCS_CCCS
;
291 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
294 current
->hwTexBlendColor1
= STAGE1_C_CFOMCS_CCCS
;
295 current
->hwTexBlendAlpha1
= STAGE1_A_AFOMAS_ACAS
;
297 case GL_LUMINANCE_ALPHA
:
299 current
->hwTexBlendColor1
= STAGE1_C_CFOMCS_CCCS
;
300 current
->hwTexBlendAlpha1
= STAGE1_A_AFAS
;
303 sis_fatal_error("unknown base format 0x%x\n", t
->format
);
308 sis_fatal_error("unknown env mode 0x%x\n", texture_unit
->EnvMode
);
311 if ((current
->hwTexBlendColor1
!= prev
->hwTexBlendColor1
) ||
312 (current
->hwTexBlendAlpha1
!= prev
->hwTexBlendAlpha1
) ||
313 (current
->hwTexEnvColor
!= prev
->hwTexEnvColor
))
315 prev
->hwTexBlendColor1
= current
->hwTexBlendColor1
;
316 prev
->hwTexBlendAlpha1
= current
->hwTexBlendAlpha1
;
317 prev
->hwTexEnvColor
= current
->hwTexEnvColor
;
318 smesa
->GlobalFlag
|= GFLAG_TEXTUREENV_1
;
322 /* Returns 0 if a software fallback is necessary */
324 sis_set_texobj_parm( GLcontext
*ctx
, struct gl_texture_object
*texObj
,
327 sisContextPtr smesa
= SIS_CONTEXT(ctx
);
330 __GLSiSHardware
*prev
= &smesa
->prev
;
331 __GLSiSHardware
*current
= &smesa
->current
;
333 sisTexObjPtr t
= texObj
->DriverData
;
335 GLint firstLevel
, lastLevel
;
338 current
->texture
[hw_unit
].hwTextureMip
= 0UL;
339 current
->texture
[hw_unit
].hwTextureSet
= t
->hwformat
;
341 if ((texObj
->MinFilter
== GL_NEAREST
) || (texObj
->MinFilter
== GL_LINEAR
)) {
342 firstLevel
= lastLevel
= texObj
->BaseLevel
;
344 /* Compute which mipmap levels we really want to send to the hardware.
345 * This depends on the base image size, GL_TEXTURE_MIN_LOD,
346 * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL and GL_TEXTURE_MAX_LEVEL.
347 * Yes, this looks overly complicated, but it's all needed.
350 firstLevel
= texObj
->BaseLevel
+ (GLint
)(texObj
->MinLod
+ 0.5);
351 firstLevel
= MAX2(firstLevel
, texObj
->BaseLevel
);
352 lastLevel
= texObj
->BaseLevel
+ (GLint
)(texObj
->MaxLod
+ 0.5);
353 lastLevel
= MAX2(lastLevel
, texObj
->BaseLevel
);
354 lastLevel
= MIN2(lastLevel
, texObj
->BaseLevel
+
355 texObj
->Image
[0][texObj
->BaseLevel
]->MaxLog2
);
356 lastLevel
= MIN2(lastLevel
, texObj
->MaxLevel
);
357 lastLevel
= MAX2(firstLevel
, lastLevel
); /* need at least one level */
360 current
->texture
[hw_unit
].hwTextureSet
|= (lastLevel
<< 8);
362 switch (texObj
->MagFilter
)
365 current
->texture
[hw_unit
].hwTextureMip
|= TEXTURE_FILTER_NEAREST
;
368 current
->texture
[hw_unit
].hwTextureMip
|= (TEXTURE_FILTER_LINEAR
<< 3);
375 /* The mipmap lod biasing is based on experiment. It seems there's a
376 * limit of around +4/-4 to the bias value; we're being conservative.
378 b
= (GLint
) (ctx
->Texture
.Unit
[hw_unit
].LodBias
* 32.0);
384 current
->texture
[hw_unit
].hwTextureMip
|= ((b
<< 4) &
385 MASK_TextureMipmapLodBias
);
388 switch (texObj
->MinFilter
)
391 current
->texture
[hw_unit
].hwTextureMip
|= TEXTURE_FILTER_NEAREST
;
394 current
->texture
[hw_unit
].hwTextureMip
|= TEXTURE_FILTER_LINEAR
;
396 case GL_NEAREST_MIPMAP_NEAREST
:
397 current
->texture
[hw_unit
].hwTextureMip
|=
398 TEXTURE_FILTER_NEAREST_MIP_NEAREST
;
400 case GL_NEAREST_MIPMAP_LINEAR
:
401 current
->texture
[hw_unit
].hwTextureMip
|=
402 TEXTURE_FILTER_NEAREST_MIP_LINEAR
;
404 case GL_LINEAR_MIPMAP_NEAREST
:
405 current
->texture
[hw_unit
].hwTextureMip
|=
406 TEXTURE_FILTER_LINEAR_MIP_NEAREST
;
408 case GL_LINEAR_MIPMAP_LINEAR
:
409 current
->texture
[hw_unit
].hwTextureMip
|=
410 TEXTURE_FILTER_LINEAR_MIP_LINEAR
;
414 switch (texObj
->WrapS
)
417 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureWrapU
;
419 case GL_MIRRORED_REPEAT
:
420 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureMirrorU
;
423 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureClampU
;
424 /* XXX: GL_CLAMP isn't conformant, but falling back makes the situation
425 * worse in other programs at the moment.
429 case GL_CLAMP_TO_EDGE
:
430 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureClampU
;
432 case GL_CLAMP_TO_BORDER
:
433 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureBorderU
;
437 switch (texObj
->WrapT
)
440 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureWrapV
;
442 case GL_MIRRORED_REPEAT
:
443 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureMirrorV
;
446 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureClampV
;
447 /* XXX: GL_CLAMP isn't conformant, but falling back makes the situation
448 * worse in other programs at the moment.
452 case GL_CLAMP_TO_EDGE
:
453 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureClampV
;
455 case GL_CLAMP_TO_BORDER
:
456 current
->texture
[hw_unit
].hwTextureSet
|= MASK_TextureBorderV
;
460 current
->texture
[hw_unit
].hwTextureBorderColor
=
461 ((GLuint
) texObj
->_BorderChan
[3] << 24) +
462 ((GLuint
) texObj
->_BorderChan
[0] << 16) +
463 ((GLuint
) texObj
->_BorderChan
[1] << 8) +
464 ((GLuint
) texObj
->_BorderChan
[2]);
466 if (current
->texture
[hw_unit
].hwTextureBorderColor
!=
467 prev
->texture
[hw_unit
].hwTextureBorderColor
)
469 prev
->texture
[hw_unit
].hwTextureBorderColor
=
470 current
->texture
[hw_unit
].hwTextureBorderColor
;
472 smesa
->GlobalFlag
|= GFLAG_TEXBORDERCOLOR_1
;
474 smesa
->GlobalFlag
|= GFLAG_TEXBORDERCOLOR
;
477 current
->texture
[hw_unit
].hwTextureSet
|=
478 texObj
->Image
[0][firstLevel
]->WidthLog2
<< 4;
479 current
->texture
[hw_unit
].hwTextureSet
|=
480 texObj
->Image
[0][firstLevel
]->HeightLog2
;
483 smesa
->GlobalFlag
|= GFLAG_TEXTUREADDRESS
;
485 smesa
->GlobalFlag
|= GFLAG_TEXTUREADDRESS_1
;
487 for (i
= firstLevel
; i
<= lastLevel
; i
++)
489 GLuint texOffset
= 0;
490 GLuint texPitch
= TransferTexturePitch( t
->image
[i
].pitch
);
492 switch (t
->image
[i
].memType
)
495 texOffset
= ((unsigned long)t
->image
[i
].Data
- (unsigned long)smesa
->FbBase
);
498 texOffset
= ((unsigned long)t
->image
[i
].Data
- (unsigned long)smesa
->AGPBase
) +
499 (unsigned long) smesa
->AGPAddr
;
500 current
->texture
[hw_unit
].hwTextureMip
|=
501 (MASK_TextureLevel0InSystem
<< i
);
508 prev
->texture
[hw_unit
].texOffset0
= texOffset
;
509 prev
->texture
[hw_unit
].texPitch01
= texPitch
<< 16;
512 prev
->texture
[hw_unit
].texOffset1
= texOffset
;
513 prev
->texture
[hw_unit
].texPitch01
|= texPitch
;
516 prev
->texture
[hw_unit
].texOffset2
= texOffset
;
517 prev
->texture
[hw_unit
].texPitch23
= texPitch
<< 16;
520 prev
->texture
[hw_unit
].texOffset3
= texOffset
;
521 prev
->texture
[hw_unit
].texPitch23
|= texPitch
;
524 prev
->texture
[hw_unit
].texOffset4
= texOffset
;
525 prev
->texture
[hw_unit
].texPitch45
= texPitch
<< 16;
528 prev
->texture
[hw_unit
].texOffset5
= texOffset
;
529 prev
->texture
[hw_unit
].texPitch45
|= texPitch
;
532 prev
->texture
[hw_unit
].texOffset6
= texOffset
;
533 prev
->texture
[hw_unit
].texPitch67
= texPitch
<< 16;
536 prev
->texture
[hw_unit
].texOffset7
= texOffset
;
537 prev
->texture
[hw_unit
].texPitch67
|= texPitch
;
540 prev
->texture
[hw_unit
].texOffset8
= texOffset
;
541 prev
->texture
[hw_unit
].texPitch89
= texPitch
<< 16;
544 prev
->texture
[hw_unit
].texOffset9
= texOffset
;
545 prev
->texture
[hw_unit
].texPitch89
|= texPitch
;
548 prev
->texture
[hw_unit
].texOffset10
= texOffset
;
549 prev
->texture
[hw_unit
].texPitch10
= texPitch
<< 16;
552 prev
->texture
[hw_unit
].texOffset11
= texOffset
;
553 prev
->texture
[hw_unit
].texPitch10
|= texPitch
;
558 if (current
->texture
[hw_unit
].hwTextureSet
!=
559 prev
->texture
[hw_unit
].hwTextureSet
)
561 prev
->texture
[hw_unit
].hwTextureSet
=
562 current
->texture
[hw_unit
].hwTextureSet
;
564 smesa
->GlobalFlag
|= CFLAG_TEXTURERESET_1
;
566 smesa
->GlobalFlag
|= CFLAG_TEXTURERESET
;
568 if (current
->texture
[hw_unit
].hwTextureMip
!=
569 prev
->texture
[hw_unit
].hwTextureMip
)
571 prev
->texture
[hw_unit
].hwTextureMip
=
572 current
->texture
[hw_unit
].hwTextureMip
;
574 smesa
->GlobalFlag
|= GFLAG_TEXTUREMIPMAP_1
;
576 smesa
->GlobalFlag
|= GFLAG_TEXTUREMIPMAP
;
582 /* Disable a texture unit, called from validate_texture */
584 sis_reset_texture_env (GLcontext
*ctx
, int hw_unit
)
586 sisContextPtr smesa
= SIS_CONTEXT(ctx
);
588 __GLSiSHardware
*prev
= &smesa
->prev
;
589 __GLSiSHardware
*current
= &smesa
->current
;
593 current
->hwTexBlendColor1
= STAGE1_C_CF
;
594 current
->hwTexBlendAlpha1
= STAGE1_A_AF
;
596 if ((current
->hwTexBlendColor1
!= prev
->hwTexBlendColor1
) ||
597 (current
->hwTexBlendAlpha1
!= prev
->hwTexBlendAlpha1
) ||
598 (current
->hwTexEnvColor
!= prev
->hwTexEnvColor
))
600 prev
->hwTexBlendColor1
= current
->hwTexBlendColor1
;
601 prev
->hwTexBlendAlpha1
= current
->hwTexBlendAlpha1
;
602 prev
->hwTexEnvColor
= current
->hwTexEnvColor
;
603 smesa
->GlobalFlag
|= GFLAG_TEXTUREENV_1
;
606 current
->hwTexBlendColor0
= STAGE0_C_CF
;
607 current
->hwTexBlendAlpha0
= STAGE0_A_AF
;
609 if ((current
->hwTexBlendColor0
!= prev
->hwTexBlendColor0
) ||
610 (current
->hwTexBlendAlpha0
!= prev
->hwTexBlendAlpha0
) ||
611 (current
->hwTexEnvColor
!= prev
->hwTexEnvColor
))
613 prev
->hwTexBlendColor0
= current
->hwTexBlendColor0
;
614 prev
->hwTexBlendAlpha0
= current
->hwTexBlendAlpha0
;
615 prev
->hwTexEnvColor
= current
->hwTexEnvColor
;
616 smesa
->GlobalFlag
|= GFLAG_TEXTUREENV
;
621 static void updateTextureUnit( GLcontext
*ctx
, int unit
)
623 sisContextPtr smesa
= SIS_CONTEXT( ctx
);
624 const struct gl_texture_unit
*texUnit
= &ctx
->Texture
.Unit
[unit
];
625 struct gl_texture_object
*texObj
= texUnit
->_Current
;
629 fallbackbit
= SIS_FALLBACK_TEXTURE0
;
631 fallbackbit
= SIS_FALLBACK_TEXTURE1
;
633 if (texUnit
->_ReallyEnabled
& (TEXTURE_1D_BIT
| TEXTURE_2D_BIT
)) {
634 if (smesa
->TexStates
[unit
] & NEW_TEXTURING
) {
637 ok
= sis_set_texobj_parm (ctx
, texObj
, unit
);
638 FALLBACK( smesa
, fallbackbit
, !ok
);
640 if (smesa
->TexStates
[unit
] & NEW_TEXTURE_ENV
) {
642 sis_set_texture_env0( ctx
, texObj
, unit
);
644 sis_set_texture_env1( ctx
, texObj
, unit
);
646 smesa
->TexStates
[unit
] = 0;
647 } else if ( texUnit
->_ReallyEnabled
) {
649 FALLBACK( smesa
, fallbackbit
, 1 );
651 sis_reset_texture_env( ctx
, unit
);
652 FALLBACK( smesa
, fallbackbit
, 0 );
657 void sisUpdateTextureState( GLcontext
*ctx
)
659 sisContextPtr smesa
= SIS_CONTEXT( ctx
);
661 __GLSiSHardware
*current
= &smesa
->current
;
664 /* TODO : if unmark these, error in multitexture */ /* XXX */
665 for (i
= 0; i
< SIS_MAX_TEXTURES
; i
++)
666 smesa
->TexStates
[i
] |= (NEW_TEXTURING
| NEW_TEXTURE_ENV
);
669 updateTextureUnit( ctx
, 0 );
670 updateTextureUnit( ctx
, 1 );
672 /* XXX Issues with the 2nd unit but not the first being enabled? */
673 if ( ctx
->Texture
.Unit
[0]._ReallyEnabled
&
674 (TEXTURE_1D_BIT
| TEXTURE_2D_BIT
) ||
675 ctx
->Texture
.Unit
[1]._ReallyEnabled
&
676 (TEXTURE_1D_BIT
| TEXTURE_2D_BIT
) )
678 current
->hwCapEnable
|= MASK_TextureEnable
;
679 current
->hwCapEnable
&= ~MASK_TextureNumUsed
;
680 if (ctx
->Texture
.Unit
[1]._ReallyEnabled
)
681 current
->hwCapEnable
|= 0x00002000;
683 current
->hwCapEnable
|= 0x00001000;
685 current
->hwCapEnable
&= ~MASK_TextureEnable
;
690 BitScanForward( GLshort w
)
694 for (i
= 0; i
< 16; i
++) {
702 TransferTexturePitch( GLint dwPitch
)
706 i
= BitScanForward( (GLshort
)dwPitch
);
707 dwRet
= dwPitch
>> i
;