Mesa (master): i915: Don' t advertise Z formats in TextureFormatSupported on gen2

Ville Syrjala vsyrjala at kemper.freedesktop.org
Thu May 1 21:08:14 UTC 2014


Module: Mesa
Branch: master
Commit: c1d4d4999303f9167b20f4e0674b9436e6295cf7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c1d4d4999303f9167b20f4e0674b9436e6295cf7

Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Thu Apr 24 14:11:43 2014 +0300

i915: Don't advertise Z formats in TextureFormatSupported on gen2

Gen2 doesn't support texturing from Z formats, so state as much.

Reviewed-by: Eric Anholt <eric at anholt.net>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

---

 src/mesa/drivers/dri/i915/i915_context.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index ebcab94..44b0d8b 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -114,19 +114,21 @@ intel_init_texture_formats(struct gl_context *ctx)
    ctx->TextureFormatSupported[MESA_FORMAT_L8A8_UNORM] = true;
 
    /* Depth and stencil */
-   ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_S8_UINT] = true;
-   ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_X8_UINT] = true;
-
-   /*
-    * This was disabled in initial FBO enabling to avoid combinations
-    * of depth+stencil that wouldn't work together.  We since decided
-    * that it was OK, since it's up to the app to come up with the
-    * combo that actually works, so this can probably be re-enabled.
-    */
-   /*
-   ctx->TextureFormatSupported[MESA_FORMAT_Z_UNORM16] = true;
-   ctx->TextureFormatSupported[MESA_FORMAT_Z24] = true;
-   */
+   if (intel->gen == 3) {
+      ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_S8_UINT] = true;
+      ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_X8_UINT] = true;
+
+      /*
+       * This was disabled in initial FBO enabling to avoid combinations
+       * of depth+stencil that wouldn't work together.  We since decided
+       * that it was OK, since it's up to the app to come up with the
+       * combo that actually works, so this can probably be re-enabled.
+       */
+      /*
+      ctx->TextureFormatSupported[MESA_FORMAT_Z_UNORM16] = true;
+      ctx->TextureFormatSupported[MESA_FORMAT_Z24] = true;
+      */
+   }
 
    /* ctx->Extensions.MESA_ycbcr_texture */
    ctx->TextureFormatSupported[MESA_FORMAT_YCBCR] = true;




More information about the mesa-commit mailing list