From cbee3b03c9b329dbf27fe3ae39171a35ae556941 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 30 Aug 2017 09:35:04 +0100 Subject: [PATCH] i965: drop brw->must_use_separate_stencil in favor of devinfo's MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: Samuel Iglesias Gonsálvez Reviewed-by: Emil Velikov --- src/mesa/drivers/dri/i965/brw_context.c | 1 - src/mesa/drivers/dri/i965/brw_context.h | 1 - src/mesa/drivers/dri/i965/intel_fbo.c | 3 ++- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 +++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index e732b2c2a41..97030b70bbe 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -865,7 +865,6 @@ brwCreateContext(gl_api api, brw->needs_unlit_centroid_workaround = devinfo->needs_unlit_centroid_workaround; - brw->must_use_separate_stencil = devinfo->must_use_separate_stencil; brw->has_swizzling = screen->hw_has_swizzling; brw->isl_dev = screen->isl_dev; diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index a59977145ce..0ab89168030 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -748,7 +748,6 @@ struct brw_context bool has_hiz; bool has_separate_stencil; - bool must_use_separate_stencil; bool has_swizzling; bool has_surface_tile_offset; bool has_pln; diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c index 048d72dad8e..46f140c0280 100644 --- a/src/mesa/drivers/dri/i965/intel_fbo.c +++ b/src/mesa/drivers/dri/i965/intel_fbo.c @@ -249,6 +249,7 @@ static mesa_format intel_renderbuffer_format(struct gl_context * ctx, GLenum internalFormat) { struct brw_context *brw = brw_context(ctx); + MAYBE_UNUSED const struct gen_device_info *devinfo = &brw->screen->devinfo; switch (internalFormat) { default: @@ -270,7 +271,7 @@ intel_renderbuffer_format(struct gl_context * ctx, GLenum internalFormat) if (brw->has_separate_stencil) { return MESA_FORMAT_S_UINT8; } else { - assert(!brw->must_use_separate_stencil); + assert(!devinfo->must_use_separate_stencil); return MESA_FORMAT_Z24_UNORM_S8_UINT; } } diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 9e2ca544902..75f206a9800 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -315,10 +315,12 @@ needs_separate_stencil(const struct brw_context *brw, struct intel_mipmap_tree *mt, mesa_format format) { + const struct gen_device_info *devinfo = &brw->screen->devinfo; + if (_mesa_get_format_base_format(format) != GL_DEPTH_STENCIL) return false; - if (brw->must_use_separate_stencil) + if (devinfo->must_use_separate_stencil) return true; return brw->has_separate_stencil && -- 2.30.2