i965: Move must_use/has_separate_stencil fields to brw_context.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 6 Jul 2013 06:43:36 +0000 (23:43 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Jul 2013 21:09:30 +0000 (14:09 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_misc_state.c
src/mesa/drivers/dri/i965/intel_context.c
src/mesa/drivers/dri/i965/intel_context.h
src/mesa/drivers/dri/i965/intel_fbo.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c

index 52583ce3d4a45640e29e9c71ae1446067321b793..7075a6106594b1360a904354b2f2ee5803b9fa78 100644 (file)
@@ -877,6 +877,8 @@ struct brw_context
 
    bool emit_state_always;
    bool has_hiz;
+   bool has_separate_stencil;
+   bool must_use_separate_stencil;
    bool has_swizzling;
    bool has_surface_tile_offset;
    bool has_compr4;
index c9137cfd7e7da7769642d9ae23c10a9244c75d47..141a0dfe1245c29bd275dd6fe2652ccc0d26abe8 100644 (file)
@@ -629,7 +629,7 @@ brw_emit_depthbuffer(struct brw_context *brw)
        * Section 7.5.5.1.1 3DSTATE_DEPTH_BUFFER, Bit 1.27 Tiled Surface:
        *     [DevGT+]: This field must be set to TRUE.
        */
-      assert(intel->has_separate_stencil);
+      assert(brw->has_separate_stencil);
 
       depth_surface_type = BRW_SURFACE_2D;
       width = stencil_irb->Base.Base.Width;
index 47e613ac1664af36c25ec4d9be135f77a0476c0b..c1a7e0c32f54f54f6e0438aabca6b75f0ff4f50a 100644 (file)
@@ -495,8 +495,8 @@ intelInitContext(struct brw_context *brw,
       intel->is_g4x = true;
    }
 
-   intel->has_separate_stencil = brw->intelScreen->hw_has_separate_stencil;
-   intel->must_use_separate_stencil = brw->intelScreen->hw_must_use_separate_stencil;
+   brw->has_separate_stencil = brw->intelScreen->hw_has_separate_stencil;
+   brw->must_use_separate_stencil = brw->intelScreen->hw_must_use_separate_stencil;
    brw->has_hiz = intel->gen >= 6;
    intel->has_llc = brw->intelScreen->hw_has_llc;
    brw->has_swizzling = brw->intelScreen->hw_has_swizzling;
@@ -579,7 +579,7 @@ intelInitContext(struct brw_context *brw,
        brw->has_hiz = false;
        /* On gen6, you can only do separate stencil with HIZ. */
        if (intel->gen == 6)
-         intel->has_separate_stencil = false;
+         brw->has_separate_stencil = false;
    }
 
    if (driQueryOptionb(&brw->optionCache, "always_flush_batch")) {
index ef26c3e74bb16cbf013ec6b717d34b217901ba48..c99410115530654d22d92d695aee4d3bf86494da 100644 (file)
@@ -121,8 +121,6 @@ struct intel_context
    bool is_haswell;
    bool is_baytrail;
    bool is_g4x;
-   bool has_separate_stencil;
-   bool must_use_separate_stencil;
    bool has_llc;
 };
 
index d443402aa7b7dc246d784ac0780b729d64d3895c..9fbd12a68cfacc48cb7cea1ef4d4cce6dc026d7a 100644 (file)
@@ -214,10 +214,10 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer
    case GL_STENCIL_INDEX8_EXT:
    case GL_STENCIL_INDEX16_EXT:
       /* These aren't actual texture formats, so force them here. */
-      if (intel->has_separate_stencil) {
+      if (brw->has_separate_stencil) {
         rb->Format = MESA_FORMAT_S8;
       } else {
-        assert(!intel->must_use_separate_stencil);
+        assert(!brw->must_use_separate_stencil);
         rb->Format = MESA_FORMAT_S8_Z24;
       }
       break;
@@ -588,7 +588,7 @@ intel_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
                            stencilRb->mt_layer);
         }
       } else {
-        if (!intel->has_separate_stencil) {
+        if (!brw->has_separate_stencil) {
            fbo_incomplete(fb, "FBO incomplete: separate stencil "
                            "unsupported\n");
         }
index 8af993672713c8d98799b4f5780e0a6d5b285894..579383567c5133a6ea27d23c30fcfe8fd2f6e375 100644 (file)
@@ -252,7 +252,6 @@ intel_miptree_create_layout(struct brw_context *brw,
                             bool for_bo,
                             GLuint num_samples)
 {
-   struct intel_context *intel = &brw->intel;
    struct intel_mipmap_tree *mt = calloc(sizeof(*mt), 1);
    if (!mt)
       return NULL;
@@ -368,9 +367,8 @@ intel_miptree_create_layout(struct brw_context *brw,
 
    if (!for_bo &&
        _mesa_get_format_base_format(format) == GL_DEPTH_STENCIL &&
-       (intel->must_use_separate_stencil ||
-       (intel->has_separate_stencil &&
-        brw_is_hiz_depth_format(brw, format)))) {
+       (brw->must_use_separate_stencil ||
+       (brw->has_separate_stencil && brw_is_hiz_depth_format(brw, format)))) {
       mt->stencil_mt = intel_miptree_create(brw,
                                             mt->target,
                                             MESA_FORMAT_S8,