i965: Move is_hiz_depth_format out of the vtable.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 29 Jun 2013 02:26:07 +0000 (19:26 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Jul 2013 17:48:14 +0000 (10:48 -0700)
brw_is_hiz_depth_format() is the only implementation of this function,
so it makes sense to just call it directly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_surface_formats.c
src/mesa/drivers/dri/i965/brw_vtbl.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 f54a937cc1ecc3faa6a861f410b718b7ca34c4b9..a1901149200ad12cdbde80952d274e4850e641ee 100644 (file)
@@ -1211,6 +1211,9 @@ void brw_upload_ubo_surfaces(struct brw_context *brw,
                             struct gl_shader *shader,
                             uint32_t *surf_offsets);
 
+/* brw_surface_formats.c */
+bool brw_is_hiz_depth_format(struct intel_context *ctx, gl_format format);
+
 /* gen6_sol.c */
 void
 brw_begin_transform_feedback(struct gl_context *ctx, GLenum mode,
index c378f02daf9f7404e37eea15d0007dcf12d14a3a..28a4b3abc128e994b0b6e23db9b9ffff1093e604 100644 (file)
@@ -729,3 +729,22 @@ translate_tex_format(struct intel_context *intel,
       return brw_format_for_mesa_format(mesa_format);
    }
 }
+
+/** Can HiZ be enabled on a depthbuffer of the given format? */
+bool
+brw_is_hiz_depth_format(struct intel_context *intel, gl_format format)
+{
+   if (!intel->has_hiz)
+      return false;
+
+   switch (format) {
+   case MESA_FORMAT_Z32_FLOAT:
+   case MESA_FORMAT_Z32_FLOAT_X24S8:
+   case MESA_FORMAT_X8_Z24:
+   case MESA_FORMAT_S8_Z24:
+   case MESA_FORMAT_Z16:
+      return true;
+   default:
+      return false;
+   }
+}
index cd51c91c802bb6f4a62958d807eb6ef41a489dcd..0288322e652292034933e7557b525f9f8c0a2877 100644 (file)
@@ -154,27 +154,6 @@ static void brw_new_batch( struct intel_context *intel )
       brw_collect_and_report_shader_time(brw);
 }
 
-/**
- * \see intel_context.vtbl.is_hiz_depth_format
- */
-static bool brw_is_hiz_depth_format(struct intel_context *intel,
-                                    gl_format format)
-{
-   if (!intel->has_hiz)
-      return false;
-
-   switch (format) {
-   case MESA_FORMAT_Z32_FLOAT:
-   case MESA_FORMAT_Z32_FLOAT_X24S8:
-   case MESA_FORMAT_X8_Z24:
-   case MESA_FORMAT_S8_Z24:
-   case MESA_FORMAT_Z16:
-      return true;
-   default:
-      return false;
-   }
-}
-
 void brwInitVtbl( struct brw_context *brw )
 {
    brw->intel.vtbl.new_batch = brw_new_batch;
@@ -183,7 +162,6 @@ void brwInitVtbl( struct brw_context *brw )
    brw->intel.vtbl.debug_batch = brw_debug_batch;
    brw->intel.vtbl.annotate_aub = brw_annotate_aub;
    brw->intel.vtbl.render_target_supported = brw_render_target_supported;
-   brw->intel.vtbl.is_hiz_depth_format = brw_is_hiz_depth_format;
 
    assert(brw->intel.gen >= 4);
    if (brw->intel.gen >= 7) {
index 90a10fa0bf0ce307f9726e5c3579477e34ed5f1d..19b2f9f0cb386d5ffcdf704f1650fa59e2ca0bcf 100644 (file)
@@ -124,10 +124,6 @@ struct intel_context
       bool (*render_target_supported)(struct intel_context *intel,
                                      struct gl_renderbuffer *rb);
 
-      /** Can HiZ be enabled on a depthbuffer of the given format? */
-      bool (*is_hiz_depth_format)(struct intel_context *intel,
-                                 gl_format format);
-
       void (*update_texture_surface)(struct gl_context *ctx,
                                      unsigned unit,
                                      uint32_t *binding_table,
index 9ef9b70fff5f2c1e1ced0554b5db2652306a8db6..a82fb41f59838b038fdd46200e6fd24bf50e06ba 100644 (file)
@@ -441,8 +441,7 @@ intel_renderbuffer_update_wrapper(struct intel_context *intel,
 
    intel_renderbuffer_set_draw_offset(irb);
 
-   if (mt->hiz_mt == NULL &&
-       intel->vtbl.is_hiz_depth_format(intel, rb->Format)) {
+   if (mt->hiz_mt == NULL && brw_is_hiz_depth_format(intel, rb->Format)) {
       intel_miptree_alloc_hiz(intel, mt);
       if (!mt->hiz_mt)
         return false;
@@ -862,7 +861,7 @@ intel_renderbuffer_move_to_temp(struct intel_context *intel,
                                  irb->mt->num_samples,
                                  INTEL_MIPTREE_TILING_ANY);
 
-   if (intel->vtbl.is_hiz_depth_format(intel, new_mt->format)) {
+   if (brw_is_hiz_depth_format(intel, new_mt->format)) {
       intel_miptree_alloc_hiz(intel, new_mt);
    }
 
index df097d52be86f46a796cfaedf30338ba2e7ec142..e9b2464b6656448f3a656b6e8773cfcd4535a8af 100644 (file)
@@ -369,7 +369,7 @@ intel_miptree_create_layout(struct intel_context *intel,
        _mesa_get_format_base_format(format) == GL_DEPTH_STENCIL &&
        (intel->must_use_separate_stencil ||
        (intel->has_separate_stencil &&
-        intel->vtbl.is_hiz_depth_format(intel, format)))) {
+        brw_is_hiz_depth_format(intel, format)))) {
       mt->stencil_mt = intel_miptree_create(intel,
                                             mt->target,
                                             MESA_FORMAT_S8,
@@ -741,7 +741,7 @@ intel_miptree_create_for_renderbuffer(struct intel_context *intel,
    if (!mt)
       goto fail;
 
-   if (intel->vtbl.is_hiz_depth_format(intel, format)) {
+   if (brw_is_hiz_depth_format(intel, format)) {
       ok = intel_miptree_alloc_hiz(intel, mt);
       if (!ok)
          goto fail;