gallium: add some #if FEATURE_x tests
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 12 Jun 2008 22:54:44 +0000 (16:54 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 12 Jun 2008 22:58:04 +0000 (16:58 -0600)
src/mesa/state_tracker/st_cb_blit.c
src/mesa/state_tracker/st_cb_texture.c
src/mesa/state_tracker/st_format.c

index 0533d9460fef84b9567f38335bfa8ef97c8e11db..799ef3f3be857d2f33dfb25c7b9e347cfe36aaf7 100644 (file)
@@ -106,5 +106,7 @@ st_BlitFramebuffer(GLcontext *ctx,
 void
 st_init_blit_functions(struct dd_function_table *functions)
 {
+#if FEATURE_EXT_framebuffer_blit
    functions->BlitFramebuffer = st_BlitFramebuffer;
+#endif
 }
index b2f4910225663305845882e342357f54ab026106..ed65f3b0aad54b63ebdc8280bbc4965af3171ce4 100644 (file)
@@ -97,14 +97,18 @@ static int
 compressed_num_bytes(GLuint mesaFormat)
 {
    switch(mesaFormat) {
+#if FEATURE_texture_fxt1
    case MESA_FORMAT_RGB_FXT1:
    case MESA_FORMAT_RGBA_FXT1:
+#endif
+#if FEATURE_texture_s3tc
    case MESA_FORMAT_RGB_DXT1:
    case MESA_FORMAT_RGBA_DXT1:
       return 2;
    case MESA_FORMAT_RGBA_DXT3:
    case MESA_FORMAT_RGBA_DXT5:
       return 4;
+#endif
    default:
       return 0;
    }
index 1b9325c159df3756d123b7955270180b6d3085f8..5759f393af08f3340db33f0ca6d19e46d143e02f 100644 (file)
@@ -278,6 +278,7 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat)
       return PIPE_FORMAT_S8Z24_UNORM;
    case MESA_FORMAT_YCBCR:
       return PIPE_FORMAT_YCBCR;
+#if FEATURE_texture_s3tc
    case MESA_FORMAT_RGB_DXT1:
       return PIPE_FORMAT_DXT1_RGB;
    case MESA_FORMAT_RGBA_DXT1:
@@ -286,6 +287,7 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat)
       return PIPE_FORMAT_DXT3_RGBA;
    case MESA_FORMAT_RGBA_DXT5:
       return PIPE_FORMAT_DXT5_RGBA;
+#endif
    default:
       assert(0);
       return 0;
@@ -569,6 +571,7 @@ translate_gallium_format_to_mesa_format(enum pipe_format format)
       return &_mesa_texformat_ycbcr;
    case PIPE_FORMAT_YCBCR_REV:
       return &_mesa_texformat_ycbcr_rev;
+#if FEATURE_texture_s3tc
    case PIPE_FORMAT_DXT1_RGB:
       return &_mesa_texformat_rgb_dxt1;
    case PIPE_FORMAT_DXT1_RGBA:
@@ -577,6 +580,7 @@ translate_gallium_format_to_mesa_format(enum pipe_format format)
       return &_mesa_texformat_rgba_dxt3;
    case PIPE_FORMAT_DXT5_RGBA:
       return &_mesa_texformat_rgba_dxt5;
+#endif
    /* XXX add additional cases */
    default:
       assert(0);