gallium: added PIPE_CAP_TEXTURE_MIRROR_CLAMP, PIPE_CAP_TEXTURE_MIRROR_REPEAT
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 23:22:29 +0000 (17:22 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 6 Aug 2008 23:22:29 +0000 (17:22 -0600)
Check for these caps in state tracker and enable corresponding GL extensions
if supported.

src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 3f9d4b0ed317aca8d29136ffa67b7147f9b2e77d..ceb5616b5d074ef3427dc7a19795b216bfd9f4d5 100644 (file)
@@ -72,6 +72,10 @@ softpipe_get_param(struct pipe_screen *screen, int param)
       return PIPE_MAX_COLOR_BUFS;
    case PIPE_CAP_OCCLUSION_QUERY:
       return 1;
+   case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
+      return 1;
+   case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
+      return 1;
    case PIPE_CAP_TEXTURE_SHADOW_MAP:
       return 1;
    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index b1d100ef53ca7109a72a3fcb74611bdd3d4b55d7..bdc6d4ef4686289b8bd89c7d74672fb809f242a1 100644 (file)
@@ -281,6 +281,9 @@ enum pipe_texture_target {
 #define PIPE_CAP_GUARD_BAND_TOP          21  /*< float */
 #define PIPE_CAP_GUARD_BAND_RIGHT        22  /*< float */
 #define PIPE_CAP_GUARD_BAND_BOTTOM       23  /*< float */
+#define PIPE_CAP_TEXTURE_MIRROR_CLAMP    24
+#define PIPE_CAP_TEXTURE_MIRROR_REPEAT   25
+
 
 
 #ifdef __cplusplus
index cacf972a1bad182e866bf25ee2f365de0249c2b7..b7444b298cfe56cb7fba069e627dc6a0eebf2693 100644 (file)
@@ -134,8 +134,6 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
    ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE;
    ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE;
-   ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; /* XXX temp */
-
    ctx->Extensions.ARB_vertex_program = GL_TRUE;
    ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE;
 
@@ -179,6 +177,14 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.ARB_shading_language_120 = GL_TRUE;
    }
 
+   if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) {
+      ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE;
+   }
+
+   if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_CLAMP) > 0) {
+      ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE;
+   }
+
    if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) {
       ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE;
       ctx->Extensions.NV_texture_rectangle = GL_TRUE;