i965: Mostly fix glsl-max-varyings.
[mesa.git] / src / mesa / drivers / dri / r300 / r300_tex.c
index eb5d2d500418c8dc44466ed4ec1fec9e00e4721a..baef206bc26e256563a4a27a3393cb97c77781e0 100644 (file)
@@ -41,18 +41,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/mipmap.h"
 #include "main/simple_list.h"
 #include "main/texstore.h"
-#include "main/teximage.h"
 #include "main/texobj.h"
 
 #include "texmem.h"
 
 #include "r300_context.h"
-#include "r300_state.h"
 #include "radeon_mipmap_tree.h"
 #include "r300_tex.h"
 
-#include "xmlpool.h"
-
 
 static unsigned int translate_wrap_mode(GLenum wrapmode)
 {
@@ -312,6 +308,45 @@ static struct gl_texture_object *r300NewTextureObject(GLcontext * ctx,
        return &t->base;
 }
 
+unsigned r300IsFormatRenderable(gl_format mesa_format)
+{
+       switch (mesa_format)
+       {
+               case MESA_FORMAT_RGB565:
+               case MESA_FORMAT_RGBA5551:
+               case MESA_FORMAT_RGBA8888:
+               case MESA_FORMAT_RGB565_REV:
+               case MESA_FORMAT_RGBA8888_REV:
+               case MESA_FORMAT_ARGB4444:
+               case MESA_FORMAT_ARGB1555:
+               case MESA_FORMAT_XRGB8888:
+               case MESA_FORMAT_ARGB8888:
+               case MESA_FORMAT_ARGB4444_REV:
+               case MESA_FORMAT_ARGB1555_REV:
+               case MESA_FORMAT_XRGB8888_REV:
+               case MESA_FORMAT_ARGB8888_REV:
+               case MESA_FORMAT_SRGBA8:
+               case MESA_FORMAT_SARGB8:
+               case MESA_FORMAT_SL8:
+               case MESA_FORMAT_A8:
+               case MESA_FORMAT_L8:
+               case MESA_FORMAT_I8:
+               case MESA_FORMAT_Z16:
+                       return 1;
+               default:
+                       return 0;
+       }
+}
+
+unsigned r500IsFormatRenderable(gl_format mesa_format)
+{
+       if (mesa_format == MESA_FORMAT_S8_Z24) {
+               return 1;
+       } else {
+               return r300IsFormatRenderable(mesa_format);
+       }
+}
+
 void r300InitTextureFuncs(radeonContextPtr radeon, struct dd_function_table *functions)
 {
        /* Note: we only plug in the functions we implement in the driver