Support ARB_texture_env_crossbar. Changes the way programs are
[mesa.git] / src / mesa / main / colortab.c
index 4eafe3e899fcfecba3f804169d06e2fca5809984..600ebd2fb99b313e779f915865932e118bd5986a 100644 (file)
@@ -483,7 +483,6 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
    table->Size = width;
    table->IntFormat = internalFormat;
    table->Format = (GLenum) baseFormat;
-   set_component_sizes(table);
 
    comps = _mesa_components_in_format(table->Format);
    assert(comps > 0);  /* error should have been caught sooner */
@@ -520,6 +519,9 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat,
       }
    } /* proxy */
 
+   /* do this after the table's Type and Format are set */
+   set_component_sizes(table);
+
    if (texObj || target == GL_SHARED_TEXTURE_PALETTE_EXT) {
       /* texture object palette, texObj==NULL means the shared palette */
       if (ctx->Driver.UpdateTexturePalette) {