gallium: added a texture format sanity check/assertion in st_texture_create()
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 28 Feb 2008 18:17:30 +0000 (11:17 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 28 Feb 2008 18:36:54 +0000 (11:36 -0700)
make sure the tex format is actually supported by the driver.

src/mesa/state_tracker/st_texture.c

index c2b0aa8a4aaa0741c27f1c10da9c5af00d36c773..cbc6f849982978f883c01b0513129a6be4fc611f 100644 (file)
@@ -86,6 +86,7 @@ st_texture_create(struct st_context *st,
        _mesa_lookup_enum_by_nr(format), last_level);
 
    assert(format);
+   assert(screen->is_format_supported(screen, format, PIPE_TEXTURE));
 
    memset(&pt, 0, sizeof(pt));
    pt.target = target;