gallium: added queries to determin GL_EXT_packed_depth_stencil support
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 14 Aug 2008 16:53:59 +0000 (10:53 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 14 Aug 2008 21:44:28 +0000 (15:44 -0600)
src/mesa/state_tracker/st_extensions.c

index b7444b298cfe56cb7fba069e627dc6a0eebf2693..60fd440ef773f0810fe0e7e3eab4b096f9a8d0b8 100644 (file)
@@ -218,6 +218,26 @@ void st_init_extensions(struct st_context *st)
       /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/
    }
 
+   /* GL_EXT_packed_depth_stencil requires both the ability to render to
+    * a depth/stencil buffer and texture from depth/stencil source.
+    */
+   if (screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
+                                   PIPE_TEXTURE_2D, 
+                                   PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
+       screen->is_format_supported(screen, PIPE_FORMAT_Z24S8_UNORM,
+                                   PIPE_TEXTURE_2D, 
+                                   PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+      ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
+   }
+   else if (screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
+                                        PIPE_TEXTURE_2D, 
+                                        PIPE_TEXTURE_USAGE_DEPTH_STENCIL, 0) &&
+            screen->is_format_supported(screen, PIPE_FORMAT_S8Z24_UNORM,
+                                        PIPE_TEXTURE_2D, 
+                                        PIPE_TEXTURE_USAGE_SAMPLER, 0)) {
+      ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE;
+   }
+
    if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8B8A8_SRGB,
                                    PIPE_TEXTURE_2D, 
                                    PIPE_TEXTURE_USAGE_SAMPLER, 0)) {