drivers: don't include texformat.h
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_texstate.c
index ae41b90efe5d2be008e9064250151cc5793c8bba..c7786381ae5890aef89cd0d5ca565d7c8b562125 100644 (file)
@@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/colormac.h"
 #include "main/context.h"
 #include "main/macros.h"
-#include "main/texformat.h"
 #include "main/teximage.h"
 #include "main/texobj.h"
 #include "main/enums.h"
@@ -81,8 +80,10 @@ struct tx_table {
    GLuint format, filter;
 };
 
+/* XXX verify this table against MESA_FORMAT_x values */
 static const struct tx_table tx_table[] =
 {
+   _INVALID(NONE), /* MESA_FORMAT_NONE */
    _ALPHA(RGBA8888),
    _ALPHA_REV(RGBA8888),
    _ALPHA(ARGB8888),
@@ -1031,18 +1032,18 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int
    log2Width  = firstImage->WidthLog2;
    log2Height = firstImage->HeightLog2;
    log2Depth  = firstImage->DepthLog2;
-   texelBytes = firstImage->TexFormat->TexelBytes;
+   texelBytes = _mesa_get_format_bytes(firstImage->TexFormat);
 
    if (!t->image_override) {
-      if (VALID_FORMAT(firstImage->TexFormat->MesaFormat)) {
+      if (VALID_FORMAT(firstImage->TexFormat)) {
        const struct tx_table *table = tx_table;
 
         t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK |
                             RADEON_TXFORMAT_ALPHA_IN_MAP);
         t->pp_txfilter &= ~RADEON_YUV_TO_RGB;   
         
-        t->pp_txformat |= table[ firstImage->TexFormat->MesaFormat ].format;
-        t->pp_txfilter |= table[ firstImage->TexFormat->MesaFormat ].filter;
+        t->pp_txformat |= table[ firstImage->TexFormat ].format;
+        t->pp_txfilter |= table[ firstImage->TexFormat ].filter;
       } else {
         _mesa_problem(NULL, "unexpected texture format in %s",
                       __FUNCTION__);
@@ -1083,7 +1084,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int
                   | ((firstImage->Height - 1) << RADEON_TEX_VSIZE_SHIFT));
 
    if ( !t->image_override ) {
-      if (firstImage->IsCompressed)
+      if (_mesa_is_format_compressed(firstImage->TexFormat))
          t->pp_txpitch = (firstImage->Width + 63) & ~(63);
       else
          t->pp_txpitch = ((firstImage->Width * texelBytes) + 63) & ~(63);