[Mesa-dev] [PATCH] i965/meta/hack: Prepare stencil blit for ARB_texture_stencil8

Topi Pohjolainen topi.pohjolainen at intel.com
Mon Apr 6 12:50:15 PDT 2015


This allows _mesa_base_tex_format() to be fixed to use correct
extension when choosing format for stencil, ARB_texture_stencil8
and not ARB_stencil_texturing.

No piglit regressions on BDW.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c | 4 ++++
 src/mesa/drivers/dri/i965/gen8_surface_state.c    | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
index fc7018d..db07747 100644
--- a/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
+++ b/src/mesa/drivers/dri/i965/brw_meta_stencil_blit.c
@@ -387,10 +387,14 @@ set_read_rb_tex_image(struct gl_context *ctx, struct fb_tex_blit_state *blit,
       *target = tex_obj->Target;
       level = att->TextureLevel;
    } else {
+      GLenum internal_format_save = rb->InternalFormat;
+      rb->InternalFormat = GL_DEPTH_STENCIL;
       if (!_mesa_meta_bind_rb_as_tex_image(ctx, rb, &blit->tempTex, &tex_obj,
                                           target)) {
+         rb->InternalFormat = internal_format_save;
          return false;
       }
+      rb->InternalFormat = internal_format_save;
    }
 
    blit->baseLevelSave = tex_obj->BaseLevel;
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c
index 9d7ca44..93d4004 100644
--- a/src/mesa/drivers/dri/i965/gen8_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c
@@ -167,7 +167,7 @@ gen8_update_texture_surface(struct gl_context *ctx,
       return;
    }
 
-   if (tObj->StencilSampling && firstImage->_BaseFormat == GL_DEPTH_STENCIL) {
+   if (tObj->StencilSampling && mt->stencil_mt) {
       mt = mt->stencil_mt;
       format = MESA_FORMAT_S_UINT8;
    }
-- 
1.9.3



More information about the mesa-dev mailing list