i965: Move intel_context::has_swizzling to brw_context.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 22:00:34 +0000 (15:00 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 9 Jul 2013 21:09:25 +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/intel_context.c
src/mesa/drivers/dri/i965/intel_context.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_tex_subimage.c

index 659f7bf3a523dfc042974aed4cbcb08f7de7e812..9c242a0d0f24bf231f27d4f73ff8fac4e3531f12 100644 (file)
@@ -876,6 +876,7 @@ struct brw_context
    uint32_t max_gtt_map_object_size;
 
    bool emit_state_always;
+   bool has_swizzling;
    bool has_surface_tile_offset;
    bool has_compr4;
    bool has_negative_rhw_bug;
index 626eab723d21bb656e169e55479ba29dd40684fe..c9a5897ec5facb4812eec04d4996642c571d6409 100644 (file)
@@ -499,7 +499,7 @@ intelInitContext(struct brw_context *brw,
    intel->must_use_separate_stencil = brw->intelScreen->hw_must_use_separate_stencil;
    intel->has_hiz = intel->gen >= 6;
    intel->has_llc = brw->intelScreen->hw_has_llc;
-   intel->has_swizzling = brw->intelScreen->hw_has_swizzling;
+   brw->has_swizzling = brw->intelScreen->hw_has_swizzling;
 
    memset(&ctx->TextureFormatSupported,
          0, sizeof(ctx->TextureFormatSupported));
index 406f3f566c90a7987c56745fd61947b916fa7bbc..3ca78c989f3ed5734dc55a63ea25cf1253b56fa4 100644 (file)
@@ -125,7 +125,6 @@ struct intel_context
    bool must_use_separate_stencil;
    bool has_hiz;
    bool has_llc;
-   bool has_swizzling;
 };
 
 /**
index c361914fa1326dc370f86be6334d2f48716de57e..8af993672713c8d98799b4f5780e0a6d5b285894 100644 (file)
@@ -1787,7 +1787,6 @@ intel_miptree_map_s8(struct brw_context *brw,
                     struct intel_miptree_map *map,
                     unsigned int level, unsigned int slice)
 {
-   struct intel_context *intel = &brw->intel;
    map->stride = map->w;
    map->buffer = map->ptr = malloc(map->stride * map->h);
    if (!map->buffer)
@@ -1810,7 +1809,7 @@ intel_miptree_map_s8(struct brw_context *brw,
            ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
                                               x + image_x + map->x,
                                               y + image_y + map->y,
-                                              intel->has_swizzling);
+                                              brw->has_swizzling);
            untiled_s8_map[y * map->w + x] = tiled_s8_map[offset];
         }
       }
@@ -1834,7 +1833,6 @@ intel_miptree_unmap_s8(struct brw_context *brw,
                       unsigned int level,
                       unsigned int slice)
 {
-   struct intel_context *intel = &brw->intel;
    if (map->mode & GL_MAP_WRITE_BIT) {
       unsigned int image_x, image_y;
       uint8_t *untiled_s8_map = map->ptr;
@@ -1847,7 +1845,7 @@ intel_miptree_unmap_s8(struct brw_context *brw,
            ptrdiff_t offset = intel_offset_S8(mt->region->pitch,
                                               x + map->x,
                                               y + map->y,
-                                              intel->has_swizzling);
+                                              brw->has_swizzling);
            tiled_s8_map[offset] = untiled_s8_map[y * map->w + x];
         }
       }
@@ -1927,7 +1925,6 @@ intel_miptree_map_depthstencil(struct brw_context *brw,
                               struct intel_miptree_map *map,
                               unsigned int level, unsigned int slice)
 {
-   struct intel_context *intel = &brw->intel;
    struct intel_mipmap_tree *z_mt = mt;
    struct intel_mipmap_tree *s_mt = mt->stencil_mt;
    bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
@@ -1961,7 +1958,7 @@ intel_miptree_map_depthstencil(struct brw_context *brw,
            ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
                                                 map_x + s_image_x,
                                                 map_y + s_image_y,
-                                                intel->has_swizzling);
+                                                brw->has_swizzling);
            ptrdiff_t z_offset = ((map_y + z_image_y) *
                                   (z_mt->region->pitch / 4) +
                                  (map_x + z_image_x));
@@ -2000,7 +1997,6 @@ intel_miptree_unmap_depthstencil(struct brw_context *brw,
                                 unsigned int level,
                                 unsigned int slice)
 {
-   struct intel_context *intel = &brw->intel;
    struct intel_mipmap_tree *z_mt = mt;
    struct intel_mipmap_tree *s_mt = mt->stencil_mt;
    bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
@@ -2022,7 +2018,7 @@ intel_miptree_unmap_depthstencil(struct brw_context *brw,
            ptrdiff_t s_offset = intel_offset_S8(s_mt->region->pitch,
                                                 x + s_image_x + map->x,
                                                 y + s_image_y + map->y,
-                                                intel->has_swizzling);
+                                                brw->has_swizzling);
            ptrdiff_t z_offset = ((y + z_image_y) *
                                   (z_mt->region->pitch / 4) +
                                  (x + z_image_x));
index 008ac8d7efc5b04fe1bd0a57e376fbcf65d23f92..1e4e98c2d7c5f7c2e4da1cd4e2cd6071cb57c2ad 100644 (file)
@@ -268,7 +268,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
                                        + (x_pixels % tile_width_pixels) * cpp;
 
          intptr_t offset_bytes = y_offset_bytes + x_offset_bytes;
-         if (intel->has_swizzling) {
+         if (brw->has_swizzling) {
 #if 0
             /* Clear, unoptimized version. */
             bool bit6 = (offset_bytes >> 6) & 1;